Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -154,11 +154,14 @@ def get_top_clip_clothing(probs, n=1):
|
|
| 154 |
|
| 155 |
#img = input_img.convert("RGB").copy() # Ensure image is in RGB
|
| 156 |
def analyze_outfit(image_path):
|
| 157 |
-
if not image_path:
|
| 158 |
-
return (
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
# 1) YOLO Person Detection
|
| 164 |
person_results = yolo_person_model(img, verbose=False, conf=YOLO_PERSON_CONF_THRESHOLD)
|
|
|
|
| 154 |
|
| 155 |
#img = input_img.convert("RGB").copy() # Ensure image is in RGB
|
| 156 |
def analyze_outfit(image_path):
|
| 157 |
+
if not image_path or not os.path.exists(image_path):
|
| 158 |
+
return (
|
| 159 |
+
"<p style='color: #FF5555; text-align: center;'>Please upload an image.</p>",
|
| 160 |
+
None,
|
| 161 |
+
"Error: No image provided."
|
| 162 |
+
)
|
| 163 |
+
|
| 164 |
+
img = Image.open(image_path).convert("RGB").copy()
|
| 165 |
|
| 166 |
# 1) YOLO Person Detection
|
| 167 |
person_results = yolo_person_model(img, verbose=False, conf=YOLO_PERSON_CONF_THRESHOLD)
|