sign-language-processing / pose

Library for viewing, augmenting, and handling .pose files
https://pose-format.readthedocs.io/en/latest/
MIT License
74 stars 23 forks source link

Support GIF generation in the PoseVisualizer #27

Closed AmitMY closed 2 years ago

AmitMY commented 2 years ago

It's more complicated to show videos in Google Colab than GIFs, so I added support

from IPython.display import Image
display(Image(open('test.gif','rb').read()))

test_256

bricksdont commented 2 years ago

Possible section to add to README:

Visualization

Visualize an existing pose file:

from pose_format import Pose
from pose_format.pose_visualizer import PoseVisualizer

p = Pose.read(open("example.pose", "rb").read())

v = PoseVisualizer(p)

v.save_video("example.mp4", v.draw())

Draw pose on top of video:

v.save_video("example.mp4", v.draw_on_video())

Convert pose to gif to easily inspect the result in Colab:

# in a Colab notebook

from IPython.display import Image

v.save_gif("test.gif", v.draw())

display(Image(open('test.gif','rb').read()))
bricksdont commented 2 years ago

you could either add this in this PR, or I could add it later

AmitMY commented 2 years ago

Added! Thanks

bricksdont commented 2 years ago

now looks good to me and a very useful feature, ship it 👍