Spaces:
Sleeping
Sleeping
cisdeli commited on
Commit ·
71b2c50
1
Parent(s): 5181d0e
Match the demo's segmentation parameters to the batch pipeline
Browse filesThe app passed retina_masks=True while scripts/run_yolo_inference.py uses the
Ultralytics defaults. Detections are identical either way, but full-resolution
masks move polygon boundaries: on a controlled crop, total projected area
shifted 2.6% and 14% of tubers crossed a USDA size threshold, so the demo
reported a different class composition than the published per-tuber CSV.
- app/app.py +4 -1
app/app.py
CHANGED
|
@@ -157,7 +157,10 @@ def _analyze_pil(image: Image.Image, source_label: str | None = None):
|
|
| 157 |
|
| 158 |
Returns (overlay PIL image, headline markdown, class summary df, per-tuber df).
|
| 159 |
"""
|
| 160 |
-
|
|
|
|
|
|
|
|
|
|
| 161 |
df = _per_tuber_dataframe(detections, image.width, image.height)
|
| 162 |
|
| 163 |
if df.empty:
|
|
|
|
| 157 |
|
| 158 |
Returns (overlay PIL image, headline markdown, class summary df, per-tuber df).
|
| 159 |
"""
|
| 160 |
+
# No retina_masks: the batch pipeline that produced the paper's tables runs
|
| 161 |
+
# with the Ultralytics defaults, and full-resolution masks shift polygon
|
| 162 |
+
# boundaries enough to move ~14% of tubers across a USDA class threshold.
|
| 163 |
+
detections = predict_image(_model, image)
|
| 164 |
df = _per_tuber_dataframe(detections, image.width, image.height)
|
| 165 |
|
| 166 |
if df.empty:
|