facebookresearch / ic_gan

Official repository for the paper "Instance-Conditioned GAN" by Arantxa Casanova, Marlene Careil, Jakob Verbeek, Michał Drożdżal, Adriana Romero-Soriano.
Other
535 stars 73 forks source link

Add Docker environment & web demo #15

Closed chenxwh closed 3 years ago

chenxwh commented 3 years ago

Hi @ArantxaCasanova! 👋

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! At the moment we implemented Generating images with IC-GAN with input images (better user interaction), and simplified some specific input. View it here: https://replicate.ai/

Claim your page here so you can edit it, e.g. adding your favourite examples to the example tab, and we'll feature it on our website and tweet about your model too.

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. 😊

facebook-github-bot commented 3 years ago

Hi @CJWBW!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

facebook-github-bot commented 3 years ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

facebook-github-bot commented 3 years ago

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

ArantxaCasanova commented 3 years ago

HI @CJWBW, thank you for taking an interest and starting this pull request!

The possibility to run IC-GAN inference using Docker might be very useful for many.

I have added some comments to the commit, please take a look at them. Also, can you place the 3 files predict.py,cog.yaml and download-weights.sh inside a folder called docker_demo, for example?

Regarding the web demo: Thanks for adding it to replicate.ai! I have two requests at the moment: 1) Right now, the input image is shown as is, before the preprocessing step that crops and resizes the input image. This is misleading specially when saving "examples" in the gallery, as the feature extractor never gets to see the image in the original resolution nor the cropped image parts. Can this be changed so that the input image accurately reflects its content AFTER the preprocessing step? 2) Is there a way to delete examples in the gallery to properly customize it?

chenxwh commented 3 years ago

Hi @ArantxaCasanova :),

Thank you for your comments and feedback. They are very useful!

Regarding the questions:

Also, can you place the 3 files predict.py,cog.yaml and download-weights.sh inside a folder called docker_demo, for example?

Unfortunately it is not supported now. predict.py and cog.yaml files are required for cog and currently it is reading only from the root directory. But we can implement it to support placing those files in a folder if it is important now?

Regarding the web demo: Thanks for adding it to replicate.ai! I have two requests at the moment:

  1. Right now, the input image is shown as is, before the preprocessing step that crops and resizes the input image. This is misleading specially when saving "examples" in the gallery, as the feature extractor never gets to see the image in the original resolution nor the cropped image parts. Can this be changed so that the input image accurately reflects its content AFTER the preprocessing step?

That is a good point, but at the moment it only shows the uploaded image and the final output. We are thinking about enabling multiple output in the (near) future, for example output the processed the image as well, so in the examples you will have the original input, processed input and output. Does this sound like something that might be interesting?

  1. Is there a way to delete examples in the gallery to properly customize it?

Good news, we have just enabled the delete button, take a look here :D! It only allows owner of the page to add and delete examples from the gallery.

Thank you again for your comment feedback.

ArantxaCasanova commented 3 years ago

Hi @CJWBW,

Unfortunately it is not supported now. predict.py and cog.yaml files are required for cog and currently it is reading only from the root directory. But we can implement it to support placing those files in a folder if it is important now?

I see, then we can keep it like that for now.

That is a good point, but at the moment it only shows the uploaded image and the final output. We are thinking about enabling multiple output in the (near) future, for example output the processed the image as well, so in the examples you will have the original input, processed input and output. Does this sound like something that might be interesting?

Yes, this seems interesting and it's a feature I would definitely love to have; otherwise, some users might get confused about the input vs output relation. For now, would it be possible to add some explanation text in Input-image? Right now it reads "Input image Instance". It could be extended to something like "Raw input image-instance. NOTE: The image is preprocessed with a center crop and a 256x256 resizing before extracting its features and conditioning the model."

Good news, we have just enabled the delete button, take a look here :D!

Great! That's exactly what I needed.

I am merging the pull request, thanks for your great work on this!

chenxwh commented 3 years ago

Hi @ArantxaCasanova ,

Thank you for acknowledging our work!

Yes, this seems interesting and it's a feature I would definitely love to have; otherwise, some users might get confused about the input vs output relation. For now, would it be possible to add some explanation text in Input-image? Right now it reads "Input image Instance". It could be extended to something like "Raw input image-instance. NOTE: The image is preprocessed with a center crop and a 256x256 resizing before extracting its features and conditioning the model."

I have pushed a new version to the website with the NOTE.

You are encouraged to push any updated version to the server too in the future with this: cog push r8.im/arantxacasanova/ic_gan (or any other models, with cog installed and logged in) :)