orik-ss commited on
Commit
e06b945
·
1 Parent(s): 81de9b1

Fixed ref bug

Browse files
Files changed (1) hide show
  1. dfine_jina_pipeline.py +2 -1
dfine_jina_pipeline.py CHANGED
@@ -697,7 +697,8 @@ def run_single_image(
697
  bx1, by1, bx2, by2 = squarify_crop_box(bx1, by1, bx2, by2, crop_w, crop_h)
698
  small_crop = crop_pil.crop((bx1, by1, bx2, by2))
699
  result = _classify_crop(clf_instance, small_crop, conf_threshold, gap_threshold)
700
- pred = result["prediction"] if result["prediction"] in ref_labels else f"unknown ({d['label']})"
 
701
  conf = result["confidence"]
702
  results_per_crop.append((gidx, (bx1, by1, bx2, by2), small_crop, pred, conf))
703
 
 
697
  bx1, by1, bx2, by2 = squarify_crop_box(bx1, by1, bx2, by2, crop_w, crop_h)
698
  small_crop = crop_pil.crop((bx1, by1, bx2, by2))
699
  result = _classify_crop(clf_instance, small_crop, conf_threshold, gap_threshold)
700
+ raw_pred = result["prediction"]
701
+ pred = raw_pred if raw_pred != "unknown" else f"unknown ({d['label']})"
702
  conf = result["confidence"]
703
  results_per_crop.append((gidx, (bx1, by1, bx2, by2), small_crop, pred, conf))
704