This repository contains a monolithic FastAPI microservice that consolidates Video Moderation, Audio Verification, and Photo KYC Verification into a single, high-performance deployment. It utilizes multiprocessing to manage CPU-intensive AI inferences (Whisper, InsightFace, NudeNet, Pyannote, etc.) without blocking the core event loop.
We have provided simple bootstrap scripts to automatically handle your local environment, install dependencies, and download necessary binaries (like FFmpeg).
git clone https://github.com/ashishjaiswal222/img_vid_aud_check.git
cd img_vid_aud_check
On Windows:
# Open PowerShell and run:
.\setup.bat
On Linux / macOS:
bash setup.sh
(This script will create a virtual environment, install all requirements.txt dependencies safely, download FFmpeg into a local bin/ directory, and generate a .env file).
If you prefer not to use the automated scripts, you can manually configure your environment:
# 1. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use: .\venv\Scripts\activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Setup local FFmpeg
python scripts/install_ffmpeg.py
# 4. Create your environment file
cp .env.example .env # On Windows use: copy .env.example .env
.envOpen the newly created .env file in the root directory and fill in the required values (like your HuggingFace token and AWS credentials).
Do not run python main.py directly. You must start the server using the Uvicorn ASGI server.
# Ensure your virtual environment is active, then run:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
(Note: On the first boot, the server will automatically download necessary AI models like blaze_face_short_range.tflite to app/models/. This might take a few minutes).
For production, this API is designed to run in a Docker container on AWS (or any cloud provider). The Dockerfile natively handles system-level dependencies like libgl1 (for OpenCV) and ffmpeg.
docker build -t unified-ai-api .
You must pass your .env variables to the container.
docker run -d --name ai-api -p 8000:8000 --env-file .env unified-ai-api
Once the server is running, visit the interactive Swagger UI to test the endpoints:
/moderation/analyze: Video/Image moderation/moderation/audio-verify/check: Audio verification (speaker count, overlap, clarity)/moderation/photo-verify/check-single: Photo KYC validation (blur, lighting, spoofing, identity matching)Python
97.3%
This repository contains a monolithic FastAPI microservice that consolidates Video Moderation, Audio Verification, and Photo KYC Verification into a single, high-performance deployment. It utilizes multiprocessing to manage CPU-intensive AI inferences (Whisper, InsightFace, NudeNet, Pyannote, etc.) without blocking the core event loop.
We have provided simple bootstrap scripts to automatically handle your local environment, install dependencies, and download necessary binaries (like FFmpeg).
git clone https://github.com/ashishjaiswal222/img_vid_aud_check.git
cd img_vid_aud_check
On Windows:
# Open PowerShell and run:
.\setup.bat
On Linux / macOS:
bash setup.sh
(This script will create a virtual environment, install all requirements.txt dependencies safely, download FFmpeg into a local bin/ directory, and generate a .env file).
If you prefer not to use the automated scripts, you can manually configure your environment:
# 1. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use: .\venv\Scripts\activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Setup local FFmpeg
python scripts/install_ffmpeg.py
# 4. Create your environment file
cp .env.example .env # On Windows use: copy .env.example .env
.envOpen the newly created .env file in the root directory and fill in the required values (like your HuggingFace token and AWS credentials).
Do not run python main.py directly. You must start the server using the Uvicorn ASGI server.
# Ensure your virtual environment is active, then run:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
(Note: On the first boot, the server will automatically download necessary AI models like blaze_face_short_range.tflite to app/models/. This might take a few minutes).
For production, this API is designed to run in a Docker container on AWS (or any cloud provider). The Dockerfile natively handles system-level dependencies like libgl1 (for OpenCV) and ffmpeg.
docker build -t unified-ai-api .
You must pass your .env variables to the container.
docker run -d --name ai-api -p 8000:8000 --env-file .env unified-ai-api
Once the server is running, visit the interactive Swagger UI to test the endpoints:
/moderation/analyze: Video/Image moderation/moderation/audio-verify/check: Audio verification (speaker count, overlap, clarity)/moderation/photo-verify/check-single: Photo KYC validation (blur, lighting, spoofing, identity matching)Python
97.3%