Nighty3912 commited on
Commit
e3f6fc1
·
verified ·
1 Parent(s): 08c3b1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -155,7 +155,7 @@ def yolo_detect(image: Union[str, Path, int, Image.Image, list, tuple, np.ndarra
155
 
156
  def detect_reference_square(img: np.ndarray):
157
  t = time.time()
158
- res = reference_detector_global.predict(img, conf=0.3)
159
  if not res or len(res) == 0 or len(res[0].boxes) == 0:
160
  raise ReferenceBoxNotDetectedError("Reference Coin not detected in the image.")
161
  print("Reference coin detection completed in {:.2f} seconds".format(time.time() - t))
@@ -1178,7 +1178,7 @@ def predict(
1178
  t = time.time()
1179
  if drawer_detected:
1180
  # For detected drawers: shrink and square
1181
- shrunked_img = make_square(shrink_bbox(drawer_img, 0.90))
1182
  else:
1183
  # For non-drawer images: keep original dimensions
1184
  shrunked_img = drawer_img # Already in BGR format from above
 
155
 
156
  def detect_reference_square(img: np.ndarray):
157
  t = time.time()
158
+ res = reference_detector_global.predict(img, conf=0.15)
159
  if not res or len(res) == 0 or len(res[0].boxes) == 0:
160
  raise ReferenceBoxNotDetectedError("Reference Coin not detected in the image.")
161
  print("Reference coin detection completed in {:.2f} seconds".format(time.time() - t))
 
1178
  t = time.time()
1179
  if drawer_detected:
1180
  # For detected drawers: shrink and square
1181
+ shrunked_img = make_square(shrink_bbox(drawer_img, 0.95))
1182
  else:
1183
  # For non-drawer images: keep original dimensions
1184
  shrunked_img = drawer_img # Already in BGR format from above