Naahbi commited on
Commit
a64efbb
·
verified ·
1 Parent(s): de3f150

bugfix yolo

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -24,11 +24,12 @@ yolo_model = YOLO(yolo_model_dir)
24
 
25
 
26
  def predicted_diagnosis(img):
27
-
28
 
29
- img.thumbnail(640, Image.LANCZOS)
30
 
31
- padded_image = ImageOps.pad(img, 640, color=fill_color)
 
 
32
 
33
  crop_result = yolo_model(padded_image)[0]
34
  boxes = crop_result.boxes.xyxy
 
24
 
25
 
26
  def predicted_diagnosis(img):
 
27
 
28
+ target_size = (640, 640)
29
 
30
+ img.thumbnail(target_size, Image.LANCZOS)
31
+
32
+ padded_image = ImageOps.pad(img, target_size, color=fill_color)
33
 
34
  crop_result = yolo_model(padded_image)[0]
35
  boxes = crop_result.boxes.xyxy