Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker environment & web demo #15

Merged
merged 3 commits into from Sep 25, 2021
Merged

Add Docker environment & web demo #15

merged 3 commits into from Sep 25, 2021

Conversation

chenxwh
Copy link
Contributor

@chenxwh chenxwh commented Sep 23, 2021

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
Copy link

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 facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 24, 2021
@facebook-github-bot
Copy link

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

1 similar comment
@facebook-github-bot
Copy link

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

cog.yaml Outdated Show resolved Hide resolved
predict.py Outdated Show resolved Hide resolved
predict.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ArantxaCasanova
Copy link
Contributor

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
Copy link
Contributor Author

chenxwh commented Sep 25, 2021

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
Copy link
Contributor

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!

@ArantxaCasanova ArantxaCasanova merged commit 6c899cd into facebookresearch:main Sep 25, 2021
@chenxwh
Copy link
Contributor Author

chenxwh commented Sep 25, 2021

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) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants