Recently, using YOLOv5 for target detection, calling the local camera directly will report an error, and you need to make a little modification in the dataset. details as follows:
Change to str
type in these two places at line 279
Then change the parameter here to 0
in detect
Then run detect.py
to call the local camera