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.