DuncanZauss / Keypoint_Communities

[ICCV '21] In this repository you find the code to our paper "Keypoint Communities".
MIT License
268 stars 17 forks source link

Issues running webcam/videos #3

Closed pablovela5620 closed 3 years ago

pablovela5620 commented 3 years ago

Getting the following errors when trying to use on webcam or video source

(kc) pablo@pablo-Alienware-Aurora-R7:~/0Dev/Keypoint_Communities$ python -m openpifpaf.video --source ../immersed-ganerated/data/iterim/test_vid3.webm --checkpoint=shufflenetv2k30-wholebody --line-width=2 --showINFO:__main__:neural network device: cuda (CUDA available: True, count: 1)
INFO:openpifpaf.decoder.factory:No specific decoder requested. Using the first one from:
  --decoder=cifcaf:0
  --decoder=posesimilarity:0
Use any of the above arguments to select one or multiple decoders and to suppress this message.
INFO:openpifpaf.predictor:neural network device: cuda (CUDA available: True, count: 1)
INFO:openpifpaf.show.animation_frame:video output = None
Traceback (most recent call last):
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/openpifpaf/video.py", line 158, in <module>
    main()
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/openpifpaf/video.py", line 129, in main
    for (ax, ax_second), (preds, _, meta) in \
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/openpifpaf/predictor.py", line 112, in dataset
    yield from self.dataloader(dataloader)
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/openpifpaf/predictor.py", line 149, in dataloader
    yield from self.enumerated_dataloader(enumerate(dataloader))
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/openpifpaf/predictor.py", line 115, in enumerated_dataloader
    for batch_i, item in enumerated_dataloader:
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
    data = self._next_data()
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
    return self._process_data(data)
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
    data.reraise()
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/torch/_utils.py", line 425, in reraise
    raise self.exc_type(msg)
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 28, in fetch
    data.append(next(self.dataset_iter))
  File "/home/pablo/miniconda3/envs/kc/lib/python3.8/site-packages/openpifpaf/stream.py", line 119, in __iter__
    capture = cv2.VideoCapture(self.source)
AttributeError: 'NoneType' object has no attribute 'VideoCapture'

I have no problem running the demo on images as shown in the readme, its only with videos

pablovela5620 commented 3 years ago

Found the issue, looks like opencv-python isn't included in the requirements.txt file