akhaliq HF staff commited on
Commit
89c8611
β€’
1 Parent(s): e82e693

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -42,13 +42,7 @@ opt = parser.parse_args()
42
 
43
 
44
 
45
- with torch.no_grad():
46
- if opt.update: # update all models (to fix SourceChangeWarning)
47
- for opt.weights in ['yolov7.pt']:
48
- detect()
49
- strip_optimizer(opt.weights)
50
- else:
51
- detect()
52
 
53
  def detect(img):
54
  img.save("inference/images/test.jpg")
@@ -187,6 +181,9 @@ def detect(img):
187
 
188
  return "runs/detect/exp/test.jpg"
189
 
190
-
 
 
 
191
 
192
  gr.Interface(detect,"image","image").launch()
 
42
 
43
 
44
 
45
+
 
 
 
 
 
 
46
 
47
  def detect(img):
48
  img.save("inference/images/test.jpg")
 
181
 
182
  return "runs/detect/exp/test.jpg"
183
 
184
+ with torch.no_grad():
185
+ if opt.update: # update all models (to fix SourceChangeWarning)
186
+ for opt.weights in ['yolov7.pt']:
187
+ strip_optimizer(opt.weights)
188
 
189
  gr.Interface(detect,"image","image").launch()