upload model to cdn and api

switch to yolov11
This commit is contained in:
Alex Bezdieniezhnykh
2025-03-03 23:36:10 +02:00
parent ceb50bf48a
commit 2fa864018f
14 changed files with 258 additions and 86 deletions
+11 -6
View File
@@ -5,20 +5,23 @@ from ultralytics import YOLO
import cv2
from time import sleep
from yolo_predictor import YOLOPredictor
from predictor import OnnxPredictor, YoloPredictor
# video_url = 'https://www.youtube.com/watch?v=d1n2fDOSo8c'
# stream = CamGear(source=video_url, stream_mode=True, logging=True).start()
write_output = False
predictor = YOLOPredictor()
predictor = YoloPredictor()
fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
input_name = 'ForAI.mp4'
input_name = 'ForAI_test.mp4'
output_name = Path(input_name).stem + '_recognised.mp4'
v_input = cv2.VideoCapture(input_name)
v_output = cv2.VideoWriter(output_name, fourcc, 20.0, (640, 480))
if write_output:
v_output = cv2.VideoWriter(output_name, fourcc, 20.0, (640, 480))
while v_input.isOpened():
ret, frame = v_input.read()
@@ -30,10 +33,12 @@ while v_input.isOpened():
cv2.imshow('Video', frame_detected)
sleep(0.01)
v_output.write(frame_detected)
if write_output:
v_output.write(frame_detected)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
v_input.release()
v_output.release()
if write_output:
v_output.release()
cv2.destroyAllWindows()