Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ def virtual_tryon(human_img_path, garment_img_path, garment_type):
|
|
59 |
# Extract the prompt ID from the initial response
|
60 |
if tune_data.get("prompts") and len(tune_data["prompts"]) > 0:
|
61 |
prompt_id = tune_data["prompts"][0].get("id")
|
62 |
-
|
63 |
if not prompt_id:
|
64 |
raise gr.Error(f"Failed to get prompt ID from tune creation. API response: {tune_data}")
|
65 |
|
@@ -95,7 +95,7 @@ def virtual_tryon(human_img_path, garment_img_path, garment_type):
|
|
95 |
# This case handles when training is done but image isn't ready yet.
|
96 |
yield None, "Step 2/3: Model trained. Finalizing image..."
|
97 |
else:
|
98 |
-
|
99 |
|
100 |
time.sleep(10) # Wait before polling again
|
101 |
|
@@ -179,10 +179,12 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
|
179 |
"""
|
180 |
**Instructions:** Upload a photo of a person and a photo of a piece of clothing to see them wear it.
|
181 |
|
182 |
-
|
|
|
|
|
183 |
"""
|
184 |
)
|
185 |
-
|
186 |
# --- Main Application UI ---
|
187 |
with gr.Row():
|
188 |
with gr.Column(scale=1):
|
|
|
59 |
# Extract the prompt ID from the initial response
|
60 |
if tune_data.get("prompts") and len(tune_data["prompts"]) > 0:
|
61 |
prompt_id = tune_data["prompts"][0].get("id")
|
62 |
+
|
63 |
if not prompt_id:
|
64 |
raise gr.Error(f"Failed to get prompt ID from tune creation. API response: {tune_data}")
|
65 |
|
|
|
95 |
# This case handles when training is done but image isn't ready yet.
|
96 |
yield None, "Step 2/3: Model trained. Finalizing image..."
|
97 |
else:
|
98 |
+
yield None, "Step 2/3: Model is training. Checking again in 10 seconds..."
|
99 |
|
100 |
time.sleep(10) # Wait before polling again
|
101 |
|
|
|
179 |
"""
|
180 |
**Instructions:** Upload a photo of a person and a photo of a piece of clothing to see them wear it.
|
181 |
|
182 |
+
This space is made available through the Astria API, which allows you to create virtual try-on experiences with just a few lines of code.
|
183 |
+
Astria fine-tuning API allows you to create custom AI models from your own images, and then use Virtual Try-On to make those models wear different clothing items.
|
184 |
+
This can be used for fashion e-commerce, virtual fitting rooms, music festivals and concerts and sport events activation campaigns. See more in [Astria Virtual Try-On documentation](https://docs.astria.ai/docs/use-cases/virtual-try-on/).
|
185 |
"""
|
186 |
)
|
187 |
+
|
188 |
# --- Main Application UI ---
|
189 |
with gr.Row():
|
190 |
with gr.Column(scale=1):
|