--- title: Marine Species Identification API emoji: 🐟 colorFrom: blue colorTo: indigo sdk: docker pinned: false license: apache-2.0 short_description: marine species identification api --- # Marine Species Identification API A scalable FastAPI-based API for marine species identification using YOLOv5 deep learning model. This API can detect and classify 691+ marine species from images with high accuracy. ## Features - **Marine Species Detection**: Identify 691+ marine species using YOLOv5 - **RESTful API**: Clean, well-documented REST API endpoints - **Real-time Processing**: Fast inference with GPU/CPU support - **Annotated Results**: Returns both detection data and annotated images - **Scalable Architecture**: Built with FastAPI for high performance - **HuggingFace Integration**: Seamless model loading from HuggingFace Hub - **Docker Ready**: Containerized for easy deployment ## API Endpoints ### Core Endpoints - `POST /api/v1/detect` - Detect marine species in images - `GET /api/v1/species` - List all supported marine species - `GET /api/v1/species/{class_id}` - Get specific species information - `GET /api/v1/health` - Health check and model status - `GET /api/v1/info` - API information and capabilities ### Example Usage ```bash # Detect marine species curl -X POST "http://localhost:7860/api/v1/detect" \ -H "Content-Type: application/json" \ -d '{ "image": "base64_encoded_image_data", "confidence_threshold": 0.25, "return_annotated_image": true }' ``` ## Development ### Local Setup 1. Clone the repository 2. Install dependencies: `pip install -r requirements.txt` 3. Run the API: `uvicorn app.main:app --host 0.0.0.0 --port 7860` ### Docker Deployment ```bash docker build -t marine-species-api . docker run -p 7860:7860 marine-species-api ``` ## Documentation - **Interactive API Docs**: `/docs` (Swagger UI) - **Alternative Docs**: `/redoc` (ReDoc) - **OpenAPI Schema**: `/api/v1/openapi.json` ## Model Information - **Model**: YOLOv5 trained on marine species dataset - **Classes**: 691+ marine species - **Input**: RGB images (JPEG, PNG, etc.) - **Output**: Bounding boxes, confidence scores, species labels ## Supported Marine Species The model can detect a wide variety of marine life including: - Fish species (Sebastes, Rockfish, etc.) - Marine invertebrates (Sea stars, Urchins, etc.) - Cephalopods (Octopus, Squid, etc.) - Cnidarians (Jellyfish, Corals, etc.) - And many more... Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference