Spaces:
Runtime error
Runtime error
change app.py
Browse files
app.py
CHANGED
@@ -26,17 +26,6 @@ from detectron2.data.detection_utils import convert_PIL_to_numpy,_apply_exif_ori
|
|
26 |
from torchvision.transforms.functional import to_pil_image
|
27 |
import amazon_oxy
|
28 |
|
29 |
-
def fetch_products(query):
|
30 |
-
result= amazon_oxy.scrape_amazon(query)
|
31 |
-
values = list(result.values())
|
32 |
-
prices = []
|
33 |
-
urls = []
|
34 |
-
for price, url in values:
|
35 |
-
prices.append(price)
|
36 |
-
urls.append(url)
|
37 |
-
return [list(result.keys()), prices, urls]
|
38 |
-
|
39 |
-
|
40 |
def pil_to_binary_mask(pil_image, threshold=0):
|
41 |
np_image = np.array(pil_image)
|
42 |
grayscale_image = Image.fromarray(np_image).convert("L")
|
@@ -50,6 +39,15 @@ def pil_to_binary_mask(pil_image, threshold=0):
|
|
50 |
output_mask = Image.fromarray(mask)
|
51 |
return output_mask
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
base_path = 'yisol/IDM-VTON'
|
55 |
example_path = os.path.join(os.path.dirname(__file__), 'example')
|
@@ -266,6 +264,7 @@ for ex_human in human_list_path:
|
|
266 |
ex_dict['composite'] = None
|
267 |
human_ex_list.append(ex_dict)
|
268 |
|
|
|
269 |
##default human
|
270 |
|
271 |
|
|
|
26 |
from torchvision.transforms.functional import to_pil_image
|
27 |
import amazon_oxy
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
def pil_to_binary_mask(pil_image, threshold=0):
|
30 |
np_image = np.array(pil_image)
|
31 |
grayscale_image = Image.fromarray(np_image).convert("L")
|
|
|
39 |
output_mask = Image.fromarray(mask)
|
40 |
return output_mask
|
41 |
|
42 |
+
def fetch_products(query):
|
43 |
+
result= amazon_oxy.scrape_amazon(query)
|
44 |
+
values = list(result.values())
|
45 |
+
prices = []
|
46 |
+
urls = []
|
47 |
+
for price, url in values:
|
48 |
+
prices.append(price)
|
49 |
+
urls.append(url)
|
50 |
+
return [list(result.keys()), prices, urls]
|
51 |
|
52 |
base_path = 'yisol/IDM-VTON'
|
53 |
example_path = os.path.join(os.path.dirname(__file__), 'example')
|
|
|
264 |
ex_dict['composite'] = None
|
265 |
human_ex_list.append(ex_dict)
|
266 |
|
267 |
+
|
268 |
##default human
|
269 |
|
270 |
|