Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,20 +8,20 @@ from ultralytics import YOLO
|
|
| 8 |
model = YOLO("best.pt") # Ensure the path to your model is correct
|
| 9 |
|
| 10 |
webcamera = cv2.VideoCapture(0)
|
| 11 |
-
# webcamera.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
|
| 12 |
-
# webcamera.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
|
| 13 |
|
| 14 |
-
while True:
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
|
| 24 |
-
webcamera.release()
|
| 25 |
-
cv2.destroyAllWindows()
|
| 26 |
|
| 27 |
|
|
|
|
| 8 |
model = YOLO("best.pt") # Ensure the path to your model is correct
|
| 9 |
|
| 10 |
webcamera = cv2.VideoCapture(0)
|
| 11 |
+
# # webcamera.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
|
| 12 |
+
# # webcamera.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
|
| 13 |
|
| 14 |
+
# while True:
|
| 15 |
+
# success, frame = webcamera.read()
|
| 16 |
|
| 17 |
+
# results = model.track(frame, classes=0, conf=0.8, imgsz=480)
|
| 18 |
+
# cv2.putText(frame, f"Total: {len(results[0].boxes)}", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, cv2.LINE_AA)
|
| 19 |
+
# cv2.imshow("Live Camera", results[0].plot())
|
| 20 |
|
| 21 |
+
# if cv2.waitKey(1) == ord('q'):
|
| 22 |
+
# break
|
| 23 |
|
| 24 |
+
# webcamera.release()
|
| 25 |
+
# cv2.destroyAllWindows()
|
| 26 |
|
| 27 |
|