/Users/ssfanli/Myfolder/repository/YSPDataSets/no_track/video/iPhone/cold_start/with_ad/19.mp4 <class 'pathlib.PosixPath'>
Traceback (most recent call last):
File "/Users/ssfanli/Myfolder/repository/work_with_stagesepx/dynamic/classify_with_model.py", line 16, in <module>
video = VideoObject(video_path)
File "/usr/local/lib/python3.7/site-packages/stagesepx/video.py", line 99, in __init__
with toolbox.video_capture(path) as cap:
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.7/site-packages/stagesepx/toolbox.py", line 25, in video_capture
video_cap = cv2.VideoCapture(video_path)
TypeError: an integer is required (got type PosixPath)
看了下video.py的源码好像是这块with toolbox.video_capture(path) as cap传入的path类型不对,应该传self.path,因为self.path已经转为str类型了
现象
初始化
VideoObject()
时候,传入pathlib.PosixPath
类型的路径报错,报错信息如下:看了下
video.py
的源码好像是这块with toolbox.video_capture(path) as cap
传入的path
类型不对,应该传self.path
,因为self.path
已经转为str
类型了