amaye15 commited on
Commit
4ddba5e
1 Parent(s): 4caa589

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -1
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
+ ```