Views
No views yet
1import torch
2from PIL import Image
3
4# Load an image
5input_image = Image.open("path/to/your/image.jpg")
6
7# Create predictor instance
8predictor = torch.hub.load("Stable-X/StableNormal", "StableNormal_turbo", trust_repo=True, yoso_version='yoso-normal-v0-3')
9
10# Apply the model to the image
11normal_image = predictor(input_image)
12
13# Save or display the result
14normal_image.save("output/normal_map.png")