SamiKhokhar commited on
Commit
9a59aa5
·
verified ·
1 Parent(s): 95aa9c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,8 +4,8 @@ import gradio as gr
4
  from PIL import Image
5
 
6
  # Step 1: Load the custom YOLOv5 model
7
- # Adjust the model path based on your deployment setup (Hugging Face model hub or local path)
8
- model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt') # If you use Hugging Face model hub, use the correct identifier
9
 
10
  # Step 2: Define weapon classes to detect
11
  weapon_classes = ['pistol', 'gun', 'rifle', 'shotgun', 'handgun']
 
4
  from PIL import Image
5
 
6
  # Step 1: Load the custom YOLOv5 model
7
+ # Make sure the path to the model is correct, either locally or from Hugging Face model hub
8
+ model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt') # Adjust the path if needed
9
 
10
  # Step 2: Define weapon classes to detect
11
  weapon_classes = ['pistol', 'gun', 'rifle', 'shotgun', 'handgun']