Warning
Pre-Alpha Stage Notice: This project is currently in a pre-alpha stage. No official release build is shipped yet. This project should only be used for development or testing purposes.
SafeMARC is a privacy-focused desktop application designed to automatically detect and redact Sensitive Personal Identifiable Information (SPII) and faces from images, PDFs, and digital documents.
The system will focus on reliably detecting structured sensitive data such as phone numbers, ID numbers, card numbers, and other pattern-based information, along with face detection in visual media.
For categories that require heavier linguistic or AI-based processing (e.g., name detection), the system will provide a customizable rule-based module. Users can define their own redaction rules using keywords, strings, or patterns (e.g., regex), allowing flexible and user-controlled detection without requiring complex model training.
The goal of SafeMARC is to provide a practical, efficient, and user-configurable privacy tool for securely sharing digital content, which runs directly on their system locally.
- Install Python 3.12: Make sure "Add to PATH" is checked.
- Create Virtual Environment (CRITICAL):
Open your terminal in the project folder and run:
python -m venv .venv .venv\Scripts\activate - Install Dependencies:
pip install -r requirements.txt
- Run the app:
python main.py
Tesseract OCR is required for the text extraction and OCR features of the application on all platforms, whether you run the app from Python source code, build it yourself, or run the pre-compiled standalone executable.
- Windows: Download and run the installer from the UB-Mannheim Wiki. Copy the installation path (usually
C:\Program Files\Tesseract-OCR) and add it to your system Environment Variables (PATH). - Linux:
- Fedora:
sudo dnf install tesseract - Ubuntu / Debian:
sudo apt install tesseract-ocr
- Fedora:
If you are running the pre-compiled standalone Linux executable, please note that core desktop system libraries are not bundled inside the package. Bundling them causes dynamic library ABI and symbol mismatches across different Linux distributions, resulting in segmentation faults on startup or during keyboard shortcut interactions.
Instead, the executable dynamically loads the system-native versions. While most desktop environments have these pre-installed, ensure the following libraries are installed on your host system if they are missing:
libxkbcommon&libxkbcommon-x11(keyboard and shortcut event mapping)glib2/glib-2.0(specificallylibglib-2.0,libgobject-2.0,libgio-2.0,libgthread-2.0, andlibgmodule-2.0for core desktop service bindings)dbus/libdbus(specificallylibdbus-1for system D-Bus communication and native portal integration)libz(standard compression library)
Note
These models are only required if you clone the repository and run the app from Python source code. The pre-compiled standalone binaries (executable packages) already bundle these models.
Download into assets/ directory as efficientdet_lite2.tflite:
curl -L -o assets/efficientdet_lite2.tflite "https://storage.googleapis.com/mediapipe-models/object_detector/efficientdet_lite2/float32/latest/efficientdet_lite2.tflite"Download YuNet face detection model (~228KB ONNX) into assets/:
curl -L -o assets/face_detection_yunet_2023mar.onnx "https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx"Download OpenCV's SFace deep learning model (~37MB) into assets/:
curl -L -o assets/face_recognition_sface_2021dec.onnx "https://github.com/opencv/opencv_zoo/raw/main/models/face_recognition_sface/face_recognition_sface_2021dec.onnx"Note
Without the SFace model, face identity matching falls back to LBPH (less accurate). The model is gitignored and must be downloaded separately.
SafeMARC/
├── .gitignore
├── requirements.txt
├── README.md
├── setup.py
├── main.py <-- Entry point of the application
│
├── src/
│ ├── cli/ <-- Command Line Interface logic
| | ├── cli.py
│ ├── core/ <-- OCR, Redaction, and Scanning logic
│ │ ├── detectors/ <-- Face & text detection algorithms
│ │ ├── batch_processor.py
│ │ ├── identity_manager.py <-- Face identity recognition (SFace/LBPH)
│ │ ├── redactor.py
│ │ ├── scanner.py
│ │ └── types.py
│ ├── gui/ <-- PySide6-based Graphical User Interface
│ │ ├── main_window.py <-- Main application window layout & workflows
│ │ ├── preview_widget.py <-- Interactive image preview, zoom & draw area
│ │ └── settings_dialog.py <-- Settings & Identity Manager UI
│ └── utils/ <-- Helpers (file path normalizers, conversions)
│ └── pdf_handler.py <-- PDF page extraction and rasterized rebuilding
│
├── assets/ <-- Icons, logos, UI themes, AI models
│ └── identities/ <-- Reference face images per person
├── test_data/ <-- Sample images and PDFs for testing
├── tests/ <-- Unit and integration tests
└── docs/ <-- Project and developer documentation
├── features.md <-- Project feature roadmap & status
├── shortcuts.md <-- Keyboard and mouse shortcut guide
├── ui_guidelines.md <-- Theme, colors, and layout guidelines
├── crypto.md <-- Encryption/decryption architecture & package security
└── architecture/ <-- UML, use cases, and workflow diagrams
├── uml_classes.md
├── use_cases.md
└── workflows.md