--- license: apache-2.0 tags: - image-classification - pytorch - pet-breeds - oxford-iiit-pet-dataset - swin-transformer widget: # You might need to configure a Space for the widget to work effectively # Or provide a link to your Gradio Space if you create one - example_url: "https://huggingface.co/datasets/huggingface/cats-image/resolve/main/cats-300.jpg" --- # KEDU Breed Classifier (swin_tiny_patch4_window7_224) This model classifies pet breeds based on the Oxford-IIIT Pet Dataset. Model architecture: `swin_tiny_patch4_window7_224`. ## How to Use 1. **Install dependencies:** ```bash pip install torch torchvision timm pytorch-lightning albumentations opencv-python-headless scikit-learn Pillow huggingface_hub python-box PyYAML ``` 2. **Download `inference.py`, `pytorch_model.ckpt`, and `label_encoder.pkl` from this repository.** 3. **Run inference:** ```python from inference import load_model_from_hf, load_label_encoder_from_hf, predict_breed model = load_model_from_hf(repo_id="Hajorda/keduClassifier") label_encoder = load_label_encoder_from_hf(repo_id="Hajorda/keduClassifier") image_path = "path/to/your/pet_image.jpg" # Replace with your image path predicted_breed, confidence = predict_breed(image_path, model, label_encoder) print(f"Predicted: {predicted_breed}, Confidence: {confidence:.4f}") ``` ## Model Details - **Dataset:** Oxford-IIIT Pet Dataset - **Number of Classes:** 37 - **Image Size:** (224, 224) ## Performance - **Validation Accuracy:** 93.40% (Note: This is the validation accuracy from the training run.) ## Author Hajorda