OMEGAMAX10 / YOLOv8-Object-Detection-Tracking-Image-Segmentation-Pose-Estimation

YOLOv8 object detection, tracking, image segmentation and pose estimation app using Ultralytics API (for detection, segmentation and pose estimation), as well as DeepSORT (for tracking) in Python. This app uses an UI made with streamlit and it can be deployed with Docker.
Apache License 2.0
66 stars 13 forks source link

Getting Error while Predicting Videos or Live streaming #5

Open MrFahad opened 6 months ago

MrFahad commented 6 months ago

Hi, Thank you so much for such a nice work.

I have ran the repo successfully and for predicting images it works fine, but wenever i try to predict on videos or live streaming it give me error as under:

output_video / 1.mp4/ model.json not found

please guide me in this regard.

OMEGAMAX10 commented 6 months ago

Hello, I made a small change in the code, please tell me if the error persists.

hhenne1 commented 4 months ago

hello, i ran into the same/similar problem..

testfile is called "playground swoosh.mp4" (69.0MB)

im running docker-compose and have mapped the whole /yolov8-docker folder to my filesystem to see what its doing.. the upload-function works fine.. it drops the file into the the /yolov8-docker folder.

then it creates /yolov8-docker/output_videos/playground swoosh/playground swoosh_yolov8s_output.json

then it seems to work on it.. it creates /yolov8-docker/temp.mp4 which grows in file size.

when its done it deletes both mp4 files (the temp and the original upload) but does not create/move a final video file and gives the following error:

FileNotFoundError: [Errno 2] No such file or directory: 'output_videos/playground swoosh/playground swoosh_yolov8s_output.mp4'
Traceback:
File "/usr/local/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script
    exec(code, module.__dict__)
File "/yolov8-docker/yolov8-detection-tracking-segmentation-pose.py", line 192, in <module>
    video_bytes = open(video_file_out, 'rb').read()

/yolov8-docker/output_videos/playground swoosh/playground swoosh_yolov8s_output.json persists afterwards

hhenne1 commented 4 months ago

ah, sorry for not thinking about it before i made the post.. when i rename the file to be without a space in its file name, it seems almost as intended.. it creates the file.. moves it to the output-folder and keeps it there after i close it in the webapp. the json file will also be kept there after closing it in the app. the only problem i still see is that its encoding the final file in 30fps, even though the input file was 60fps.. so its playing at half speed.