yoyo-nb / Thin-Plate-Spline-Motion-Model

[CVPR 2022] Thin-Plate Spline Motion Model for Image Animation.
MIT License
3.44k stars 558 forks source link

Add Web Demo & Docker environment #8

Closed chenxwh closed 2 years ago

chenxwh commented 2 years ago

Hey @yoyo-nb ! 👋

This pull request makes it possible to run your model inside a Docker environment, which makes it easier for other people to run it. We're using an open source tool called Cog to make this process easier.

This also means we can make a web page where other people can try out your model! View it here: https://replicate.com/yoyo-nb/thin-plate-spline-motion-model. The docker file can be found under the tab ‘run model with docker’.

Do claim the page so you can own the page, customise the Example gallery as you like, push any future update to the web demo, and we'll feature it on our website and tweet about it too. You can find the 'Claim this model' button on the top of the page ~ When the page is claimed, it will be automatically linked to the arXiv website as well (under “Demos”).

In case you're wondering who I am, I'm from Replicate, where we're trying to make machine learning reproducible. We got frustrated that we couldn't run all the really interesting ML work being done. So, we're going round implementing models we like. 😊

yoyo-nb commented 2 years ago

Hi, thanks for your contribution. However, I encountered an error when using cog build -t test to build:

File "predict.py", line 19, in <module>
     from ffhq_dataset.face_alignment import image_align
ModuleNotFoundError: No module named 'ffhq_dataset'

Failed to get type signature: exit status 1

Maybe you should add .py code or add dependencies in cog.yaml?

chenxwh commented 2 years ago

Hi @yoyo-nb,

Sorry you are right, I forgot to add the the ffhq_dataset to the image pushed to replicate, in fact I wasn’t sure whether I should add the commonly used face alignment pre-processing (from here) to the demo, as it is not part of the repo, but I find the video quality can be compromised without the face alignment (since people may like to try the demo with customised image that is not aligned and cropped). I have updated the docker image now that is with the alignment code, let me know if you’d prefer it removed (from predict.py), but also feel free to update the demo anyway you like :)