Instructions to use amaye15/ViT-Standford-Dogs with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amaye15/ViT-Standford-Dogs with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="amaye15/ViT-Standford-Dogs") 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("amaye15/ViT-Standford-Dogs") model = AutoModelForImageClassification.from_pretrained("amaye15/ViT-Standford-Dogs") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -13,4 +13,27 @@ pipeline_tag: image-classification
|
|
| 13 |
**DagsHub & Mlflow Experiement Tracking:** [Here](https://dagshub.com/andrewmayes14/mlflow/experiments/#/)
|
| 14 |
|
| 15 |
## Project Overview
|
| 16 |
-
As a volunteer at 'Le Refuge,' a local animal protection association, I embarked on a mission to develop a machine learning tool that could aid in the classification of dog breeds from their vast image database. The project was inspired by my own experience finding my beloved pet, Snooky, through this association. To give back, I aimed to streamline their data management process by implementing an advanced breed classification algorithm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
**DagsHub & Mlflow Experiement Tracking:** [Here](https://dagshub.com/andrewmayes14/mlflow/experiments/#/)
|
| 14 |
|
| 15 |
## Project Overview
|
| 16 |
+
As a volunteer at 'Le Refuge,' a local animal protection association, I embarked on a mission to develop a machine learning tool that could aid in the classification of dog breeds from their vast image database. The project was inspired by my own experience finding my beloved pet, Snooky, through this association. To give back, I aimed to streamline their data management process by implementing an advanced breed classification algorithm.
|
| 17 |
+
|
| 18 |
+
```python
|
| 19 |
+
from transformers import pipeline
|
| 20 |
+
|
| 21 |
+
# Specify the model you want to use
|
| 22 |
+
model_name = "amaye15/ViT-Standford-Dogs" # Example: Vision Transformer
|
| 23 |
+
|
| 24 |
+
# Load the image classification pipeline with the specified model
|
| 25 |
+
image_classifier = pipeline("image-classification", model=model_name)
|
| 26 |
+
|
| 27 |
+
# Path or URL to your image
|
| 28 |
+
image_path_or_url = "path_or_url_to_your_image"
|
| 29 |
+
|
| 30 |
+
# Get predictions
|
| 31 |
+
predictions = image_classifier(image_path_or_url)
|
| 32 |
+
|
| 33 |
+
# Define the number of top predictions you want to see (top k)
|
| 34 |
+
top_k = 5
|
| 35 |
+
|
| 36 |
+
# Print the top k predictions
|
| 37 |
+
for prediction in predictions[:top_k]:
|
| 38 |
+
print(f"Class: {prediction['label']}, Confidence: {prediction['score']:.2f}")
|
| 39 |
+
```
|