Instructions to use imjeffhi/pokemon_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use imjeffhi/pokemon_classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="imjeffhi/pokemon_classifier") 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("imjeffhi/pokemon_classifier") model = AutoModelForImageClassification.from_pretrained("imjeffhi/pokemon_classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -15,8 +15,8 @@ import torch
|
|
| 15 |
|
| 16 |
# Loading in Model
|
| 17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 18 |
-
model = ViTForImageClassification.from_pretrained( "
|
| 19 |
-
feature_extractor = ViTFeatureExtractor.from_pretrained('
|
| 20 |
|
| 21 |
# Caling the model on a test image
|
| 22 |
img = Image.open('test.jpg')
|
|
|
|
| 15 |
|
| 16 |
# Loading in Model
|
| 17 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 18 |
+
model = ViTForImageClassification.from_pretrained( "imjeffhi/pokemon_classifier").to(device)
|
| 19 |
+
feature_extractor = ViTFeatureExtractor.from_pretrained('imjeffhi/pokemon_classifier')
|
| 20 |
|
| 21 |
# Caling the model on a test image
|
| 22 |
img = Image.open('test.jpg')
|