Update app.py
Browse files
app.py
CHANGED
|
@@ -12,12 +12,12 @@ from transformers import RTDetrForObjectDetection, RTDetrImageProcessor
|
|
| 12 |
from draw_boxes import draw_bounding_boxes
|
| 13 |
|
| 14 |
image_processor = RTDetrImageProcessor.from_pretrained("PekingU/rtdetr_r50vd")
|
| 15 |
-
model = RTDetrForObjectDetection.from_pretrained("PekingU/rtdetr_r50vd")
|
| 16 |
|
| 17 |
|
| 18 |
SUBSAMPLE = 2
|
| 19 |
|
| 20 |
-
@spaces.GPU
|
| 21 |
def stream_object_detection(video, conf_threshold):
|
| 22 |
cap = cv2.VideoCapture(video)
|
| 23 |
|
|
|
|
| 12 |
from draw_boxes import draw_bounding_boxes
|
| 13 |
|
| 14 |
image_processor = RTDetrImageProcessor.from_pretrained("PekingU/rtdetr_r50vd")
|
| 15 |
+
model = RTDetrForObjectDetection.from_pretrained("PekingU/rtdetr_r50vd")#.to("cuda")
|
| 16 |
|
| 17 |
|
| 18 |
SUBSAMPLE = 2
|
| 19 |
|
| 20 |
+
# @spaces.GPU
|
| 21 |
def stream_object_detection(video, conf_threshold):
|
| 22 |
cap = cv2.VideoCapture(video)
|
| 23 |
|