uapb/ai
AquaVision — Fish Nutrigenomics & AI Lab (UAPB)
AI-powered detection and weight estimation for aquaculture species, built by the Fish Nutrigenomics & AI Lab at the University of Arkansas at Pine Bluff (Dr. Yathish Ramena, Director).
Two-model architecture served by a FastAPI backend:
- Shrimp / Prawn → local YOLO segmentation model (
models/weights.pt) - Largemouth Bass → YOLOv11s-seg (
models/lmb_weights.pt) → mask → px/cm calibration → allometric curve → weight (g)
Layout
server/ FastAPI backend — routes only; the work lives in the packages
main.py the app (uvicorn target: server.main:app)
startup.py container entrypoint: fetch weights, then exec uvicorn
aquavision_tool/ fish detection, in-process
models.py weights, species config, calibration constants
analysis.py detection → morphometrics → weight
jem_agent/ Flask chat agent — persona, session memory, SSE streaming
app.py the Flask app (flask --app jem_agent.app)
chat.py what server/main.py relays through
persona.py the system prompt and the canned replies
web/ everything the browser is allowed to fetch
index.html the site
css/style.css
assets/ logos, portraits, Jem artwork
models/ YOLO weights — gitignored, fetched on first boot
scripts/ run + deploy helpers
logs/ runtime logs — gitignoredOnly web/ is exposed over HTTP, mounted at /static.
Both packages are imported from the repo root, so anything that starts them must run from there — jem_agent/app.py reaches its persona as a package sibling, which only resolves with the root on sys.path.
How it runs
This is a Docker Space. On cold start, `server/startup.py` downloads the model weights (and video assets) from Google Drive, then launches uvicorn server.main:app on port 7860.
Configuration
Nothing secret is committed. Everything below is read from the environment — locally via export or a .env, on Hugging Face via Settings → Variables and secrets, where values are injected into the container at runtime and never appear in the repo, the build log, or to visitors.
Local development
./scripts/run-jem.sh # ollama + jem-agent + site, quick test
./scripts/install-services.sh # the same stack as supervised systemd user units
./scripts/run-local.sh # site + a public Cloudflare tunnelDeploying
./scripts/deploy-hf.sh # pushes to the Hugging Face SpaceNote that a git push to GitHub does not rebuild the Space.
Endpoints
GET /— the AquaVision websiteGET /health— model + config statusPOST /detect/bass— largemouth bass weight predictionPOST /detect?species=...— shrimp/prawn detectionPOST /chat,POST /chat/stream— proxied to the Jem agentGET /species— configured speciesGET /docs— interactive API docs
