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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The weights for StableNormal-turbo #30

Open
BIT-DYN opened this issue Dec 9, 2024 · 6 comments
Open

The weights for StableNormal-turbo #30

BIT-DYN opened this issue Dec 9, 2024 · 6 comments

Comments

@BIT-DYN
Copy link

BIT-DYN commented Dec 9, 2024

Such an amazing job!

I have downloaded the original weights for StableNormal followed #14.

But where can I download the weights file for StableNormal-turbo?
I want to test which of the two is better for our scenes.
Thanks!

@hugoycj
Copy link
Collaborator

hugoycj commented Dec 9, 2024

We are currently conducting beta testing for StableNormal_turbo to optimize the balance between sharpness and accuracy. You can try the demo on Hugging Face.
For local testing, please use the following commands:

import torch
from PIL import Image

# Load an image
input_image = Image.open("path/to/your/image.jpg")

# Create predictor instance
predictor = torch.hub.load("hugoycj/StableNormal", "StableNormal_turbo", trust_repo=True, yoso_version='yoso-normal-v1-5')

# Generate normal map using alpha channel for masking
normal_map = predictor(rgba_image, data_type="object")  # Will mask out background, if alpha channel is avalible, else use birefnet
normal_map = predictor(rgba_image, data_type="outdoor")  # Will use Mask2Former to mask out sky and plants
normal_map = predictor(rgba_image, data_type="indoor") # Will not mask out

# Apply the model to the image
normal_image = predictor(input_image)

# Save or display the result
normal_image.save("output/normal_map.png")

@BIT-DYN
Copy link
Author

BIT-DYN commented Dec 9, 2024

Thank you for your quick reply!

Since my terminal doesn't have direct access to huggingface (but the browser does).
So I chose to download the v1-5 weights locally, but there seems to be some problems.

image

v1-0 weights is available, but the results are very unsatisfactory.

e0ae8d822f1756bda926e631ce59ebe

Do you have any suggestions?

@xingchen2022
Copy link

Thank you for your quick reply!

Since my terminal doesn't have direct access to huggingface (but the browser does). So I chose to download the v1-5 weights locally, but there seems to be some problems.

image

v1-0 weights is available, but the results are very unsatisfactory.

e0ae8d822f1756bda926e631ce59ebe

Do you have any suggestions?

same question, have you solved this?

@xingchen2022
Copy link

@BIT-DYN hi, have you find the proper way to reproduce the result like online demo?I have tried different weights in #31

@BIT-DYN
Copy link
Author

BIT-DYN commented Dec 18, 2024

@BIT-DYN hi, have you find the proper way to reproduce the result like online demo?I have tried different weights in #31

Unfortunately, I have not solved this problem so far.

@hugoycj
Copy link
Collaborator

hugoycj commented Dec 19, 2024

@BIT-DYN Sorry for the late reply. Could you share your input image and the normal result from the HuggingFace demo? StableNormal may fail for defocused, horizontally oriented or cartoon-style images. It might be our model's problem. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants