Spaces:
Running
on
Zero
Running
on
Zero
Himanshu-AT
commited on
Commit
•
f6d7e87
1
Parent(s):
dc1bb11
add dep requests
Browse files- app.py +7 -0
- requirements.txt +2 -1
app.py
CHANGED
@@ -8,6 +8,7 @@ from utils.garment_agnostic_mask_predictor import AutoMasker
|
|
8 |
from utils.densepose_predictor import DensePosePredictor
|
9 |
from utils.utils import resize_and_center
|
10 |
import spaces
|
|
|
11 |
|
12 |
import gradio as gr
|
13 |
|
@@ -96,9 +97,15 @@ def leffa_predict_vt(src_image_path, ref_image_path):
|
|
96 |
def leffa_predict_vt_image_url(person_url, garment_url):
|
97 |
if not person_url or not garment_url:
|
98 |
return None
|
|
|
99 |
src_image = fetch_image_from_url(person_url)
|
|
|
|
|
100 |
print("fetched person image")
|
|
|
101 |
ref_image = fetch_image_from_url(garment_url)
|
|
|
|
|
102 |
print("fetched garment image")
|
103 |
|
104 |
return leffa_predict(src_image, ref_image, "virtual_tryon")
|
|
|
8 |
from utils.densepose_predictor import DensePosePredictor
|
9 |
from utils.utils import resize_and_center
|
10 |
import spaces
|
11 |
+
import requests
|
12 |
|
13 |
import gradio as gr
|
14 |
|
|
|
97 |
def leffa_predict_vt_image_url(person_url, garment_url):
|
98 |
if not person_url or not garment_url:
|
99 |
return None
|
100 |
+
|
101 |
src_image = fetch_image_from_url(person_url)
|
102 |
+
if not src_image:
|
103 |
+
return None
|
104 |
print("fetched person image")
|
105 |
+
|
106 |
ref_image = fetch_image_from_url(garment_url)
|
107 |
+
if not ref_image:
|
108 |
+
return None
|
109 |
print("fetched garment image")
|
110 |
|
111 |
return leffa_predict(src_image, ref_image, "virtual_tryon")
|
requirements.txt
CHANGED
@@ -29,4 +29,5 @@ torchvision
|
|
29 |
tqdm
|
30 |
transformers
|
31 |
triton
|
32 |
-
cloudpickle
|
|
|
|
29 |
tqdm
|
30 |
transformers
|
31 |
triton
|
32 |
+
cloudpickle
|
33 |
+
requests
|