coolroman commited on
Commit
20703bb
·
verified ·
1 Parent(s): 149ecb3

scorevision: push artifact

Browse files
Files changed (1) hide show
  1. miner.py +10 -2
miner.py CHANGED
@@ -98,7 +98,11 @@ class Miner:
98
 
99
  # Tuning matched to alfred's deployed model — bias toward precision to dodge
100
  # the false_positive pillar penalty (validator weights FP heavily on this element).
101
- self.conf_thres = 0.40
 
 
 
 
102
  self.iou_thres = 0.4
103
  self.cross_iou_thresh = 0.7
104
  self.max_det = 100
@@ -359,7 +363,11 @@ class Miner:
359
  cls_ids = self.cls_remap[cls_ids]
360
 
361
  if apply_conf_thresh:
362
- keep = scores >= self.conf_thres
 
 
 
 
363
  boxes = boxes[keep]
364
  scores = scores[keep]
365
  cls_ids = cls_ids[keep]
 
98
 
99
  # Tuning matched to alfred's deployed model — bias toward precision to dodge
100
  # the false_positive pillar penalty (validator weights FP heavily on this element).
101
+ # v13 sweet spot on starter (true GT): uniform conf=0.50.
102
+ # Tuning per-class on 7 images overfits — leave-one-out CV showed it
103
+ # collapsed to 0.314 on held-out shards. Uniform 0.50 is robust.
104
+ self.conf_thres = 0.50
105
+ self.conf_thres_per_class = np.array([0.50] * 6, dtype=np.float32)
106
  self.iou_thres = 0.4
107
  self.cross_iou_thresh = 0.7
108
  self.max_det = 100
 
363
  cls_ids = self.cls_remap[cls_ids]
364
 
365
  if apply_conf_thresh:
366
+ # Per-class threshold: each box compared against its own class's threshold
367
+ cls_thresh = np.full(len(scores), self.conf_thres, dtype=np.float32)
368
+ valid_cls = (cls_ids >= 0) & (cls_ids < len(self.conf_thres_per_class))
369
+ cls_thresh[valid_cls] = self.conf_thres_per_class[cls_ids[valid_cls]]
370
+ keep = scores >= cls_thresh
371
  boxes = boxes[keep]
372
  scores = scores[keep]
373
  cls_ids = cls_ids[keep]