muhammadsalmanalfaridzi commited on
Commit
0e1d1ec
·
verified ·
1 Parent(s): 51e58b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -101,7 +101,7 @@ def detect_combined(image):
101
  x, y, w, h = pred['x'], pred['y'], pred['width'], pred['height']
102
  cv2.rectangle(img, (int(x-w/2), int(y-h/2)), (int(x+w/2), int(y+h/2)), (0,255,0), 2)
103
  cv2.putText(img, pred['class'], (int(x-w/2), int(y-h/2-10)),
104
- cv2.FONT_HERSHEY_SIMPLEX, 1.0, (0,255,0), 2)
105
 
106
  # Kompetitor (Merah) dengan nama 'unclassified'
107
  for comp in competitor_boxes:
@@ -115,7 +115,7 @@ def detect_combined(image):
115
 
116
  cv2.rectangle(img, (int(x1), int(y1)), (int(x2), int(y2)), (0, 0, 255), 2)
117
  cv2.putText(img, f"{display_name} {comp['confidence']:.2f}",
118
- (int(x1), int(y1-10)), cv2.FONT_HERSHEY_SIMPLEX, 1.0, (0, 0, 255), 2)
119
 
120
  output_path = "/tmp/combined_output.jpg"
121
  cv2.imwrite(output_path, img)
 
101
  x, y, w, h = pred['x'], pred['y'], pred['width'], pred['height']
102
  cv2.rectangle(img, (int(x-w/2), int(y-h/2)), (int(x+w/2), int(y+h/2)), (0,255,0), 2)
103
  cv2.putText(img, pred['class'], (int(x-w/2), int(y-h/2-10)),
104
+ cv2.FONT_HERSHEY_SIMPLEX, 1.0, (0,255,0), 3)
105
 
106
  # Kompetitor (Merah) dengan nama 'unclassified'
107
  for comp in competitor_boxes:
 
115
 
116
  cv2.rectangle(img, (int(x1), int(y1)), (int(x2), int(y2)), (0, 0, 255), 2)
117
  cv2.putText(img, f"{display_name} {comp['confidence']:.2f}",
118
+ (int(x1), int(y1-10)), cv2.FONT_HERSHEY_SIMPLEX, 1.0, (0, 0, 255), 3)
119
 
120
  output_path = "/tmp/combined_output.jpg"
121
  cv2.imwrite(output_path, img)