How ajai-r/sensitive_document_privacy_protection works
This repository implements sensitive-document detection and redaction, exposed through a Flask upload interface. The user selects an image, the browser submits it to the web app, and the app’s inference core classifies it and can redact Aadhaar or PAN regions using OCR and blurring. Separate scripts cover document-image preparation, augmentation, model training, standalone prediction, and evaluation. The upload endpoint’s implementation is not shown in the excerpts, so the graph does not assert its internal call sequence.
Main entry points: script.js Upload and results UI · app.py Upload web app · ml_core.py Inference core
Components 10
Web interface
- Upload and results UI
Web_app/static/script.js - Upload web app
Web_app/app.py
Image inference
- Inference core
Web_app/ml_core.py - OCR redaction
Web_app/ml_core.py
Model lifecycle
- PDF image preparation
Data_preprocessing/data_prep.py - Image augmentation
Data_preprocessing/data_generation.py - Classifier training
Model/model.py - Standalone prediction
Model/prediction.py - Classification evaluation
Outputs/metrices.py
Other components
- Document user
Connections 4
- Document user → Upload and results UI: selects image
Web_app/static/script.js - Upload and results UI → Upload web app: posts upload
Web_app/static/script.js - Upload web app → Inference core: imports inference
Web_app/app.py - Inference core → OCR redaction: redacts text
Web_app/ml_core.py