Spaces:
Runtime error
Runtime error
cocktailpeanut
commited on
Commit
β’
24662ea
1
Parent(s):
ec0e0d5
update
Browse files
app.py
CHANGED
@@ -27,8 +27,6 @@ from torchvision.transforms.functional import to_pil_image
|
|
27 |
|
28 |
import devicetorch
|
29 |
|
30 |
-
torch_dtype = devicetorch.dtype(torch)
|
31 |
-
|
32 |
def pil_to_binary_mask(pil_image, threshold=0):
|
33 |
np_image = np.array(pil_image)
|
34 |
grayscale_image = Image.fromarray(np_image).convert("L")
|
@@ -46,7 +44,7 @@ def pil_to_binary_mask(pil_image, threshold=0):
|
|
46 |
base_path = 'yisol/IDM-VTON'
|
47 |
example_path = os.path.join(os.path.dirname(__file__), 'example')
|
48 |
|
49 |
-
dtype = devicetorch.dtype(torch)
|
50 |
unet = UNet2DConditionModel.from_pretrained(
|
51 |
base_path,
|
52 |
subfolder="unet",
|
|
|
27 |
|
28 |
import devicetorch
|
29 |
|
|
|
|
|
30 |
def pil_to_binary_mask(pil_image, threshold=0):
|
31 |
np_image = np.array(pil_image)
|
32 |
grayscale_image = Image.fromarray(np_image).convert("L")
|
|
|
44 |
base_path = 'yisol/IDM-VTON'
|
45 |
example_path = os.path.join(os.path.dirname(__file__), 'example')
|
46 |
|
47 |
+
dtype = devicetorch.dtype(torch, "float16")
|
48 |
unet = UNet2DConditionModel.from_pretrained(
|
49 |
base_path,
|
50 |
subfolder="unet",
|