fabro66 / GAST-Net-3DPoseEstimation

A Graph Attention Spatio-temporal Convolutional Networks for 3D Human Pose Estimation in Video (GAST-Net)
MIT License
314 stars 69 forks source link

error occurs when generating animation #42

Closed bfeng1 closed 3 years ago

bfeng1 commented 3 years ago

Hi all,

I tried the following command to reproduce the output as the example.

    python gen_skes.py -v baseball.mp4 -np 1 --animation

I noticed that the code can successfully load the pretrained models, and generate 3D human pose. However, a FileNotFoundError occurs when the code tries to generate the animation. I attached the error massage for additional information. If someone have ideas about how to resolve the following issue, please let me know!

Thank you!

YOLOv3 network successfully loaded
Loading HRNet model ...
HRNet network successfully loaded
Generating 2D pose ...
100%|████████████████████████████████████████████████████████████████████████████████| 277/277 [01:01<00:00,  4.47it/s]
Loading GAST-Net ...
GAST-Net successfully loaded
Generating 3D human pose ...
Generating animation ...
Traceback (most recent call last):
  File "gen_skes.py", line 180, in <module>
    generate_skeletons(video=video_path, output_animation=args.animation, num_person=args.num_person)
  File "gen_skes.py", line 154, in generate_skeletons
    render_animation(re_kpts, keypoints_metadata, anim_output, skeleton, 25, 30000, np.array(70., dtype=np.float32),
  File "D:\master_project\validation_test\GAST-Net-3DPoseEstimation\tools\vis_h36m.py", line 129, in render_animation
    for f in read_video(input_video_path, skip=input_video_skip, limit=limit):
  File "D:\master_project\validation_test\GAST-Net-3DPoseEstimation\tools\vis_h36m.py", line 31, in read_video
    w, h = get_resolution(filename)
  File "D:\master_project\validation_test\GAST-Net-3DPoseEstimation\tools\vis_h36m.py", line 15, in get_resolution
    with sp.Popen(command, stdout=sp.PIPE, bufsize=-1) as pipe:
  File "F:\python_related\python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "F:\python_related\python38\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
ohgyeongsu commented 3 years ago

If the version of 'ffmpeg' is 1.4, try installing the latest version

bfeng1 commented 3 years ago

If the version of 'ffmpeg' is 1.4, try installing the latest version

Hi,

Thank you so much for the response! My old ffmpeg version is 1.4, and I updated the ffmpeg to version 4.2.2. It definitely helped, and the animation video begins to get generated. But it did not get finished, and ended with a new error. The following is the new error message, please share any of your insight!

Thank you!

Loading YOLOv3 network.....
YOLOv3 network successfully loaded
Loading HRNet model ...
HRNet network successfully loaded
Generating 2D pose ...
100%|████████████████████████████████████████████████████████████████████████████████| 277/277 [01:11<00:00,  3.87it/s]
Loading GAST-Net ...
GAST-Net successfully loaded
Generating 3D human pose ...
Generating animation ...
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\master_project\validation_test\GAST-Net-3DPoseEstimation\data/video/baseball.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:12.01, start: 0.008005, bitrate: 3798 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 3807 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, image2pipe, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
    Stream #0:0(und): Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 1193200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.54.100 rawvideo
frame=  277 fps= 95 q=-0.0 Lsize= 1682775kB time=00:00:12.09 bitrate=1139712.1kbits/s speed=4.13x
video:1682775kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
D:\master_project\validation_test\GAST-Net-3DPoseEstimation\tools\vis_h36m.py:239: UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.
  fig.tight_layout()
Traceback (most recent call last):
  File "gen_skes.py", line 180, in <module>
    generate_skeletons(video=video_path, output_animation=args.animation, num_person=args.num_person)
  File "gen_skes.py", line 154, in generate_skeletons
    render_animation(re_kpts, keypoints_metadata, anim_output, skeleton, 25, 30000, np.array(70., dtype=np.float32),
  File "D:\master_project\validation_test\GAST-Net-3DPoseEstimation\tools\vis_h36m.py", line 245, in render_animation
    anim.save(output, writer=writer)
  File "F:\python_related\python38\lib\site-packages\matplotlib\animation.py", line 1173, in save
    anim._draw_next_frame(d, blit=False)
  File "F:\python_related\python38\lib\site-packages\matplotlib\animation.py", line 1208, in _draw_next_frame
    self._draw_frame(framedata)
  File "F:\python_related\python38\lib\site-packages\matplotlib\animation.py", line 1776, in _draw_frame
    self._drawn_artists = self._func(framedata, *self._args)
  File "D:\master_project\validation_test\GAST-Net-3DPoseEstimation\tools\vis_h36m.py", line 233, in update_video
    lines_3d[n][j - 1][0].set_3d_properties([pos[j, 2], pos[j_parent, 2]], zdir='z')
  File "F:\python_related\python38\lib\site-packages\mpl_toolkits\mplot3d\art3d.py", line 175, in set_3d_properties
    zs = np.broadcast_to(zs, xs.shape)
AttributeError: 'list' object has no attribute 'shape'
ohgyeongsu commented 3 years ago

Try downgrading the version of 'matplotlib' to 3.1.1

bfeng1 commented 3 years ago

Try downgrading the version of 'matplotlib' to 3.1.1

I have downgraded the matplotlib to 3.1.1, but same error message occurs.

matplotlib                3.1.1            py38hc8f65d3_0

Thanks!

bfeng1 commented 3 years ago

Try downgrading the version of 'matplotlib' to 3.1.1

I think I found the possible issue, I initially installed my matplotlib using pip, but for some reason, pip install did not work for version 3.1.1. So I used conda to downgrade the matplotlib package. Now, I have two version of matplotlib, one is in pip list with version of 3.4.2, and another one is in conda list with version of 3.1.1.

Then I uninstalled the 3.4.2 version using pip uninstall. But I got a ModuleNotFoundError when I run the program again:

ModuleNotFoundError: No module named 'matplotlib'

Do you have any idea about how to resolve this issue?

Thank you!

bfeng1 commented 3 years ago

Update (Solved): In case anyone will face the similar issue as me, here is the way I got this solved:

  1. create a new environment using conda and install all necessary package with specific version, include matplotlib==3.1.1.
  2. Make sure the matplotlib-base is the same version as the matplotlib. (mine matplotlib-base is in version 3.4.2 while matplotlib is in version 3.1.1. That is why I still got the same error message).