Spaces:
Sleeping
Sleeping
path changed
Browse files
README.md
CHANGED
|
@@ -9,5 +9,3 @@ pinned: false
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# FastAPI-Deployment
|
| 12 |
-
|
| 13 |
-
Simple Text Generation app using Cohere generate a model to demonstrate deploying FastAPI Applications on Huggingface Spaces via Docker and Github Actions
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
# FastAPI-Deployment
|
|
|
|
|
|
app.py
CHANGED
|
@@ -52,7 +52,7 @@ def pil_to_binary_mask(pil_image, threshold=0):
|
|
| 52 |
return output_mask
|
| 53 |
|
| 54 |
|
| 55 |
-
base_path = '
|
| 56 |
example_path = os.path.join(os.path.dirname(__file__), 'example')
|
| 57 |
|
| 58 |
unet = UNet2DConditionModel.from_pretrained(
|
|
@@ -182,10 +182,8 @@ def start_tryon(humanTarget_img,garm_img,garment_des,is_automaskchecked,is_check
|
|
| 182 |
# # mask, mask_gray = get_mask_location('hd', "dresses", model_parse, keypoints)
|
| 183 |
# # mask = mask.resize((768,1024))
|
| 184 |
# else:
|
| 185 |
-
mask_temp_img = Image()
|
| 186 |
mask = pil_to_binary_mask(mask_temp_img.convert("RGB").resize((768, 1024)))
|
| 187 |
-
# mask = transforms.ToTensor()(mask)
|
| 188 |
-
# mask = mask.unsqueeze(0)
|
| 189 |
mask_gray = (1-transforms.ToTensor()(mask)) * tensor_transfrom(human_img)
|
| 190 |
mask_gray = to_pil_image((mask_gray+1.0)/2.0)
|
| 191 |
|
|
|
|
| 52 |
return output_mask
|
| 53 |
|
| 54 |
|
| 55 |
+
base_path = 'yisol/IDM-VTON' # Reverting to original model path
|
| 56 |
example_path = os.path.join(os.path.dirname(__file__), 'example')
|
| 57 |
|
| 58 |
unet = UNet2DConditionModel.from_pretrained(
|
|
|
|
| 182 |
# # mask, mask_gray = get_mask_location('hd', "dresses", model_parse, keypoints)
|
| 183 |
# # mask = mask.resize((768,1024))
|
| 184 |
# else:
|
| 185 |
+
mask_temp_img = Image.new('RGB', (768, 1024), color='white') # Creating a new blank image
|
| 186 |
mask = pil_to_binary_mask(mask_temp_img.convert("RGB").resize((768, 1024)))
|
|
|
|
|
|
|
| 187 |
mask_gray = (1-transforms.ToTensor()(mask)) * tensor_transfrom(human_img)
|
| 188 |
mask_gray = to_pil_image((mask_gray+1.0)/2.0)
|
| 189 |
|