Sa-m commited on
Commit
4749e95
·
1 Parent(s): 8f0eb81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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)')
@@ -160,8 +160,8 @@ def Custom_detect(img,mode):
160
 
161
  return Image.fromarray(im0[:,:,::-1])
162
  inp = gr.Image(type="pil")
163
-
164
- inp2= gr.Dropdown(choices=["Custom-Detection","Yolov7-model-detection"])
165
  output = gr.Image(type="pil")
166
 
167
  examples=["Examples/Image1.jpg","Examples/Image14.jpg","Examples/Image32.jpg"]
 
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)')
 
160
 
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","Examples/Image14.jpg","Examples/Image32.jpg"]