varungupta31 / dashcam_anonymizer

Code to Blur Human Faces and Vehicle License Plates in Video and Images using a SoTA Object Detection model YOLOv8
MIT License
23 stars 2 forks source link

Error - Creation of new Files #4

Closed graebec closed 9 months ago

graebec commented 1 year ago

Hi there, after the predictions finished I receive the following error : Screenshot 2023-09-08 071930 -Error

Any Idea what causes this ?

Best Regards

varungupta31 commented 1 year ago

Path and file name issues.

Currently the videos would need to be named numerically 1.mp4 2.mp4 And thus the script does an int call assuming the number, and sorts the videos to be processed in that order.

What is the exact path of the videos you have?

A quick fix would be to change

L45 videos = sorted(glob.glob(f"{config['videos_path']}/*.mp4"), key=sort_videos) to videos = sorted(glob.glob(f"{config['videos_path']}/*.mp4"))

And if the videos are not in the videos folder inside the repo,

change

L46 videos = [int(item.split("/")[1].replace(".mp4", "")) for item in videos] to videos = [int(item.split("/")[-1].replace(".mp4", "")) for item in videos]

I can see how this is problematic, occupied ATM, will fix things soon.