Simple FastAPI backend for video/audio analysis with Whisper and Gemini.
- main.py - current FastAPI entrypoint kept for uvicorn main:app
- app/main.py - package entrypoint alias for a cleaner import path
- data/keywords.json - keyword dictionary used by detection
- temp/ - runtime scratch space for extracted media
- FastAPI -
pip install fastapi - Uvicorn -
pip install uvicorn - Whisper -
pip install openai-whisper - Multipart form support -
pip install python-multipart - Gemini SDK -
pip install google-genai - Dotenv support -
pip install python-dotenv - FFmpeg -
sudo apt install ffmpeg
- Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate - Install Python dependencies:
pip install -r requirements.txt
- Create your local environment file:
cp .env.example .env
- Open
.envand set yourGEMINI_API_KEYvalue. - Make sure
ffmpegis installed on your machine. - Start the FastAPI server:
uvicorn main:app --reload --port 9000
- Open the API at:
http://127.0.0.1:9000
- Build the image:
docker build -t hackathon-mockup-backend . - Run the container and pass your Gemini API key:
docker run --rm -p 9000:9000 --env-file .env hackathon-mockup-backend
- Open the API at:
http://127.0.0.1:9000
- Start with compose:
docker compose up --build
- Run in detached mode:
docker compose up --build -d
- Stop services:
docker compose down
- The root keywords.json is kept as a compatibility link to data/keywords.json so the existing entrypoint keeps working.
- No application logic was refactored as part of this cleanup.