Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
#
|
8 |
-
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt') #
|
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']
|