YOLOv8-Object-Detection-Tracking-Image-Segmentation-Pose-Estimation icon indicating copy to clipboard operation
YOLOv8-Object-Detection-Tracking-Image-Segmentation-Pose-Estimation copied to clipboard

Getting Error while Predicting Videos or Live streaming

Open MrFahad opened this issue 1 year ago • 3 comments

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.

MrFahad avatar Dec 23 '23 21:12 MrFahad

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

OMEGAMAX10 avatar Dec 24 '23 00:12 OMEGAMAX10

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 avatar Feb 17 '24 22:02 hhenne1

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.

hhenne1 avatar Feb 17 '24 22:02 hhenne1