Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

FileNotFoundError: [Errno 2] No such file or directory: 'data/output/pywork/example/tracks.pckl' #49

Open
AmirMohamadBabaee opened this issue Aug 13, 2022 · 2 comments · May be fixed by #51

Comments

@AmirMohamadBabaee
Copy link

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.

@sunotsue
Copy link

this can be fixed thorough installing scenedetect from source: https://github.com/Breakthrough/PySceneDetect/archive/refs/tags/v0.5.6.1.tar.gz

AmirMohamadBabaee added a commit to AmirMohamadBabaee/syncnet_python that referenced this issue Aug 25, 2022
@AmirMohamadBabaee AmirMohamadBabaee linked a pull request Aug 25, 2022 that will close this issue
@AmirMohamadBabaee
Copy link
Author

@sunotsue thanks for your help

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants