Spaces:
Runtime error
Runtime error
Update models/detection/detector.py
Browse files
models/detection/detector.py
CHANGED
|
@@ -2,10 +2,12 @@ import logging
|
|
| 2 |
from PIL import Image, ImageDraw
|
| 3 |
from huggingface_hub import hf_hub_download
|
| 4 |
from ultralytics import YOLO
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
-
logger = logging.getLogger(__name__)
|
| 8 |
|
|
|
|
|
|
|
| 9 |
class ObjectDetector:
|
| 10 |
"""
|
| 11 |
Generalized Object Detection Wrapper for YOLOv5, YOLOv8, and future variants.
|
|
|
|
| 2 |
from PIL import Image, ImageDraw
|
| 3 |
from huggingface_hub import hf_hub_download
|
| 4 |
from ultralytics import YOLO
|
| 5 |
+
import shutil
|
| 6 |
|
| 7 |
|
|
|
|
| 8 |
|
| 9 |
+
logger = logging.getLogger(__name__)
|
| 10 |
+
shutil.rmtree("models/detection/weights", ignore_errors=True)
|
| 11 |
class ObjectDetector:
|
| 12 |
"""
|
| 13 |
Generalized Object Detection Wrapper for YOLOv5, YOLOv8, and future variants.
|