How supriya-gdptl/upload_validator works
Upload Validator is a local content-matching application: a user provides a file and description, the frontend presents the result, and the backend analyzes supported image, PDF, or video content before assigning an approval decision. The backend extracts visible or embedded text, compares it with the description using Sentence-BERT, compares visual content using CLIP when available, and combines the scores. The backend implementation was sampled; the frontend excerpt is partial, so its request wiring is not confirmed here.
Main entry points: main.py Image Analysis · UploadValidator.jsx Upload Interface · main.jsx React Entry
Components 14
Client
- Upload Interface
frontend/src/UploadValidator.jsx - React Entry
frontend/src/main.jsx - Result Display
frontend/src/UploadValidator.jsx
API
- Validation Endpoint
backend/main.py - File-Type Dispatch
backend/main.py
Content Analysis
- Image Analysis
backend/main.py - PDF Analysis
backend/main.py - Video Analysis
backend/main.py - OCR and PDF Text
backend/main.py - CLIP Matching
backend/main.py - Sentence-BERT Matching
backend/main.py
Matching Decision
- Score Combination
backend/main.py - Threshold Decision
backend/main.py
Other components
- User
Connections 21
- User → Upload Interface: provides file and description
README.md - React Entry → Upload Interface: renders
frontend/src/main.jsx - Upload Interface → Validation Endpoint: submits for analysis
- Validation Endpoint → File-Type Dispatch: routes upload
backend/main.py - File-Type Dispatch → Image Analysis: calls for images
backend/main.py - File-Type Dispatch → PDF Analysis: calls for PDFs
backend/main.py - File-Type Dispatch → Video Analysis: calls for videos
backend/main.py - Image Analysis → OCR and PDF Text: extracts text
backend/main.py - PDF Analysis → OCR and PDF Text: extracts page text
backend/main.py - Video Analysis → OCR and PDF Text: OCRs sampled frames
backend/main.py - Image Analysis → CLIP Matching: compares image
backend/main.py - PDF Analysis → CLIP Matching: compares page renders
backend/main.py - Video Analysis → CLIP Matching: compares keyframes
backend/main.py - Image Analysis → Sentence-BERT Matching: compares extracted text
backend/main.py - PDF Analysis → Sentence-BERT Matching: compares extracted text
backend/main.py - Video Analysis → Sentence-BERT Matching: compares OCR text
backend/main.py - Image Analysis → Score Combination: combines similarities
backend/main.py - PDF Analysis → Score Combination: combines similarities
backend/main.py - Video Analysis → Score Combination: combines similarities
backend/main.py - Validation Endpoint → Threshold Decision: applies thresholds
backend/main.py - Threshold Decision → Result Display: returns decision and score