Spaces:
Sleeping
Sleeping
Update my_model/object_detection.py
Browse files
my_model/object_detection.py
CHANGED
|
@@ -6,6 +6,7 @@ import numpy as np
|
|
| 6 |
import cv2
|
| 7 |
import os
|
| 8 |
from my_model.utilities import get_path, show_image
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
|
|
@@ -61,7 +62,8 @@ class ObjectDetector:
|
|
| 61 |
"""
|
| 62 |
|
| 63 |
try:
|
| 64 |
-
model_path = get_path('deformable-detr-detic', 'models')
|
|
|
|
| 65 |
self.processor = AutoImageProcessor.from_pretrained(model_path)
|
| 66 |
self.model = AutoModelForObjectDetection.from_pretrained(model_path)
|
| 67 |
except Exception as e:
|
|
|
|
| 6 |
import cv2
|
| 7 |
import os
|
| 8 |
from my_model.utilities import get_path, show_image
|
| 9 |
+
import models.deformable-detr-detic as detic
|
| 10 |
|
| 11 |
|
| 12 |
|
|
|
|
| 62 |
"""
|
| 63 |
|
| 64 |
try:
|
| 65 |
+
#model_path = get_path('deformable-detr-detic', 'models') # for use locally
|
| 66 |
+
model_path = detic # for use on HF only
|
| 67 |
self.processor = AutoImageProcessor.from_pretrained(model_path)
|
| 68 |
self.model = AutoModelForObjectDetection.from_pretrained(model_path)
|
| 69 |
except Exception as e:
|