Spaces:
Build error
Build error
Commit
·
e4777e1
1
Parent(s):
736ef53
feat: switch to latest model
Browse files- app.py +2 -3
- latest.pt → local_latest.pt +2 -2
app.py
CHANGED
|
@@ -2,15 +2,14 @@ import gradio as gr
|
|
| 2 |
import torch
|
| 3 |
from PIL import Image
|
| 4 |
import numpy as np
|
| 5 |
-
from huggingface_hub import hf_hub_download
|
| 6 |
|
| 7 |
import cv2
|
| 8 |
|
| 9 |
# Download the model from Hugging Face Hub
|
| 10 |
-
model_path =
|
| 11 |
|
| 12 |
# Load the YOLOv5 model
|
| 13 |
-
model = torch.hub.load('ultralytics/yolov5', 'custom', path=model_path, source='
|
| 14 |
model.line_thickness = 3 # Set the thickness of the bounding box lines
|
| 15 |
|
| 16 |
# Print model class names
|
|
|
|
| 2 |
import torch
|
| 3 |
from PIL import Image
|
| 4 |
import numpy as np
|
|
|
|
| 5 |
|
| 6 |
import cv2
|
| 7 |
|
| 8 |
# Download the model from Hugging Face Hub
|
| 9 |
+
model_path = 'local_latest.pt'
|
| 10 |
|
| 11 |
# Load the YOLOv5 model
|
| 12 |
+
model = torch.hub.load('ultralytics/yolov5', 'custom', path=model_path, source='local')
|
| 13 |
model.line_thickness = 3 # Set the thickness of the bounding box lines
|
| 14 |
|
| 15 |
# Print model class names
|
latest.pt → local_latest.pt
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:56ffacbde772706c45eef26d0cd72b21f3d28e5e383c8d0945bd0ac283fc8b6d
|
| 3 |
+
size 14346728
|