How to use sgugger/custom-resnet50d with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="sgugger/custom-resnet50d", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")
# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("sgugger/custom-resnet50d", trust_remote_code=True) model = AutoModelForImageClassification.from_pretrained("sgugger/custom-resnet50d", trust_remote_code=True)
I want to share my custom model in the hub and enable the model widget, is it possible?
No, but you can use them in a Space to create a demo.
· Sign up or log in to comment