This project is a FastAPI-based backend that classifies common skin conditions in dogs, cats, and cows using pre-trained TensorFlow/Keras models.
It also provides medicine suggestions for the predicted disease using Gemini (via med.py).
NOTE: Create and load your own Gemini api key before running the app.
- Image upload support (
.jpg,.png,.jpeg) - Lazy model loading for efficient memory usage
- Supported animals:
- πΆ Dogs β Demodicosis, Dermatitis, Fungal Infection, Hypersensitivity, Ringworm, Healthy
- π± Cats β Flea Allergy, Ringworm, Scabies, Healthy
- π Cows β Lumpy Skin, Healthy
- Normalizes inconsistent labels
- Fetches medicine suggestions using Gemini
.
βββ app.py # Main FastAPI application
βββ model_loader.py # Handles lazy loading of Keras models
βββ utils.py # Utility functions (e.g., image preprocessing)
βββ med.py # Gemini API integration for medicine suggestions
βββ Dog.keras # Pre-trained dog model
βββ cat.keras # Pre-trained cat model
βββ cow.keras # Pre-trained cow model
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
---
## βοΈ Installation & Running
```bash
git clone https://github.com/ankitkr1375/animal_classifier.git
cd animal_classifier
python -m venv venv
# Windows
venv\Scripts\activate
# Mac/Linux
source venv/bin/activate
pip install -r requirements.txt
venv\Scripts\activate
uvicorn main:app --reload
streamlit run app.py