syncnet_python
syncnet_python copied to clipboard
FileNotFoundError: [Errno 2] No such file or directory: 'data/output/pywork/example/tracks.pckl'
hi guys
I tried to test pipelines when I followed the instructions in the readme.md file but faced with this error.
Traceback (most recent call last):
File "run_pipeline.py", line 298, in <module>
scene = scene_detect(opt)
File "run_pipeline.py", line 235, in scene_detect
scene_manager.detect_scenes(frame_source=video_manager)
File "/usr/local/lib/python3.7/dist-packages/scenedetect/scene_manager.py", line 469, in detect_scenes
self._process_frame(self._num_frames + start_frame, frame_im)
File "/usr/local/lib/python3.7/dist-packages/scenedetect/scene_manager.py", line 366, in _process_frame
self._add_cuts(detector.process_frame(frame_num, frame_im))
File "/usr/local/lib/python3.7/dist-packages/scenedetect/detectors/content_detector.py", line 100, in process_frame
curr_hsv[i] = curr_hsv[i].astype(numpy.int32)
TypeError: 'tuple' object does not support item assignment
Model data/syncnet_v2.model loaded.
Traceback (most recent call last):
File "run_visualise.py", line 28, in <module>
with open(os.path.join(opt.work_dir,opt.reference,'tracks.pckl'), 'rb') as fil:
FileNotFoundError: [Errno 2] No such file or directory: 'data/output/pywork/clip1/tracks.pckl'
when I checked content_detector.py file (line 92), I realized that the code is like below:
# line 92 content_detector.py
curr_hsv = cv2.split(cv2.cvtColor(frame_img, cv2.COLOR_BGR2HSV))
the cv2.split function takes an image as input and returns its color channels as a tuple. and then:
# line 100 content_detector.py
curr_hsv[i] = curr_hsv[i].astype(numpy.int32)
but as the error said, tuple object is immutable and does not support item assignment. when I cast the first line to list, the problem was fixed.
# fixed
# line 92 content_detector.py
curr_hsv = list(cv2.split(cv2.cvtColor(frame_img, cv2.COLOR_BGR2HSV)))
scenedetecor version that I used, was scenedetect==0.5.1
. Is this bug fixed in the new version of scenedetect module? if so, I think requirements.txt needs to be updated.
this can be fixed thorough installing scenedetect from source: https://github.com/Breakthrough/PySceneDetect/archive/refs/tags/v0.5.6.1.tar.gz
@sunotsue thanks for your help