owaiskha9654 commited on
Commit
04f4db5
·
1 Parent(s): 8129600

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -25,7 +25,7 @@ from PIL import Image
25
 
26
 
27
 
28
- def detect(img,model):
29
  parser = argparse.ArgumentParser()
30
  parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
31
  parser.add_argument('--source', type=str, default='Inference/', help='source') # file/folder, 0 for webcam
@@ -183,4 +183,4 @@ def detect(img,model):
183
  return Image.fromarray(im0[:,:,::-1])
184
 
185
 
186
- gr.Interface(detect,cache_examples=False,[gr.Image(type="pil"),gr.Dropdown(default="Yolo_v7_Custom_trained_By_Owais",choices=["Yolo_v7_Custom_trained_By_Owais","yolov7","yolov7-e6"])], gr.Image(type="pil"),title="Yolov7",examples=[["Image1.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image2.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image3.jpg", "Yolo_v7_Custom_trained_By_Owais",],["Image4.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image5.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image6.jpg", "Yolo_v7_Custom_trained_By_Owais"],["horses.jpeg", "yolov7"]],description="Custom Training Performed on Kaggle Kernel<a href='https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/notebook' style='text-decoration: underline' target='_blank'>Link</a> \n Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors").launch()
 
25
 
26
 
27
 
28
+ def detect_Custom(img,model):
29
  parser = argparse.ArgumentParser()
30
  parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
31
  parser.add_argument('--source', type=str, default='Inference/', help='source') # file/folder, 0 for webcam
 
183
  return Image.fromarray(im0[:,:,::-1])
184
 
185
 
186
+ gr.Interface(fn=detect_Custom,cache_examples=False,[gr.Image(type="pil"),gr.Dropdown(default="Yolo_v7_Custom_trained_By_Owais",choices=["Yolo_v7_Custom_trained_By_Owais","yolov7","yolov7-e6"])], gr.Image(type="pil"),title="Yolov7",examples=[["Image1.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image2.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image3.jpg", "Yolo_v7_Custom_trained_By_Owais",],["Image4.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image5.jpg", "Yolo_v7_Custom_trained_By_Owais"],["Image6.jpg", "Yolo_v7_Custom_trained_By_Owais"],["horses.jpeg", "yolov7"]],description="Custom Training Performed on Kaggle Kernel<a href='https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/notebook' style='text-decoration: underline' target='_blank'>Link</a> \n Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors").launch()