Unverified Commit dd910061 authored by bryandlee's avatar bryandlee Committed by GitHub

Merge pull request #26 from AK391/main

add side by side option to torch hub model
parents 6c2de966 50b4c151
...@@ -33,7 +33,7 @@ def generator(pretrained=True, device="cpu", progress=True, check_hash=True): ...@@ -33,7 +33,7 @@ def generator(pretrained=True, device="cpu", progress=True, check_hash=True):
return model return model
def face2paint(device="cpu", size=512): def face2paint(device="cpu", size=512, side_by_side=False):
from PIL import Image from PIL import Image
from torchvision.transforms.functional import to_tensor, to_pil_image from torchvision.transforms.functional import to_tensor, to_pil_image
...@@ -41,7 +41,7 @@ def face2paint(device="cpu", size=512): ...@@ -41,7 +41,7 @@ def face2paint(device="cpu", size=512):
model: torch.nn.Module, model: torch.nn.Module,
img: Image.Image, img: Image.Image,
size: int = size, size: int = size,
side_by_side: bool = True, side_by_side: bool = side_by_side,
device: str = device, device: str = device,
) -> Image.Image: ) -> Image.Image:
w, h = img.size w, h = img.size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment