Spaces:
Running
on
Zero
Running
on
Zero
Update models/detection/detector.py
Browse files
models/detection/detector.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import logging
|
2 |
-
from PIL import Image
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
from ultralytics import YOLO
|
5 |
|
@@ -48,7 +48,8 @@ class ObjectDetector:
|
|
48 |
weights_path = hf_hub_download(
|
49 |
repo_id=repo_id,
|
50 |
filename=filename,
|
51 |
-
cache_dir="models/detection/weights"
|
|
|
52 |
)
|
53 |
|
54 |
self.device = device
|
|
|
1 |
import logging
|
2 |
+
from PIL import Image, ImageDraw
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
from ultralytics import YOLO
|
5 |
|
|
|
48 |
weights_path = hf_hub_download(
|
49 |
repo_id=repo_id,
|
50 |
filename=filename,
|
51 |
+
cache_dir="models/detection/weights",
|
52 |
+
force_download=True #Clear cache
|
53 |
)
|
54 |
|
55 |
self.device = device
|