nachiiiket commited on
Commit
81365b6
1 Parent(s): d5b0d03

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +8 -12
  2. best.pt +2 -2
app.py CHANGED
@@ -19,10 +19,10 @@ os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolo
19
  os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6.pt")
20
 
21
  def detect_Custom(img,model):
22
- if model =='Yolo_v7_Custom_trained_By_Owais':
23
  model='best' # Naming Convention for yolov7 See output file of https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/data
24
  parser = argparse.ArgumentParser()
25
- parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
26
  parser.add_argument('--source', type=str, default='Inference/', help='source')
27
  parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
28
  parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
@@ -155,21 +155,17 @@ def detect_Custom(img,model):
155
 
156
 
157
 
158
- Custom_description="<center>Custom Training Performed on Kaggle <a href='https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/notebook' style='text-decoration: underline' target='_blank'>Link</a> </center><br> <center>Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors </center> <br> <b>1st</b> class is for Person Detected<br><b>2nd</b> class is for Car Detected"
159
 
160
  Footer = (
161
- "<center>Model Trained by: Owais Ahmad Data Scientist at <b> Thoucentric </b> <a href=\"https://www.linkedin.com/in/owaiskhan9654/\">Visit Profile</a> <br></center>"
162
 
163
- "<center> Model Trained Kaggle Kernel <a href=\"https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/notebook\">Link</a> <br></center>"
164
-
165
- "<center> Kaggle Profile <a href=\"https://www.kaggle.com/owaiskhan9654\">Link</a> <br> </center>"
166
 
167
- "<center> HuggingFace🤗 Model Deployed Repository <a href=\"https://huggingface.co/owaiskha9654/Yolov7_Custom_Object_Detection\">Link</a> <br></center>"
168
  )
169
 
170
- examples1=[["Image1.jpeg", "Yolo_v7_Custom_trained_By_Owais"],["Image2.jpeg", "Yolo_v7_Custom_trained_By_Owais"],["Image3.jpeg", "Yolo_v7_Custom_trained_By_Owais",],["Image4.jpeg", "Yolo_v7_Custom_trained_By_Owais"],["Image5.jpeg", "Yolo_v7_Custom_trained_By_Owais"],["Image6.jpeg", "Yolo_v7_Custom_trained_By_Owais"],["horses.jpeg", "yolov7"],["horses.jpeg", "yolov7-e6"]]
171
-
172
- Top_Title="<center>Yolov7 🚀 Custom Trained by <a href='https://www.linkedin.com/in/owaiskhan9654/' style='text-decoration: underline' target='_blank'>Owais Ahmad </center></a>🚗Car and 👦Person Detection Class"
173
 
174
  css = ".output-image, .input-image, .image-preview {height: 300px !important}"
175
- gr.Interface(detect_Custom,[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"),css=css,title=Top_Title,examples=examples1,description=Custom_description,article=Footer,cache_examples=False).launch()
 
19
  os.system("wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6.pt")
20
 
21
  def detect_Custom(img,model):
22
+ if model =='YOLOv7':
23
  model='best' # Naming Convention for yolov7 See output file of https://www.kaggle.com/code/owaiskhan9654/training-yolov7-on-kaggle-on-custom-dataset/data
24
  parser = argparse.ArgumentParser()
25
+ parser.add_argument('--weights', nargs='+', type=str, default="best.pt", help='./best.pt')
26
  parser.add_argument('--source', type=str, default='Inference/', help='source')
27
  parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
28
  parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
 
155
 
156
 
157
 
158
+ Custom_description="<center>Custom Training Performed on Google Colab <a href='https://drive.google.com/drive/folders/1Ez0ZFGaeV6yS7wfSHyY5T7SFRICKKdCj?usp=sharing' style='text-decoration: underline' target='_blank'>Link</a> </center><br> <center>Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors </center>"
159
 
160
  Footer = (
161
+ "<center>Model Trained by: Students of Sipna College of Engineering and Technology, Amravati, Maharashtra. </center>"
162
 
163
+ "<center> Model Trained Google Kernel <a href=\"https://drive.google.com/file/d/1WSOTKwThX2CA_G0NOKOsTxsfMVJSeGH5/view?usp=sharing\">Link</a> <br></center>"
 
 
164
 
165
+ "<center> HuggingFace🤗 Model Deployed Repository <a href=\"https://huggingface.co/spaces/GauriDeshpande/AutoFis_Yolov7\">Link</a> <br></center>"
166
  )
167
 
168
+ Top_Title="<center>Automated Identification of Fish Spieces (AutoFis) using Yolov8 🚀</center>"
 
 
169
 
170
  css = ".output-image, .input-image, .image-preview {height: 300px !important}"
171
+ gr.Interface(detect_Custom,[gr.Image(type="pil"),gr.Dropdown(default="YOLOv7",choices=["YOLOv7", "YOLOv5", "YOLOv8"])],gr.Image(type="pil"),css=css,title=Top_Title,description=Custom_description,article=Footer,cache_examples=False).launch()
best.pt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f327a2609b6fbeee91162ec793fb2c5c4e5423446c401a749ac73cc05da55d51
3
- size 74821193
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b816625484dd448f5e026f18761910e4f1888551cbbc730b12c676d1d71c4473
3
+ size 75108303