Instructions to use SupremoUGH/image-classification-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SupremoUGH/image-classification-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="SupremoUGH/image-classification-model") 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("SupremoUGH/image-classification-model") model = AutoModelForImageClassification.from_pretrained("SupremoUGH/image-classification-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 442 Bytes
ab8b628 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import sys
from image_classification_model.predict import predict
def main():
if len(sys.argv) < 2:
print("Usage: python predict.py <image_path>")
sys.exit(1)
image_path = sys.argv[1]
# Run prediction (handles preprocessing internally)
predicted_label = predict(image_path)
# Print output in Hugging Face-compatible format
print({"label": predicted_label})
if __name__ == "__main__":
main()
|