Sanan commited on
Commit
8e70f8f
1 Parent(s): 0933eb5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -6,11 +6,8 @@ from PIL import Image
6
  model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True)
7
 
8
  def detect(image):
9
- #g = (size / max(im.size)) # gain
10
- # im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
11
-
12
- results = model(image) # inference
13
- results.render() # updates results.imgs with boxes and labels
14
  return Image.fromarray(results.imgs[0])
15
 
16
 
 
6
  model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True)
7
 
8
  def detect(image):
9
+ results = model(image)
10
+ results.render()
 
 
 
11
  return Image.fromarray(results.imgs[0])
12
 
13