Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -137,8 +137,12 @@ def compare_models(models: List[str], img: Image.Image, threshold: float, custom
|
|
137 |
except Exception as e:
|
138 |
# show blank slate if model unavailable
|
139 |
results.append(Image.new("RGB", img.size, (40, 40, 40)))
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
142 |
|
143 |
return results, legends
|
144 |
|
|
|
137 |
except Exception as e:
|
138 |
# show blank slate if model unavailable
|
139 |
results.append(Image.new("RGB", img.size, (40, 40, 40)))
|
140 |
+
err_msg = str(e)
|
141 |
+
# Normalize common weight‑missing errors for clarity
|
142 |
+
if "No such file or directory" in err_msg:
|
143 |
+
legends[m] = "Unavailable (weights not found)"
|
144 |
+
else:
|
145 |
+
legends[m] = f"ERROR: {err_msg.splitlines()[0][:120]}"
|
146 |
|
147 |
return results, legends
|
148 |
|