sakthi54321 commited on
Commit
ea1bf64
·
verified ·
1 Parent(s): e61e71e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -28,11 +28,13 @@ def detect_pcb_faults(image):
28
 
29
  # ✅ Draw bounding boxes and labels
30
  for (x1, y1, x2, y2), conf, class_id in zip(boxes, confs, class_ids):
31
- cv2.rectangle(image, (int(x1), int(y1)), (int(x2), int(y2)), (0, 255, 0), 2)
32
 
33
  # Get class label from dictionary
34
  label = f"{class_names.get(int(class_id), 'Unknown')} ({conf:.2f})"
35
- cv2.putText(image, label, (int(x1), int(y1) - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
 
 
36
 
37
  return image
38
 
 
28
 
29
  # ✅ Draw bounding boxes and labels
30
  for (x1, y1, x2, y2), conf, class_id in zip(boxes, confs, class_ids):
31
+ cv2.rectangle(image, (int(x1), int(y1)), (int(x2), int(y2)), (0, 255, 0), 3) # 🟢 Thicker Box
32
 
33
  # Get class label from dictionary
34
  label = f"{class_names.get(int(class_id), 'Unknown')} ({conf:.2f})"
35
+
36
+ # 🔥 Larger Text Size & Thicker Font
37
+ cv2.putText(image, label, (int(x1), int(y1) - 10), cv2.FONT_HERSHEY_SIMPLEX, 1.2, (0, 255, 0), 3)
38
 
39
  return image
40