Downloads · 30 days
0
RamyKhorshed/Lesson2FastAi
Lesson2FastAi is a image classification model from RamyKhorshed. Use it when you need a label for an image. It is set up for fastai. The card lists the license as mit.
This model classifies whether an input image contains a cat or not. You can use the model through: 1. The interface above - just upload an image and get predictions 2. Programmatically using the code below
Downloads · 30 days
0
Access
Public
Updated Nov 23, 2024
Repo size
47.1 MB
Likes
0
Public
Click a slice to open those files.
.pkl47.1 MB · 100%
From the Hugging Face model README
This model classifies whether an input image contains a cat or not. You can use the model through:
from fastai.learner import load_learner
from huggingface_hub import hf_hub_download
# Download the model
model_path = hf_hub_download(repo_id="RamyKhorshed/Lesson2FastAi", filename="model.pkl")
model = load_learner(model_path)
# Make a prediction
img_path = "path/to/your/image.jpg"
pred, pred_idx, probs = model.predict(img_path)
print(f"Prediction: {pred}")
print(f"Confidence: {probs[pred_idx]:.4f}")