Skip to main content

About the project

OnlyUncensored

Review your video before you share it.

OnlyUncensored is a video review application for identifying spoken profanity,
potential bias, product claims, and hard-to-read disclaimers. It combines local
speech transcription with AI-assisted content review and presents findings beside
the video, with timestamps and an exportable report.

Supported speech languages: Hindi, English, and Gujarati, including common
Roman spellings and mixed-language recordings.

Features

Feature What it does
Speech transcription Converts audio into timestamped text in its original language.
Bad-word detection Checks known profanity and insults in English, Devanagari, Gujarati, and common Roman spellings.
Contextual speech review Uses the existing Gemma review, when Bias or Claims is enabled, to identify abusive expressions beyond the local vocabulary.
Bias review Flags potential stereotypes and harmful framing in speech and sampled video frames.
Claims and disclaimers Extracts product claims and checks disclaimer duration and text size against configurable rules.
Interactive findings Lets reviewers jump to a timestamp, inspect context, approve findings, or mark false positives.
Early speech results Shows initial speech findings while other selected checks continue.
JSON export Exports the report, reviewer decisions, and adjusted finding score.

Recognized profanity is preserved in the transcript and highlighted rather than
censored. Uncertain speech remains visible with a label asking the reviewer to
check the audio.

Models and technology

Mode / task Default model Role
Fast content review gemma-4-26b-a4b-it Reviews sampled frames and transcript text.
Accurate content review gemma-4-31b-it Uses a deeper review configuration.
Fast transcription Whisper small Local CPU transcription with a three-beam search.
Accurate transcription Whisper medium Larger local speech model with a five-beam search.
Vocabulary matching Local Python detector Matches known words and phrases without an external AI request.

Each Gemma mode is configured to use the other model as a fallback for supported
retryable failures. API availability and quota still affect remote reviews.

  • Frontend: React 19, TypeScript, Vite 7, CSS.
  • Backend: Python, FastAPI, Uvicorn.
  • Speech: faster-whisper, CTranslate2, CPU int8 inference by default.
  • Video and audio: OpenCV and PyAV.
  • AI review: Google Gen AI SDK calling the configured Gemma models.

How it works

  1. Upload a video and select the main spoken language, mode, and checks.
  2. The backend transcribes audio locally. If visual checks are selected, it samples
    frames and reviews them in parallel with speech processing.
  3. A local vocabulary detector identifies timestamped bad-word candidates.
  4. When Bias or Claims is enabled, Gemma reviews the transcript and sampled frames.
    Contextual profanity quotes must match the transcript near the reported time.
  5. The app assembles findings, speech-quality warnings, claims, and disclaimers into
    a report for human review.

Quick setup: bad words only skips visual extraction and all Gemma reviews. It
works without a Gemini API key after the speech model is available locally.

Prerequisites

  • Python 3.12 or newer for the pinned backend dependencies; development was
    tested with Python 3.13.
  • Node.js 20.19+ or 22.12+ and npm, as required by Vite 7.
  • Git.
  • Internet access for the first Whisper model download and for Gemma API reviews.
  • A Gemini API key for Bias and Claims checks.

The medium speech model requires more memory and disk space than small. Its
first download and initial load can take longer. A GPU is optional; the default
configuration runs speech recognition on the CPU.

Run locally

The commands below use Windows PowerShell.

1. Clone the repository

git clone https://github.com/PrajwalYadav07/TeamUncensored.git
cd TeamUncensored

2. Set up the backend

cd backend
python -m venv .venv
.venv/Scripts/python.exe -m pip install -r requirements.txt
if (!(Test-Path .env)) { Copy-Item .env.example .env }

For Bias and Claims checks, edit backend/.env and set your key:

GEMINI_API_KEY=your_api_key_here

Create a key through Google AI Studio.
Keep the real .env file private; it is excluded by .gitignore.

Start the backend from the backend directory:

.venv/Scripts/python.exe -m uvicorn app.main:app --host 127.0.0.1 --port 8000

On macOS/Linux, use .venv/bin/python instead of .venv/Scripts/python.exe and
cp .env.example .env when creating a new environment file.

3. Start the frontend

In a second terminal, from the repository root:

cd frontend
npm ci
npm run dev

Open http://localhost:5173.
Vite forwards /api requests to the backend on port 8000.

Restart the backend after editing Python sources or environment settings. Keeping
automatic reload off during uploads avoids interrupting an active analysis.

Using the application

  1. Click Check a video on the intro page.
  2. Choose or drop a video file. The default upload limit is 200 MB.
  3. Choose Auto, Hindi, English, or Gujarati. An explicit language
    selection can help with difficult regional speech.
  4. Select Fast or Accurate and enable the checks you need.
  5. Click Run check and follow the progress stages.
  6. Review transcript highlights and findings, jump to timestamps, and export JSON.

Auto mode can redetect the language across decoding windows. Explicit language
selection keeps that language fixed. Transcription preserves original wording;
it does not translate speech into English.

The optional script supplies context to AI bias/claims review. It is not treated
as proof that words were spoken in the audio.

Understanding results

The finding score starts at 100 and subtracts penalties for detected findings.
It is not an accuracy percentage, a certification, or a guarantee that a video
contains no offensive speech.
Reviewer false-positive decisions adjust this score.

  • No flags detected: the analyzed content produced no findings.
  • Review findings / Fix before release / High risk: inspect the listed findings
    and their supporting evidence.
  • Review incomplete: speech was missing, uncertain, discarded, or insufficiently
    covered. No numeric score is shown.

Word timestamps are used when alignment is available. Otherwise, timestamps are
labelled as approximate segment timings. Possible profanity in uncertain speech
is shown as a candidate requiring confirmation against the audio.

Disclaimer settings are configurable product checks, not a statement of any
particular regulator’s requirements. Defaults are 2 seconds minimum display,
2.5% minimum text height, and a reading speed of 3 words per second.

Configuration

Set backend values in backend/.env and restart the backend after changes.

Variable Default / purpose
GEMINI_API_KEY API key for remote content review.
GEMINI_API_KEYS Optional comma-separated keys for quota failover.
GEMINI_API_KEY_2 through _4 Optional additional failover keys.
FAST_MODEL gemma-4-26b-a4b-it
ACCURATE_MODEL gemma-4-31b-it
FAST_FALLBACK_MODEL gemma-4-31b-it
ACCURATE_FALLBACK_MODEL gemma-4-26b-a4b-it
WHISPER_FAST_MODEL small
WHISPER_ACCURATE_MODEL medium
WHISPER_DEVICE cpu; GPU use requires compatible runtime libraries.
WHISPER_COMPUTE_TYPE int8
WHISPER_CPU_THREADS Up to 4 by default.
WHISPER_PRELOAD true; warms the Fast speech model at startup.
MAX_UPLOAD_MB 200
MAX_FRAMES 60 sampled frames maximum.
CORS_ORIGINS Additional allowed frontend origins, comma-separated.

WHISPER_MODEL remains a legacy default for direct transcription calls. The app’s
Fast and Accurate modes use their respective dedicated variables.

For a frontend hosted separately, set VITE_API_URL to the backend base URL when
building the frontend, and configure the backend’s allowed origins accordingly.

API overview

Method Endpoint Purpose
GET /api/health Reports configured models and API-key availability.
POST /api/jobs Accepts a multipart video upload and creates an analysis job.
GET /api/jobs/{job_id} Returns stage progress, early speech results, and the final report.

Upload fields include video, mode, language, check_profanity, check_bias,
check_claims, recheck, and the optional script and disclaimer settings.
See /docs for the complete request schema.

Project structure

TeamUncensored/
├── backend/
│   ├── app/
│   │   ├── main.py              # API endpoints and application startup
│   │   ├── jobs.py              # Analysis jobs and progress stages
│   │   ├── transcribe.py        # Local multilingual speech recognition
│   │   ├── profanity.py         # Vocabulary matching and grounded quote checks
│   │   ├── speech_quality.py    # Incomplete-speech assessment
│   │   ├── gemma.py             # Remote content review and API-key failover
│   │   ├── prompts.py           # Review instructions and output formats
│   │   ├── frames.py            # Video metadata and frame sampling
│   │   └── measure.py           # Findings, disclaimer checks, and scoring
│   ├── tests/
│   ├── .env.example
│   ├── requirements.txt
│   └── railway.toml
├── frontend/
│   ├── src/
│   │   ├── App.tsx              # Intro, upload, progress, and review screens
│   │   ├── styles.css
│   │   └── types.ts
│   ├── tests/
│   ├── public/
│   └── package.json
└── README.md

Tests and production build

From backend:

.venv/Scripts/python.exe -m unittest discover -s tests -v

From frontend:

npm test
npm run build

Tests cover vocabulary matching, mixed scripts, phrase timing, uncertain speech,
contextual quote grounding, scoring, API behavior, and report rendering.
The frontend build is written to frontend/dist.

Data handling and limitations

  • Audio transcription and vocabulary-only detection run locally. When Bias or
    Claims is selected, sampled frames and transcript text are sent to the configured
    Google API for Gemma review.
  • Uploaded videos are stored temporarily and deleted when the job finishes or
    fails. Temporary files may remain after an abrupt process termination.
  • Reports are kept in memory and are lost when the backend restarts. Completed
    reports older than one hour are removed when a new job is created. Export reports
    you want to keep.
  • Recognition can miss words in noisy, rapid, overlapping, accented, or censored
    speech. The vocabulary does not cover every abusive expression or spelling.
  • Visual review uses sampled frames and can miss brief text or events between them.
  • The application does not automatically bleep, mute, or edit an uploaded video.
  • The local prototype has no authentication or durable job storage. Add these
    before exposing it as a public multi-user service.

Human review of the original audio, video, and context remains necessary.

Built with

pythonjavascriptgeminigemmaclaude

AI tools

Coded withCursorCodexGemma 4 31BGemma 4 26B A4BClaude Sonnet 5.5GPT-6.1 Sol

Prize Categories Entered

  • Deepmind Google

    Best Use of Gemma 4

    Submitted