Spaces:
Sleeping
Sleeping
Update my_model/object_detection.py
Browse files
my_model/object_detection.py
CHANGED
|
@@ -5,8 +5,8 @@ from PIL import Image, ImageDraw, ImageFont
|
|
| 5 |
import numpy as np
|
| 6 |
import cv2
|
| 7 |
import os
|
| 8 |
-
from my_model.utilities import
|
| 9 |
-
|
| 10 |
|
| 11 |
|
| 12 |
|
|
@@ -62,8 +62,8 @@ class ObjectDetector:
|
|
| 62 |
"""
|
| 63 |
|
| 64 |
try:
|
| 65 |
-
|
| 66 |
-
|
| 67 |
self.processor = AutoImageProcessor.from_pretrained(model_path)
|
| 68 |
self.model = AutoModelForObjectDetection.from_pretrained(model_path)
|
| 69 |
except Exception as e:
|
|
|
|
| 5 |
import numpy as np
|
| 6 |
import cv2
|
| 7 |
import os
|
| 8 |
+
from my_model.utilities import get_image_path, get_model_path ,show_image
|
| 9 |
+
|
| 10 |
|
| 11 |
|
| 12 |
|
|
|
|
| 62 |
"""
|
| 63 |
|
| 64 |
try:
|
| 65 |
+
model_path = get_model_path('deformable-detr-detic')
|
| 66 |
+
|
| 67 |
self.processor = AutoImageProcessor.from_pretrained(model_path)
|
| 68 |
self.model = AutoModelForObjectDetection.from_pretrained(model_path)
|
| 69 |
except Exception as e:
|