Skip to content

sahilk1234/Image_caption

Repository files navigation

Image Captioning - Monorepo

Full-stack app for captioning images with a small TorchScript model, guest sessions, and user accounts.

  • Frontend: Next.js + TypeScript + shadcn/ui
  • Backend: FastAPI + SQLModel (SQLite by default) + PyTorch (TorchScript)
  • Auth: Guest token (cookie) + Bearer token; guest history kept 24h and merged on sign-in.

Repo Structure

  • backend/ - FastAPI API, auth, inference, database
  • frontend/ - Next.js UI
  • model/ - notebooks, artifacts, training data
  • scripts/ - Postgres bootstrap for container runtime
  • Dockerfile, nginx.conf, supervisord.conf - container build and runtime

Live Demo

Quick Start (local)

  1. Backend
  • Follow backend/README.md.
  1. Frontend
  • Follow frontend/README.md.

Model Artifacts

The backend needs TorchScript artifacts to run inference. Use the files in model/artifacts and copy them into backend/artifacts, or set MODEL_TS, VOCAB_JSON, and CONFIG_JSON to point to them.

See model/README.md for details.

Docker (optional)

The Docker image builds the frontend as static assets and runs the backend behind nginx. If you use the container, make sure backend/artifacts is present in the build context or set artifact environment variables at runtime.

docker build -t image-caption .
docker run -p 8080:8080 image-caption

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors