roykapon / MAS

The official implementation of the paper "MAS: Multiview Ancestral Sampling for 3D Motion Generation Using 2D Diffusion"
MIT License
97 stars 3 forks source link

Blank result generated #1

Closed kexul closed 6 months ago

kexul commented 10 months ago

Thanks for your great work! I've download the pretrained model and try to generate 3D motions by:

python -m sample.mas --model_path save/nba/nba_diffusion_model/checkpoint_500000.pth

The process finished without error, with 10 mp4 files and 1 npy file generated in the nba_diffusion_model/mas_seed_0 directory, but the mp4 file is blank.

I've checked the npy file, which seems good to me. image

Here is my npy file and one of my mp4 file: Downloads.zip

roykapon commented 10 months ago

Hi @kexul, thank you for checking out our code! Unfortunately, I could not reproduce this issue on my machine. It could have something to do with the ffmpeg installation, so please verify that ffmpeg is correctly installed by running ffmpeg -version (my version is 4.2.2). If it is installed, this link might be of some help: https://stackoverflow.com/questions/59953588/matplotlib-why-is-my-saved-animation-video-blank Alternatively, you could use PillowWriter to save the animation in .gif format. For that sake, you can change the function save_animation in utils/plot_script.py to:

def save_animation(anim: FuncAnimation, save_path, fps):
    save_path = f"{save_path}.gif"
    print(f"saving to [{os.path.abspath(save_path)}]...", end="", flush=True)
    writer = PillowWriter(fps=fps)
    anim.save(save_path, writer=writer)
    print("\033[0K\r\033[0K\r", end="")
    print(f"saved to [{os.path.abspath(save_path)}]")

Please update us whether it helped you or not :) We would also like to know if anyone else has experienced similar issues.

kexul commented 9 months ago

Hi @roykapon , many thanks for your help! 🤗

so please verify that ffmpeg is correctly installed by running

  1. I'm using ffmpeg ffmpeg version 3.4.11-0ubuntu0.1. Just found that the torchvision bundled ffmpeg is broken, I replaced it with the ubuntu's. https://github.com/pytorch/vision/issues/7508

Alternatively, you could use PillowWriter to save the animation in .gif format.

  1. Nope, it also produces blank .gif file.
Dimoyok commented 7 months ago

Hello @roykapon (Thank you for the great technology and amazing paper!) and @kexul. I had the same problem, but it was solved quite simply. You need to reinstall matplotlib of the right version: pip3 install matplotlib==3.1.3 I hope this helps someone else.

roykapon commented 6 months ago

Thank you @Dimoyok !! It appears to be the right solution :) So, for now I will be closing this issue, but feel free to let us know if it persists.