DeepSea AI is an end-to-end computer vision web application that detects and classifies 13 underwater fish species in real time using a custom-trained YOLOv8 model (best.pt).
fish_offline_app/
βββ client/ # React 19 + Vite Frontend
β βββ src/
β β βββ App.jsx # Router β Home | Demo | Research | Contact
β β βββ pages/
β β β βββ DemoPage.jsx β AI inference UI (main feature)
β β β βββ HomePage.jsx β Landing page
β β β βββ ResearchPage.jsx β Paper + metrics
β β β βββ ContactPage.jsx β Team info
β β βββ index.css # Design system
β βββ public/
β β βββ research/
β β βββ RE_Paper.pdf # Research paper (served statically)
β βββ .env # Frontend environment variables
βββ server/
β βββ main.py # FastAPI inference server
β βββ requirements.txt # Python dependencies
βββ models/
β βββ best.pt # YOLOv8 trained weights (mAP@50: 0.91)
βββ Dockerfile # Unified build (for self-hosted)
βββ Dockerfile.render # Backend-only β Render.com
βββ Dockerfile.huggingface # Backend-only β Hugging Face Spaces
βββ explanation.md # Project explanation for review committee
βββ code_explanation.md # Code walkthrough for review committee
AngelFish Β· BlueTang Β· ButterflyFish Β· ClownFish Β· GoldFish Β· Gourami Β· MorishIdol Β· PlatyFish Β· RibbonedSweetlips Β· ThreeStripedDamselfish Β· YellowCichlid Β· YellowTang Β· ZebraFish
Make sure you have these installed before starting:
| Tool | Version | Check with |
|---|---|---|
| Python | 3.10+ | python --version |
| Node.js | 18+ | node --version |
| npm | 9+ | npm --version |
| Git | Any | git --version |
git clone https://github.com/kadapalanikith/Underwater-Fish-Classification-YOLOv8.git
cd Underwater-Fish-Classification-YOLOv8Open a terminal and run:
cd server
pip install -r requirements.txt
python main.pyβ You should see:
INFO: Uvicorn running on http://0.0.0.0:8000 INFO:HF-Backend:β YOLOv8 Model Loaded
The backend is now running at: http://localhost:8000
- Visit
http://localhost:8000β should return{"status":"running","model":"YOLOv8-Fish-Classifier"} - Visit
http://localhost:8000/docsβ interactive API documentation
Note: First run may take a few minutes to download PyTorch and Ultralytics.
The frontend needs to know where the backend is. Open client/.env:
VITE_API_URL=http://localhost:8000This is already set correctly for local development. β No changes needed.
Open a new terminal (keep the backend running):
cd client
npm install
npm run devβ You should see:
VITE v5.x ready in 300ms β Local: http://localhost:5173/
The frontend is now running at: http://localhost:5173
- Open
http://localhost:5173in your browser - Click "Try the Model" or navigate to Demo
- Upload any underwater fish photo (JPEG/PNG, max 10 MB)
- Click "Process with YOLOv8"
- View annotated image with bounding boxes, species names, and confidence scores
If you have Docker Desktop installed:
# Build the unified image
docker build -t deepsea-ai .
# Run it
docker run -p 8000:8000 deepsea-aiOpen http://localhost:8000 β the React build is served by FastAPI in this mode.
You can test the backend without the frontend using curl:
curl -X POST http://localhost:8000/api/predict \
-F "file=@/path/to/your/fish.jpg"Or use the interactive docs at http://localhost:8000/docs.
| Metric | Value |
|---|---|
| mAP@50 | 0.91 |
| Precision | 0.86 |
| Recall | 0.87 |
| mAP@50β95 | 0.66 |
| Inference Time | β€ 45ms (CPU) |
| Input Size | 640 Γ 640 px |
| Confidence Threshold | 0.25 (default) |
- Push this repo to GitHub
- Connect repo to vercel.com
- Set Root Directory to
client - Add Environment Variable:
VITE_API_URLβ your backend URL - Deploy β
- Create a new Space at huggingface.co/spaces
- Choose Docker as the SDK
- Upload
Dockerfile.huggingface(rename toDockerfile) andserver/contents - Upload
models/best.ptto the Space files - Space will build and run automatically β
- Create a new Web Service at render.com
- Connect GitHub repo, set Root Directory to
.(repo root) - Set Dockerfile Path to
Dockerfile.render - Deploy β
| Problem | Fix |
|---|---|
ModuleNotFoundError: ultralytics |
Run pip install -r server/requirements.txt |
Backend shows β Failed to load model |
Check that models/best.pt exists |
| Frontend shows "Connection error" | Make sure backend is running on port 8000 |
CORS error in browser |
Backend allows * origins by default β check it's running |
npm install fails |
Ensure Node.js 18+ is installed |
| Port 8000 already in use | Kill the process: npx kill-port 8000 |
| File | Purpose |
|---|---|
explanation.md |
Project explanation for review committee (problem β solution β results) |
code_explanation.md |
Code walkthrough for review committee (architecture β functions β design decisions) |
Nikith Kadapalaneni β Computer Vision & Full-Stack Development GitHub: kadapalanikith
Academic/Educational use only. No unauthorized commercial redistribution.