aimhubio / aim

Aim 💫 — An easy-to-use & supercharged open-source experiment tracker.
https://aimstack.io
Apache License 2.0
5.19k stars 319 forks source link

How to display GIF in Aim ? #1675

Closed mantle2048 closed 2 years ago

mantle2048 commented 2 years ago

❓Question

I'm recording an experiment of Reinforcement Learning.

I saved a rendered trajectory (a numpy array) as a GIF image through PIL and saved it locally which can be played normally.

I want to save the GIF to Aim Run. Then I convert the GIF to aim.Image and track it through the following codes.

gif_path = './trajectory.gif'
aim_image = aim.Image(image=gif_path, format='gif')
aim_run.track(value=aim_image, name=name, step=step_, context=context)

However, in the Aim UI, I found that GIF cannot be played normally, that is, it becomes a static picture (but it is still in GIF format)

By viewing the source code, I found that Aim saved the GIF (type: PIL.GifImagePlugin.GifImageFile) to BytesIO and converted it to a BLOB object.

Is this because BLOB object may not store GIF properly? Is there any way to save GIF to Aim Run and play it normally in Aim UI?

devfox-se commented 2 years ago

Hey @mantle2048

That's a good question and nice feature to have actually! Unfortunately we do not support gifs atm, but I would appreciate you to open issue on this so we can deliver it in near future:)

Edit: Or for simplicity please add more context under this issue and change this question to feature request.

Thanks!

mantle2048 commented 2 years ago

Thanks for your reply. I have gradually transferred from Tensorboard to Aim and hope to see GIF or video records in the future !

devfox-se commented 2 years ago

Hi @mantle2048

I have some draft ready to support animated GIFs in Aim. Results are represented in the video I shared, do you think it suits your needs and it's something you have been asking for ? Could you share your use-cases ?

https://user-images.githubusercontent.com/48801049/165620344-364134c3-9b9e-49c6-8556-808ce0aaaff2.mov

mantle2048 commented 2 years ago

Hi @devfox-se

Sorry for the late reply. The demo looks very cool ! For me, this demo suits my needs.

In an experiment, I have to record dozens of GIFs to compare the performance during training, so it would be better if Aim could put all GIFs with the same tag together and switch through a slider. Just like the video below.

https://user-images.githubusercontent.com/37854077/165662295-940c6f55-0865-4f95-bf95-00f7acafc61d.mp4

devfox-se commented 2 years ago

Hi @mantle2048

Thanks for your comment! As for now we do not have the exact sliding capability shown in the video, but it is sure a nice feature to have. Since it will take us some time and effort to implement this feature I would ask you to open a new issue/feature-request for that :)

As for now I am closing this question and will open a new feature-request to cover the GIF feature.

kaimo455 commented 11 months ago

Hi @mantle2048

I have some draft ready to support animated GIFs in Aim. Results are represented in the video I shared, do you think it suits your needs and it's something you have been asking for ? Could you share your use-cases ?

Screen.Recording.2022-04-27.at.23.53.46.mov

He @devfox-se, the video is quit interesting and could you please provide some hints how to implement that? Is that sort of work around and how to do that?