Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,11 +9,11 @@ import numpy as np
|
|
| 9 |
import uuid
|
| 10 |
import spaces
|
| 11 |
|
| 12 |
-
ver=[6,7,8,9,10,11]
|
| 13 |
ltr=["n","s","m","1","x"]
|
| 14 |
tsk=["","-seg","-pose","-obb","-cls"]
|
| 15 |
#yolov8s.pt
|
| 16 |
-
modin=f"yolov{ver[
|
| 17 |
|
| 18 |
print(modin)
|
| 19 |
model = YOLO(modin)
|
|
@@ -57,6 +57,7 @@ def stream_object_detection(video):
|
|
| 57 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
| 58 |
result = model(Image.fromarray(frame))[0]
|
| 59 |
detections = sv.Detections.from_ultralytics(result)
|
|
|
|
| 60 |
outp = draw_box(frame,detections)
|
| 61 |
frame = np.array(outp)
|
| 62 |
# Convert RGB to BGR
|
|
|
|
| 9 |
import uuid
|
| 10 |
import spaces
|
| 11 |
|
| 12 |
+
ver=[0,0,0,0,0,0,6,7,8,9,10,11]
|
| 13 |
ltr=["n","s","m","1","x"]
|
| 14 |
tsk=["","-seg","-pose","-obb","-cls"]
|
| 15 |
#yolov8s.pt
|
| 16 |
+
modin=f"yolov{ver[11]}{ltr[1]}{tsk[0]}.pt"
|
| 17 |
|
| 18 |
print(modin)
|
| 19 |
model = YOLO(modin)
|
|
|
|
| 57 |
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
| 58 |
result = model(Image.fromarray(frame))[0]
|
| 59 |
detections = sv.Detections.from_ultralytics(result)
|
| 60 |
+
print(detections)
|
| 61 |
outp = draw_box(frame,detections)
|
| 62 |
frame = np.array(outp)
|
| 63 |
# Convert RGB to BGR
|