Sa-m commited on
Commit
322296b
1 Parent(s): 1e46150

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -17,16 +17,16 @@ from utils.torch_utils import select_device, load_classifier, time_synchronized,
17
 
18
  os.system('git clone https://github.com/WongKinYiu/yolov7')
19
  os.system('wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt')
20
- os.system('wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-mask.pt')
21
 
22
  #model='best'
23
  def Custom_detect(img,mode):
24
  if mode=='Custom-Detection':
25
  model='best'
26
- if mode=='Instance-Segmentation':
27
- model='yolov7-mask'
28
- #if mode=='Yolov7-model-detection':
29
- # model='yolov7'
30
 
31
  parser = argparse.ArgumentParser()
32
  parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
@@ -161,7 +161,7 @@ def Custom_detect(img,mode):
161
  return Image.fromarray(im0[:,:,::-1])
162
  inp = gr.Image(type="pil")
163
  #"Custom-Detection","Yolov7-model-detection"
164
- inp2= gr.Dropdown(choices=['Instance-Segmentation','Custom-Detection'])
165
  output = gr.Image(type="pil")
166
 
167
  examples=[["Examples/Image1.jpg","Image1"],["Examples/Image14.jpg","Image14"],["Examples/Image32.jpg","Image32"]]
 
17
 
18
  os.system('git clone https://github.com/WongKinYiu/yolov7')
19
  os.system('wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt')
20
+ #os.system('wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-mask.pt')
21
 
22
  #model='best'
23
  def Custom_detect(img,mode):
24
  if mode=='Custom-Detection':
25
  model='best'
26
+ #if mode=='Instance-Segmentation':
27
+ # model='yolov7-mask'
28
+ if mode=='Yolov7-model-detection':
29
+ model='yolov7'
30
 
31
  parser = argparse.ArgumentParser()
32
  parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
 
161
  return Image.fromarray(im0[:,:,::-1])
162
  inp = gr.Image(type="pil")
163
  #"Custom-Detection","Yolov7-model-detection"
164
+ inp2= gr.Dropdown(choices=['Custom-Detection','Yolov7-model-detection'])
165
  output = gr.Image(type="pil")
166
 
167
  examples=[["Examples/Image1.jpg","Image1"],["Examples/Image14.jpg","Image14"],["Examples/Image32.jpg","Image32"]]