harlanhong / CVPR2022-DaGAN

Official code for CVPR2022 paper: Depth-Aware Generative Adversarial Network for Talking Head Video Generation
https://harlanhong.github.io/publications/dagan.html
Other
958 stars 125 forks source link

add web demo/model to Huggingface #10

Closed AK391 closed 2 years ago

AK391 commented 2 years ago

Hi, would you be interested in adding DaGAN to Hugging Face? The Hub offers free hosting, and it would make your work more accessible and visible to the rest of the ML community. Models/datasets/spaces(web demos) can be added to a user account or organization similar to github.

Example from other organizations: Keras: https://huggingface.co/keras-io Microsoft: https://huggingface.co/microsoft Facebook: https://huggingface.co/facebook

Example spaces with repos: github: https://github.com/salesforce/BLIP Spaces: https://huggingface.co/spaces/salesforce/BLIP

github: https://github.com/facebookresearch/omnivore Spaces: https://huggingface.co/spaces/akhaliq/omnivore

and here are guides for adding spaces/models/datasets to your org

How to add a Space: https://huggingface.co/blog/gradio-spaces how to add models: https://huggingface.co/docs/hub/adding-a-model uploading a dataset: https://huggingface.co/docs/datasets/upload_dataset.html

Please let us know if you would be interested and if you have any questions, we can also help with the technical implementation.

harlanhong commented 2 years ago

That's awesome, thanks, I will Integrate DaGAN into Huggingface Spaces in near future.

harlanhong commented 2 years ago

Hi @AK391 ,

The Hugging Face is a great platform for us to present our project. However, I met a problem when deploying my code on it, It seems quite simple for you experienced guys:

image

Could you help me with this problem?

AK391 commented 2 years ago

@harlanhong Hi, it looks like the requirements.txt file is missing so similar to github you can add a requirements.txt file to spaces https://github.com/harlanhong/CVPR2022-DaGAN/blob/master/requirements.txt

harlanhong commented 2 years ago

@harlanhong Hi, it looks like the requirements.txt file is missing so similar to github you can add a requirements.txt file to spaces https://github.com/harlanhong/CVPR2022-DaGAN/blob/master/requirements.txt

Thanks, it works. I will share the space link with you soon.

harlanhong commented 2 years ago

How to use GPU in spaces. I can now run my code on it but it cost too much time when using the CPU. When I load my model on GPU, an error will occur:

image
AK391 commented 2 years ago

@harlanhong Hi, from the spaces docs: https://huggingface.co/docs/hub/spaces

Each Spaces environment is limited to 16GB RAM and 8 CPU cores. Organization subscribers (Lab, Startup, and Enterprise) can access Spaces with one T4 GPU on a case-by-case basis. Please email us at website at huggingface.co or let us know on Twitter if you need one.

I can also send a request to assign a gpu for this space

harlanhong commented 2 years ago

@harlanhong Hi, from the spaces docs: https://huggingface.co/docs/hub/spaces

Each Spaces environment is limited to 16GB RAM and 8 CPU cores. Organization subscribers (Lab, Startup, and Enterprise) can access Spaces with one T4 GPU on a case-by-case basis. Please email us at website at huggingface.co or let us know on Twitter if you need one.

I can also send a request to assign a gpu for this space

Many thanks.

osanseviero commented 2 years ago

Hey there! :wave: We opened an internal PR to provide a temporal GPU, we'll let you know once it's deployed.

AK391 commented 2 years ago

thanks @osanseviero also @harlanhong huggingface can also host models for free, so the pretrained checkpoints in one drive for example can be added to the huggingface model hub under your username or a organization name, more details here: https://huggingface.co/docs/hub/adding-a-model

osanseviero commented 2 years ago

This Space has GPU now! :rocket: :rocket:

AK391 commented 2 years ago

thanks @osanseviero, was testing out the space, still seem to be taking some time, 200 seconds so far with one of the examples and the output is not showing @harlanhong

osanseviero commented 2 years ago

The demo is currently running demo_dagan script every inference call, which means the model is reloaded every time and this is what might be making things slow.

harlanhong commented 2 years ago

The demo is currently running demo_dagan script every inference call, which means the model is reloaded every time and this is what might be making things slow.

Oh, I see. Thanks for your reminder.

harlanhong commented 2 years ago

thanks @osanseviero, was testing out the space, still seem to be taking some time, 200 seconds so far with one of the examples and the output is not showing @harlanhong

Hi @AK391, I have modified my code to load everything before launching, but when I test it I get an error, however, the log file doesn't report anything about that error.

AK391 commented 2 years ago

@harlanhong sorry for the late response, are you still getting this error and how long is inference taking on the gpu space?

AK391 commented 2 years ago

@harlanhong currently its running over 600 seconds

Screen Shot 2022-04-30 at 1 37 45 AM
AK391 commented 2 years ago

@harlanhong any update on this?

NimaBoscarino commented 2 years ago

Hi @harlanhong! Would you be interested in making the checkpoint available on the Hub as a model repo? It would make it easy for our community to find your model and you could attach some tags and documentation to it, like this model: https://huggingface.co/bert-base-uncased

There's documentation on how to do this, but I'm also happy to take it on or help out!