yusufbardolia commited on
Commit
0e1cacf
·
verified ·
1 Parent(s): 7328715

Update script.py

Browse files
Files changed (1) hide show
  1. script.py +5 -5
script.py CHANGED
@@ -11,7 +11,7 @@ MODEL_WEIGHTS = "best.pt"
11
  # ✅ 1. Sane Confidence:
12
  # 0.20 was safe. We go slightly lower to 0.15 to improve Recall,
13
  # relying on 'max_det' to fix the Precision.
14
- CONF_THRESHOLD = 0.15
15
 
16
  def get_category_id(cls_id):
17
  # IDs 0, 1, 2 are correct based on your experiments.
@@ -41,10 +41,10 @@ def run_inference(model, image_path, conf_threshold, save_path):
41
  results = model.predict(
42
  full_path,
43
  conf=conf_threshold,
44
- imgsz=1024, # Match training size
45
- augment=False, # Disable to prevent blurring/drift
46
- iou=0.50, # Aggressive NMS to merge overlapping boxes
47
- max_det=20, # ⬅️ CRITICAL: Limit to top 20 objects per image
48
  verbose=False
49
  )
50
 
 
11
  # ✅ 1. Sane Confidence:
12
  # 0.20 was safe. We go slightly lower to 0.15 to improve Recall,
13
  # relying on 'max_det' to fix the Precision.
14
+ CONF_THRESHOLD = 0.05
15
 
16
  def get_category_id(cls_id):
17
  # IDs 0, 1, 2 are correct based on your experiments.
 
41
  results = model.predict(
42
  full_path,
43
  conf=conf_threshold,
44
+ imgsz=1024, # Keep High Res
45
+ augment=False,
46
+ iou=0.60, # Slightly higher IoU to keep close instruments
47
+ max_det=5, # ⬅️ CRITICAL: Only allow top 5 instruments per image
48
  verbose=False
49
  )
50