Spaces:
Running
Running
Update TryYours-Virtual-Try-On/main.py
Browse files
TryYours-Virtual-Try-On/main.py
CHANGED
|
@@ -13,14 +13,15 @@ if __name__ == '__main__':
|
|
| 13 |
opt = parser.parse_args()
|
| 14 |
|
| 15 |
# Read input image
|
| 16 |
-
|
|
|
|
| 17 |
ori_img=cv2.resize(img,(768,1024))
|
| 18 |
-
cv2.imwrite("
|
| 19 |
|
| 20 |
# Resize input image
|
| 21 |
-
img=cv2.imread('origin.jpg')
|
| 22 |
img=cv2.resize(img,(384,512))
|
| 23 |
-
cv2.imwrite('resized_img.jpg',img)
|
| 24 |
|
| 25 |
# Get mask of cloth
|
| 26 |
print("Get mask of cloth\n")
|
|
@@ -34,7 +35,7 @@ if __name__ == '__main__':
|
|
| 34 |
|
| 35 |
# Generate semantic segmentation using Graphonomy-Master library
|
| 36 |
print("Generate semantic segmentation using Graphonomy-Master library\n")
|
| 37 |
-
os.chdir("
|
| 38 |
terminnal_command ="python exp/inference/inference.py --loadmodel ./inference.pth --img_path ../resized_img.jpg --output_path ../ --output_name /resized_segmentation_img"
|
| 39 |
os.system(terminnal_command)
|
| 40 |
os.chdir("../")
|
|
|
|
| 13 |
opt = parser.parse_args()
|
| 14 |
|
| 15 |
# Read input image
|
| 16 |
+
|
| 17 |
+
img=cv2.imread("TryYours-Virtual-Try-On/static/origin_web.jpg")
|
| 18 |
ori_img=cv2.resize(img,(768,1024))
|
| 19 |
+
cv2.imwrite("TryYours-Virtual-Try-On/static/origin.jpg",ori_img)
|
| 20 |
|
| 21 |
# Resize input image
|
| 22 |
+
img=cv2.imread('TryYours-Virtual-Try-On/static/origin.jpg')
|
| 23 |
img=cv2.resize(img,(384,512))
|
| 24 |
+
cv2.imwrite('TryYours-Virtual-Try-On/static/resized_img.jpg',img)
|
| 25 |
|
| 26 |
# Get mask of cloth
|
| 27 |
print("Get mask of cloth\n")
|
|
|
|
| 35 |
|
| 36 |
# Generate semantic segmentation using Graphonomy-Master library
|
| 37 |
print("Generate semantic segmentation using Graphonomy-Master library\n")
|
| 38 |
+
os.chdir("TryYours-Virtual-Try-On/static/Graphonomy-master")
|
| 39 |
terminnal_command ="python exp/inference/inference.py --loadmodel ./inference.pth --img_path ../resized_img.jpg --output_path ../ --output_name /resized_segmentation_img"
|
| 40 |
os.system(terminnal_command)
|
| 41 |
os.chdir("../")
|