zh-plus / video-to-pose3D

Convert video to 3D pose in one-key.
MIT License
646 stars 130 forks source link

Assertion issue while running the sample video . #8

Closed ns3new closed 5 years ago

ns3new commented 5 years ago

I tried to run the code with hr_pose in the following way in the videopose.py file inference_video('outputs/dance.mp4', 'hr_pose') Error message

outputs/dance.mp4 --- elapsed time: 3.2093143170004623 s
Traceback (most recent call last):
  File "videopose.py", line 164, in <module>
    inference_video('outputs/dance.mp4', 'hr_pose')
  File "videopose.py", line 160, in inference_video
    main(args)
  File "videopose.py", line 79, in main
    keypoints = normalize_screen_coordinates(keypoints[..., :2], w=1000, h=1002)
  File "/home/viz/test/visualization/video-to-pose3D/common/camera.py", line 16, in normalize_screen_coordinates
    assert X.shape[-1] == 2
AssertionError
zh-plus commented 5 years ago

The outputs/dance.mp4 is not provided in the outputs folder. Try to replace it with outputs/kunkun_cut.mp4.

I've updated the default value in my nearest commit.

ns3new commented 5 years ago

Thanks for the reply. I seem to have pulled your latest commit but , there is another issue with regards to uplifting from 2d to 3d . I get the following error , tried on another set of videos


Loading YOLO network.....
Network successfully loaded
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 360/360 [01:24<00:00,  4.26it/s]
-------------- load data spends 87.80 seconds
Loading checkpoint checkpoint/pretrained_h36m_detectron_coco.bin
-------------- load 3D model spends 0.03 seconds
Rendering...
-------------- generate reconstruction 3D data spends 0.05 seconds
===========================> This video get 360 frames in total.
  1%|▉                                                                                                                                                                      | 2/360 [00:00<00:21, 16.56it/s]outputs/cut_test_squat.mp4 --- elapsed time: 89.57218216099864 s
Traceback (most recent call last):
  File "videopose.py", line 164, in <module>
    inference_video('outputs/cut_test_squat.mp4', 'hr_pose')
  File "videopose.py", line 160, in inference_video
    main(args)
  File "videopose.py", line 133, in main
    input_video_skip=args.viz_skip)
  File "/home/viz/test/visualization/video-to-pose3D/common/visualization.py", line 187, in render_animation
    anim.save(output, writer=writer)
  File "/home/viz/sw/yes/lib/python3.7/site-packages/matplotlib/animation.py", line 1174, in save
    writer.grab_frame(**savefig_kwargs)
  File "/home/viz/sw/yes/lib/python3.7/contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/viz/sw/yes/lib/python3.7/site-packages/matplotlib/animation.py", line 232, in saving
    self.finish()
  File "/home/viz/sw/yes/lib/python3.7/site-packages/matplotlib/animation.py", line 358, in finish
    self.cleanup()
  File "/home/viz/sw/yes/lib/python3.7/site-packages/matplotlib/animation.py", line 395, in cleanup
    out, err = self._proc.communicate()
  File "/home/viz/sw/yes/lib/python3.7/subprocess.py", line 939, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/home/viz/sw/yes/lib/python3.7/subprocess.py", line 1672, in _communicate
    selector.register(self.stdout, selectors.EVENT_READ)
  File "/home/viz/sw/yes/lib/python3.7/selectors.py", line 352, in register
    key = super().register(fileobj, events, data)
  File "/home/viz/sw/yes/lib/python3.7/selectors.py", line 238, in register
    key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data)
  File "/home/viz/sw/yes/lib/python3.7/selectors.py", line 225, in _fileobj_lookup
    return _fileobj_to_fd(fileobj)
  File "/home/viz/sw/yes/lib/python3.7/selectors.py", line 40, in _fileobj_to_fd
    "{!r}".format(fileobj)) from None
ValueError: Invalid file object: <_io.BufferedReader name=31>
  1%|█▍     
```'

Is it because of some dependencies or missing modules ?  Looks like matplotlib is root cause here. I have the folllowing version of matplotlib matplotlib                3.0.3            py37h5429711_0  
ns3new commented 5 years ago

Issue solved install again ffmeg

conda install -c conda-forge ffmpeg