Sa-m commited on
Commit
4bcb8b4
1 Parent(s): 61a1dcc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -19,13 +19,13 @@ def find(name, path):
19
  if name in files:
20
  return os.path.join(root, name)
21
 
22
- model = torch.hub.load('ultralytics/yolov5', 'custom', path='Content/best.pt',device='gpu')
23
- model.conf = 0.45
24
  #, force_reload=True
25
  def detect(inp):
26
  #g = (size / max(inp.size)) # gain
27
  #im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
28
- results = model(inp) # inference
29
  results.render() # updates results.imgs with boxes and labels
30
  return Image.fromarray(results.imgs[0])
31
 
 
19
  if name in files:
20
  return os.path.join(root, name)
21
 
22
+ model = torch.hub.load('ultralytics/yolov5', 'custom', path='Content/best.pt')
23
+ model.conf = 0.33
24
  #, force_reload=True
25
  def detect(inp):
26
  #g = (size / max(inp.size)) # gain
27
  #im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
28
+ results = model(inp,size=640) # inference
29
  results.render() # updates results.imgs with boxes and labels
30
  return Image.fromarray(results.imgs[0])
31