privision


Nameprivision JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
Summary视频内容脱敏工具 - 基于OCR的信息识别与打码系统
upload_time2025-10-07 17:32:48
maintainerNone
docs_urlNone
author0xyk3r
requires_python>=3.8
licenseMIT
keywords privision video ocr phone-number mask blur privacy
VCS
bugtrack_url
requirements paddleocr paddlepaddle opencv-python numpy Pillow rich fastapi uvicorn python-multipart pydantic
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Privision - Video Content Privacy Masking Tool

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)

> **Universal Video Content Privacy Solution** - Intelligent Information Recognition and Masking System Based on OCR

> [中文文档](README_zh.md) | English

Privision is a powerful video content privacy masking tool that uses advanced OCR technology to automatically identify and mask sensitive information in videos. It supports multiple detection modes including **phone numbers, ID card numbers, and custom keywords**, and provides three usage methods: command-line interface, batch processing, and RESTful API.

## 🌟 Key Features

### 🎯 Multi-Scenario Detection Support

- **📱 Phone Number Detection**: Accurately identifies 11-digit Chinese mainland phone numbers with smart false-positive filtering
- **🆔 ID Card Number Detection**: Recognizes 18-digit Chinese mainland ID card numbers with basic validity verification
- **🔑 Keyword Detection**: Custom keyword lists for flexible detection of any sensitive terms
- **🔌 Extensible Architecture**: Factory pattern design for easy addition of new detector types

### ⚡ High-Performance Processing

- **🚀 Dual Processing Modes**:
  - **Frame-by-Frame Mode**: Precise recognition for high-accuracy scenarios
  - **Smart Sampling Mode**: 10-30x speed improvement for most scenarios
- **💎 GPU Acceleration**: CUDA support for significantly improved processing speed
- **🎯 Precise Positioning**: Iterative optimization algorithm ensuring only target content is masked, avoiding false positives

### 🎨 Flexible Masking Methods

- **Gaussian Blur**: Natural and smooth blur effect
- **Pixelate**: Classic mosaic effect
- **Black Mask**: Complete coverage for strong protection

### 🛠 Multiple Usage Methods

- **Command-Line Tool**: Simple and easy to use for single video processing
- **Batch Processing**: Directory-level batch processing with recursive subdirectory support
- **RESTful API**: Complete HTTP API with asynchronous task queue
- **Visual Debugging**: Real-time preview of detection results and masking effects

## 📋 Table of Contents

- [Quick Start](#-quick-start)
- [Installation](#-installation)
- [Usage Guide](#-usage-guide)
  - [Command-Line Tool](#1-command-line-tool)
  - [Batch Processing](#2-batch-processing)
  - [API Service](#3-api-service)
- [Detector Documentation](#-detector-documentation)
- [Project Architecture](#-project-architecture)
- [Performance Optimization](#-performance-optimization)
- [FAQ](#-faq)

## ⚡ Quick Start

### For Users (Recommended)

```bash
# Install from PyPI
pip install privision

# Verify installation
privision --help
```

> For GPU acceleration, please refer to the [GPU Acceleration Installation](#gpu-acceleration-installation) section

### Basic Usage

```bash
# 1. Detect and mask phone numbers
privision input.mp4 output.mp4

# 2. Detect ID card numbers
privision input.mp4 output.mp4 --detector idcard

# 3. Detect custom keywords
privision input.mp4 output.mp4 --detector keyword --keywords password account name

# 4. Smart sampling mode (fast)
privision input.mp4 output.mp4 --mode smart

# 5. GPU acceleration
privision input.mp4 output.mp4 --device gpu:0 --mode smart
```

## 🚀 Installation

### System Requirements

- Python 3.8+
- pip
- (Optional) NVIDIA GPU + CUDA Toolkit

### For Users: Install from PyPI

**Install the latest stable version:**

```bash
# Install from PyPI
pip install privision

# Verify installation
privision --help
```

After installation, you can directly use the following commands:
- `privision` - Single video processing
- `privision-batch` - Batch processing
- `privision-server` - API server

**Basic usage example:**
```bash
# Detect and mask phone numbers
privision input.mp4 output.mp4

# Smart sampling mode (10-30x faster)
privision input.mp4 output.mp4 --mode smart
```

### For Developers: Install from Source

#### Method 1: Development Mode Installation (Recommended)

```bash
# Clone the repository
git clone https://github.com/0xyk3r/Privision.git
cd Privision

# Install in development mode
pip install -e .

# Verify installation
privision --help
```

After installation, you can directly use the following commands:
- `privision` - Single video processing
- `privision-batch` - Batch processing
- `privision-server` - API server

#### Method 2: Install Dependencies Only

```bash
# Clone the repository
git clone https://github.com/0xyk3r/Privision.git
cd Privision

# Install dependencies only
pip install -r requirements.txt
```

> With this method, run the program using `python -m privision.main`

### GPU Acceleration Installation

**Check CUDA Version**:
```bash
nvidia-smi  # Check "CUDA Version: xx.x" in the upper right corner
```

**Install GPU Dependencies**:

```bash
# Install common dependencies first
pip install -r requirements.txt

# Choose installation based on CUDA version
# CUDA 11.8
python -m pip install paddlepaddle-gpu==3.2.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/

# CUDA 12.6
python -m pip install paddlepaddle-gpu==3.2.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/

# CUDA 12.9
python -m pip install paddlepaddle-gpu==3.2.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu129/
```

**Verify GPU Installation**:
```bash
python -c "import paddle; print('GPU available:', paddle.device.is_compiled_with_cuda())"
```

### Core Dependencies

- `paddlepaddle` >= 3.0.0 - Deep learning framework
- `paddleocr` >= 3.0.0 - OCR recognition engine
- `opencv-python` >= 4.8.0 - Video processing
- `numpy` >= 1.24.0 - Numerical computing
- `fastapi` >= 0.104.0 - API framework
- `rich` >= 13.0.0 - Terminal beautification

## 📖 Usage Guide

### 1. Command-Line Tool

#### Basic Usage

```bash
# Detect phone numbers (default)
privision input.mp4 output.mp4

# Detect ID card numbers
privision input.mp4 output.mp4 --detector idcard

# Detect custom keywords
privision input.mp4 output.mp4 --detector keyword --keywords password account username

# Smart sampling mode (recommended)
privision input.mp4 output.mp4 --mode smart

# GPU acceleration
privision input.mp4 output.mp4 --device gpu:0
```

#### Advanced Options

**Choose Masking Method**:
```bash
# Gaussian blur (default)
privision input.mp4 output.mp4 --blur-method gaussian

# Pixelate (mosaic)
privision input.mp4 output.mp4 --blur-method pixelate

# Black mask
privision input.mp4 output.mp4 --blur-method black
```

**Precise Location Mode**:
```bash
# Enable precise location to avoid masking irrelevant content
privision input.mp4 output.mp4 --precise-location
```

**Visual Debugging**:
```bash
# Show real-time processing window
privision input.mp4 output.mp4 --visualize
```

#### Complete Parameters

```
Positional Arguments:
  input                         Input video file path
  output                        Output video file path

Detector Settings:
  --detector {phone,keyword,idcard}
                                Detector type [default: phone]
                                  phone   - Phone number detection
                                  keyword - Keyword detection
                                  idcard  - ID card number detection

  --keywords WORD [WORD ...]    Keyword list (keyword detector only)
  --case-sensitive              Keywords are case-sensitive (keyword detector only)

Processing Mode:
  --mode {frame-by-frame,smart}
                                Processing mode [default: frame-by-frame]
                                  frame-by-frame - Frame-by-frame processing
                                  smart          - Smart sampling

Masking Settings:
  --blur-method {gaussian,pixelate,black}
                                Masking method [default: gaussian]
  --blur-strength INT           Blur strength (must be odd) [default: 51]

Device Settings:
  --device DEVICE               Computing device (cpu, gpu:0, gpu:1, ...) [default: cpu]

Sampling Settings (smart mode only):
  --sample-interval FLOAT       Sampling interval (seconds) [default: 1.0]
  --buffer-time FLOAT           Buffer time (seconds)

Precise Location:
  --precise-location            Enable precise location mode
  --precise-max-iterations INT  Maximum iterations [default: 3]

Interface Settings:
  --visualize                   Enable visualization window
  --no-rich                     Disable Rich UI

Other:
  -h, --help                    Show help message
```

### 2. Batch Processing

Use the `privision-batch` command to batch process all videos in a directory.

#### Basic Usage

```bash
# Batch process directory
privision-batch input_dir/ output_dir/

# Process subdirectories recursively
privision-batch input_dir/ output_dir/ --recursive

# Use ID card detector for batch processing
privision-batch input_dir/ output_dir/ --detector idcard

# Smart mode + GPU acceleration
privision-batch input_dir/ output_dir/ --mode smart --device gpu:0
```

#### Parameters

```
Positional Arguments:
  input_dir                     Input video directory
  output_dir                    Output video directory

Detector Settings:
  --detector {phone,keyword,idcard}
                                Detector type [default: phone]
  --keywords WORD [WORD ...]    Keyword list (keyword detector only)
  --case-sensitive              Keywords are case-sensitive

Optional Arguments:
  --blur-method {gaussian,pixelate,black}
                                Masking method [default: gaussian]
  --device DEVICE               Computing device [default: cpu]
  --mode {frame-by-frame,smart}
                                Processing mode [default: frame-by-frame]
  --recursive                   Process subdirectories recursively
  --output-suffix SUFFIX        Output file suffix [default: _masked]
```

Supported video formats: `.mp4`, `.avi`, `.mov`, `.mkv`, `.flv`, `.wmv`, `.webm`

### 3. API Service

Use `privision-server` to start the FastAPI server, providing RESTful API endpoints.

#### Start Server

```bash
# Start with default configuration
privision-server

# Custom port
privision-server --port 9000

# Custom data directory
privision-server --data-dir /path/to/data
```

After server starts:
- API Service: http://localhost:8000
- Interactive Docs: http://localhost:8000/docs
- API Documentation: http://localhost:8000/redoc

#### API Endpoints

**1. Create Task**

`POST /api/tasks`

```bash
curl -X POST "http://localhost:8000/api/tasks" \
  -F "file=@test.mp4" \
  -F "detector_type=phone" \
  -F "blur_method=gaussian" \
  -F "device=cpu"
```

Supported parameters:
- `file`: Video file to process (required)
- `detector_type`: Detector type (phone/keyword/idcard)
- `keywords`: Keyword list (keyword detector only)
- `case_sensitive`: Case-sensitive (keyword detector only)
- `blur_method`: Masking method (gaussian/pixelate/black)
- `blur_strength`: Blur strength (Gaussian blur only, odd number, default 51)
- `device`: Computing device (cpu, gpu:0, gpu:1, etc.)
- `sample_interval`: Sampling interval (seconds)
- `buffer_time`: Buffer time (seconds)
- `precise_location`: Enable precise location
- `precise_max_iterations`: Maximum iterations for precise location (default 3)

Response:
```json
{
  "task_id": "550e8400-e29b-41d4-a716-446655440000",
  "message": "Task created successfully"
}
```

**2. Query Task Progress**

`GET /api/tasks/{task_id}`

```bash
curl "http://localhost:8000/api/tasks/{task_id}"
```

**3. Download Result**

`GET /api/tasks/{task_id}/download`

```bash
curl -O -J "http://localhost:8000/api/tasks/{task_id}/download"
```

**4. Get Task List**

`GET /api/tasks?status={status}&limit={limit}`

Supported parameters:
- `status` (optional): Filter by status (pending/processing/completed/failed)
- `limit` (optional): Maximum number of tasks to return, default 100

**5. Delete Task**

`DELETE /api/tasks/{task_id}`

#### Python Client Example

```python
import requests
import time

API_BASE = "http://localhost:8000"

# 1. Upload video
with open("test.mp4", "rb") as f:
    files = {"file": f}
    data = {
        "detector_type": "phone",
        "blur_method": "gaussian",
        "device": "cpu"
    }
    response = requests.post(f"{API_BASE}/api/tasks", files=files, data=data)
    task_id = response.json()["task_id"]

# 2. Poll for progress
while True:
    response = requests.get(f"{API_BASE}/api/tasks/{task_id}")
    status = response.json()

    if status['status'] == 'completed':
        break
    time.sleep(2)

# 3. Download result
response = requests.get(f"{API_BASE}/api/tasks/{task_id}/download")
with open("output.mp4", "wb") as f:
    f.write(response.content)
```

## 🎯 Detector Documentation

### 1. Phone Number Detector (phone)

**Function**: Identifies 11-digit Chinese mainland phone numbers

**Features**:
- Regex matching: `1[3-9]\d{9}`
- Smart filtering of long digit strings and false positives
- Context validation to avoid misidentification

**Usage**:
```bash
privision input.mp4 output.mp4 --detector phone
```

### 2. ID Card Number Detector (idcard)

**Function**: Identifies 18-digit Chinese mainland ID card numbers

**Features**:
- Regex matching: `\d{17}[\dXx]`
- Date validity verification
- Excludes invalid numbers

**Usage**:
```bash
privision input.mp4 output.mp4 --detector idcard
```

### 3. Keyword Detector (keyword)

**Function**: Detects custom keywords

**Features**:
- Custom keyword list support
- Chinese and English mixed support
- Optional case sensitivity
- Smart boundary matching

**Usage**:
```bash
# Default keywords (password, account, username, etc.)
privision input.mp4 output.mp4 --detector keyword

# Custom keywords
privision input.mp4 output.mp4 --detector keyword --keywords name phone address

# Case-sensitive
privision input.mp4 output.mp4 --detector keyword --keywords Password --case-sensitive
```

### Extending Custom Detectors

The project uses factory pattern design for easy extension of new detectors:

1. Inherit from `BaseDetector` base class
2. Implement required abstract methods
3. Register in `DetectorFactory`

See `src/privision/core/detector_base.py` and `src/privision/core/detector_factory.py` for details

## 🏗 Project Architecture

### Directory Structure

```
Privision/
├── src/                          # Source code
├── ├── privision/                # Main package
│   │  ├── main.py                   # CLI entry point
│   │  ├── batch.py                  # Batch processing entry
│   │  ├── server.py                 # API server entry
│   │  │
│   │  ├── core/                     # Core functionality
│   │  │   ├── video_processor.py   # Video processor (frame-by-frame/smart)
│   │  │   ├── ocr_detector.py      # OCR detection
│   │  │   ├── detector_base.py     # Detector base class
│   │  │   ├── detector_factory.py  # Detector factory
│   │  │   ├── detectors/           # Detector implementations
│   │  │   │   ├── phone_detector.py
│   │  │   │   ├── idcard_detector.py
│   │  │   │   └── keyword_detector.py
│   │  │   ├── precise_locator.py   # Precise location
│   │  │   ├── blur.py              # Masking effects
│   │  │   └── bbox_calculator.py   # Bounding box calculation
│   │  │
│   │  ├── api/                      # API service
│   │  │   └── task_queue.py        # Task queue management
│   │  │
│   │  ├── ui/                       # User interface
│   │  │   ├── rich_ui.py           # Rich terminal UI
│   │  │   ├── progress.py          # Progress callback interface
│   │  │   └── visualizer.py        # Visualization window
│   │  │
│   │  ├── config/                   # Configuration management
│   │  │   └── args.py              # Argument parsing
│   │  │
│   │  └── test/                     # Test modules
│
├── pyproject.toml                # Project configuration
├── requirements.txt              # Dependency list
├── README.md                     # This document
```

### Core Modules

#### Detector Architecture

```
BaseDetector (Abstract Base Class)
    ├── PhoneDetector (Phone numbers)
    ├── IDCardDetector (ID card numbers)
    └── KeywordDetector (Keywords)

DetectorFactory (Factory)
    └── create_detector()
```

#### Processing Flow

**Frame-by-Frame Mode**:
```
Video Input → Frame-by-Frame Read → OCR → Detector → Precise Location (optional) → Mask → Output
```

**Smart Sampling Mode**:
```
Video Input → Periodic Sampling → OCR → Detector → Record Areas → Batch Mask → Output
```

### Technology Stack

- **PaddleOCR**: Text detection and recognition
- **OpenCV**: Video processing and masking
- **FastAPI**: RESTful API framework
- **Rich**: Terminal beautification
- **NumPy**: Numerical computing

## 🚀 Performance Optimization

### Recommended Configuration

**1. Use GPU Acceleration**
```bash
privision input.mp4 output.mp4 --device gpu:0
```
GPU can improve OCR speed by 3-10x

**2. Use Smart Sampling Mode**
```bash
privision input.mp4 output.mp4 --mode smart
```
Speed improvement of 10-30x, suitable for most scenarios

**3. Adjust Sampling Interval**
```bash
# Static scenes (phone number position changes slowly)
privision input.mp4 output.mp4 --mode smart --sample-interval 2.0

# Dynamic scenes (phone number position changes quickly)
privision input.mp4 output.mp4 --mode smart --sample-interval 0.5
```

**4. Video Preprocessing**
- Ultra-high resolution videos should be downscaled first
- Use H.264 encoding for faster processing

**5. API Concurrent Processing**

Modify the `max_workers` parameter in `src/privision/api/task_queue.py`:
```python
get_task_queue(storage_dir=TASKS_DIR, max_workers=2)  # Increase concurrency
```

## 🔧 FAQ

### Q1: How to verify GPU availability?

```bash
# Check CUDA
nvidia-smi

# Check PaddlePaddle GPU support
python -c "import paddle; print('GPU available:', paddle.device.is_compiled_with_cuda())"
```

### Q2: Why can't I directly run `python privision/main.py`?

Because import statements use the `privision.xxx` format, Python needs to import `privision` as a package.

**Solutions**:
- Run using `python -m privision.main`
- Or install using `pip install -e .` and directly use the `privision` command

### Q3: Why is the first run slow?

The first run automatically downloads PaddleOCR model files (about 100-200 MB), requiring network connection. After downloading, files are cached locally.

### Q4: How to improve recognition accuracy?

1. Ensure video clarity is sufficient
2. Use frame-by-frame mode instead of smart sampling
3. Enable precise location mode: `--precise-location`
4. Complex fonts or backgrounds affect OCR performance

### Q5: How to add new detectors?

1. Create a new detector class in `src/privision/core/detectors/`
2. Inherit from `BaseDetector` and implement required methods
3. Register in `DetectorFactory._detectors`
4. Update command-line arguments and documentation

### Q6: What video formats are supported?

Supports all formats supported by OpenCV: `.mp4`, `.avi`, `.mov`, `.mkv`, `.flv`, `.wmv`, `.webm`

Output format currently only supports MP4.

### Q7: How to deploy API service in production?

1. Use reverse proxy (such as Nginx)
2. Configure HTTPS
3. Modify CORS settings (in `src/privision/server.py`)
4. Use process management tools (such as systemd, supervisor)
5. Configure logging and monitoring

## 🛠 Development Guide

### Development Environment Setup

```bash
# Clone repository
git clone https://github.com/0xyk3r/Privision.git
cd Privision

# Install development dependencies
pip install -e ".[dev]"
```

### Run Tests

```bash
# Run all tests
pytest src/privision/test/

# Run specific tests
python -m privision.test.test_phone_filter
python -m privision.test.test_ocr_and_detector
```

### Code Structure Design

- **Separation of Concerns**: Core functionality, API, UI, and configuration are independently modularized
- **Configuration-Driven**: Use `ProcessConfig` for unified configuration management
- **Interface Abstraction**: `ProgressCallback` interface decouples business logic from UI
- **Factory Pattern**: `DetectorFactory` manages detector creation
- **Extensibility**: Easy to add new detectors, masking methods, and UIs

### Contributing

Issues and Pull Requests are welcome!

1. Fork the project
2. Create a feature branch (`git checkout -b feature/YourFeature`)
3. Commit changes (`git commit -m 'Add some YourFeature'`)
4. Push to branch (`git push origin feature/YourFeature`)
5. Open a Pull Request

## 📄 License

This project is licensed under the [MIT License](LICENSE).

## 🙏 Acknowledgments

- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) - OCR toolkit
- [OpenCV](https://opencv.org/) - Computer vision library
- [FastAPI](https://fastapi.tiangolo.com/) - Modern web framework
- [Rich](https://github.com/Textualize/rich) - Terminal beautification library

## 📧 Contact

- Author: 0xyk3r
- GitHub: [https://github.com/0xyk3r/Privision](https://github.com/0xyk3r/Privision)
- Issues: [https://github.com/0xyk3r/Privision/issues](https://github.com/0xyk3r/Privision/issues)

---

**Note**: This tool is only for legal privacy protection purposes and should not be used for illegal purposes. Users are responsible for any legal liability related to videos processed with this tool.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "privision",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "privision, video, ocr, phone-number, mask, blur, privacy",
    "author": "0xyk3r",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/fb/83/42afc5bd01494b0d58c9efc942895353a03ffb85a49e8d168dab0c5dab74/privision-1.0.1.tar.gz",
    "platform": null,
    "description": "# Privision - Video Content Privacy Masking Tool\r\n\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\r\n\r\n> **Universal Video Content Privacy Solution** - Intelligent Information Recognition and Masking System Based on OCR\r\n\r\n> [\u4e2d\u6587\u6587\u6863](README_zh.md) | English\r\n\r\nPrivision is a powerful video content privacy masking tool that uses advanced OCR technology to automatically identify and mask sensitive information in videos. It supports multiple detection modes including **phone numbers, ID card numbers, and custom keywords**, and provides three usage methods: command-line interface, batch processing, and RESTful API.\r\n\r\n## \ud83c\udf1f Key Features\r\n\r\n### \ud83c\udfaf Multi-Scenario Detection Support\r\n\r\n- **\ud83d\udcf1 Phone Number Detection**: Accurately identifies 11-digit Chinese mainland phone numbers with smart false-positive filtering\r\n- **\ud83c\udd94 ID Card Number Detection**: Recognizes 18-digit Chinese mainland ID card numbers with basic validity verification\r\n- **\ud83d\udd11 Keyword Detection**: Custom keyword lists for flexible detection of any sensitive terms\r\n- **\ud83d\udd0c Extensible Architecture**: Factory pattern design for easy addition of new detector types\r\n\r\n### \u26a1 High-Performance Processing\r\n\r\n- **\ud83d\ude80 Dual Processing Modes**:\r\n  - **Frame-by-Frame Mode**: Precise recognition for high-accuracy scenarios\r\n  - **Smart Sampling Mode**: 10-30x speed improvement for most scenarios\r\n- **\ud83d\udc8e GPU Acceleration**: CUDA support for significantly improved processing speed\r\n- **\ud83c\udfaf Precise Positioning**: Iterative optimization algorithm ensuring only target content is masked, avoiding false positives\r\n\r\n### \ud83c\udfa8 Flexible Masking Methods\r\n\r\n- **Gaussian Blur**: Natural and smooth blur effect\r\n- **Pixelate**: Classic mosaic effect\r\n- **Black Mask**: Complete coverage for strong protection\r\n\r\n### \ud83d\udee0 Multiple Usage Methods\r\n\r\n- **Command-Line Tool**: Simple and easy to use for single video processing\r\n- **Batch Processing**: Directory-level batch processing with recursive subdirectory support\r\n- **RESTful API**: Complete HTTP API with asynchronous task queue\r\n- **Visual Debugging**: Real-time preview of detection results and masking effects\r\n\r\n## \ud83d\udccb Table of Contents\r\n\r\n- [Quick Start](#-quick-start)\r\n- [Installation](#-installation)\r\n- [Usage Guide](#-usage-guide)\r\n  - [Command-Line Tool](#1-command-line-tool)\r\n  - [Batch Processing](#2-batch-processing)\r\n  - [API Service](#3-api-service)\r\n- [Detector Documentation](#-detector-documentation)\r\n- [Project Architecture](#-project-architecture)\r\n- [Performance Optimization](#-performance-optimization)\r\n- [FAQ](#-faq)\r\n\r\n## \u26a1 Quick Start\r\n\r\n### For Users (Recommended)\r\n\r\n```bash\r\n# Install from PyPI\r\npip install privision\r\n\r\n# Verify installation\r\nprivision --help\r\n```\r\n\r\n> For GPU acceleration, please refer to the [GPU Acceleration Installation](#gpu-acceleration-installation) section\r\n\r\n### Basic Usage\r\n\r\n```bash\r\n# 1. Detect and mask phone numbers\r\nprivision input.mp4 output.mp4\r\n\r\n# 2. Detect ID card numbers\r\nprivision input.mp4 output.mp4 --detector idcard\r\n\r\n# 3. Detect custom keywords\r\nprivision input.mp4 output.mp4 --detector keyword --keywords password account name\r\n\r\n# 4. Smart sampling mode (fast)\r\nprivision input.mp4 output.mp4 --mode smart\r\n\r\n# 5. GPU acceleration\r\nprivision input.mp4 output.mp4 --device gpu:0 --mode smart\r\n```\r\n\r\n## \ud83d\ude80 Installation\r\n\r\n### System Requirements\r\n\r\n- Python 3.8+\r\n- pip\r\n- (Optional) NVIDIA GPU + CUDA Toolkit\r\n\r\n### For Users: Install from PyPI\r\n\r\n**Install the latest stable version:**\r\n\r\n```bash\r\n# Install from PyPI\r\npip install privision\r\n\r\n# Verify installation\r\nprivision --help\r\n```\r\n\r\nAfter installation, you can directly use the following commands:\r\n- `privision` - Single video processing\r\n- `privision-batch` - Batch processing\r\n- `privision-server` - API server\r\n\r\n**Basic usage example:**\r\n```bash\r\n# Detect and mask phone numbers\r\nprivision input.mp4 output.mp4\r\n\r\n# Smart sampling mode (10-30x faster)\r\nprivision input.mp4 output.mp4 --mode smart\r\n```\r\n\r\n### For Developers: Install from Source\r\n\r\n#### Method 1: Development Mode Installation (Recommended)\r\n\r\n```bash\r\n# Clone the repository\r\ngit clone https://github.com/0xyk3r/Privision.git\r\ncd Privision\r\n\r\n# Install in development mode\r\npip install -e .\r\n\r\n# Verify installation\r\nprivision --help\r\n```\r\n\r\nAfter installation, you can directly use the following commands:\r\n- `privision` - Single video processing\r\n- `privision-batch` - Batch processing\r\n- `privision-server` - API server\r\n\r\n#### Method 2: Install Dependencies Only\r\n\r\n```bash\r\n# Clone the repository\r\ngit clone https://github.com/0xyk3r/Privision.git\r\ncd Privision\r\n\r\n# Install dependencies only\r\npip install -r requirements.txt\r\n```\r\n\r\n> With this method, run the program using `python -m privision.main`\r\n\r\n### GPU Acceleration Installation\r\n\r\n**Check CUDA Version**:\r\n```bash\r\nnvidia-smi  # Check \"CUDA Version: xx.x\" in the upper right corner\r\n```\r\n\r\n**Install GPU Dependencies**:\r\n\r\n```bash\r\n# Install common dependencies first\r\npip install -r requirements.txt\r\n\r\n# Choose installation based on CUDA version\r\n# CUDA 11.8\r\npython -m pip install paddlepaddle-gpu==3.2.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/\r\n\r\n# CUDA 12.6\r\npython -m pip install paddlepaddle-gpu==3.2.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/\r\n\r\n# CUDA 12.9\r\npython -m pip install paddlepaddle-gpu==3.2.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu129/\r\n```\r\n\r\n**Verify GPU Installation**:\r\n```bash\r\npython -c \"import paddle; print('GPU available:', paddle.device.is_compiled_with_cuda())\"\r\n```\r\n\r\n### Core Dependencies\r\n\r\n- `paddlepaddle` >= 3.0.0 - Deep learning framework\r\n- `paddleocr` >= 3.0.0 - OCR recognition engine\r\n- `opencv-python` >= 4.8.0 - Video processing\r\n- `numpy` >= 1.24.0 - Numerical computing\r\n- `fastapi` >= 0.104.0 - API framework\r\n- `rich` >= 13.0.0 - Terminal beautification\r\n\r\n## \ud83d\udcd6 Usage Guide\r\n\r\n### 1. Command-Line Tool\r\n\r\n#### Basic Usage\r\n\r\n```bash\r\n# Detect phone numbers (default)\r\nprivision input.mp4 output.mp4\r\n\r\n# Detect ID card numbers\r\nprivision input.mp4 output.mp4 --detector idcard\r\n\r\n# Detect custom keywords\r\nprivision input.mp4 output.mp4 --detector keyword --keywords password account username\r\n\r\n# Smart sampling mode (recommended)\r\nprivision input.mp4 output.mp4 --mode smart\r\n\r\n# GPU acceleration\r\nprivision input.mp4 output.mp4 --device gpu:0\r\n```\r\n\r\n#### Advanced Options\r\n\r\n**Choose Masking Method**:\r\n```bash\r\n# Gaussian blur (default)\r\nprivision input.mp4 output.mp4 --blur-method gaussian\r\n\r\n# Pixelate (mosaic)\r\nprivision input.mp4 output.mp4 --blur-method pixelate\r\n\r\n# Black mask\r\nprivision input.mp4 output.mp4 --blur-method black\r\n```\r\n\r\n**Precise Location Mode**:\r\n```bash\r\n# Enable precise location to avoid masking irrelevant content\r\nprivision input.mp4 output.mp4 --precise-location\r\n```\r\n\r\n**Visual Debugging**:\r\n```bash\r\n# Show real-time processing window\r\nprivision input.mp4 output.mp4 --visualize\r\n```\r\n\r\n#### Complete Parameters\r\n\r\n```\r\nPositional Arguments:\r\n  input                         Input video file path\r\n  output                        Output video file path\r\n\r\nDetector Settings:\r\n  --detector {phone,keyword,idcard}\r\n                                Detector type [default: phone]\r\n                                  phone   - Phone number detection\r\n                                  keyword - Keyword detection\r\n                                  idcard  - ID card number detection\r\n\r\n  --keywords WORD [WORD ...]    Keyword list (keyword detector only)\r\n  --case-sensitive              Keywords are case-sensitive (keyword detector only)\r\n\r\nProcessing Mode:\r\n  --mode {frame-by-frame,smart}\r\n                                Processing mode [default: frame-by-frame]\r\n                                  frame-by-frame - Frame-by-frame processing\r\n                                  smart          - Smart sampling\r\n\r\nMasking Settings:\r\n  --blur-method {gaussian,pixelate,black}\r\n                                Masking method [default: gaussian]\r\n  --blur-strength INT           Blur strength (must be odd) [default: 51]\r\n\r\nDevice Settings:\r\n  --device DEVICE               Computing device (cpu, gpu:0, gpu:1, ...) [default: cpu]\r\n\r\nSampling Settings (smart mode only):\r\n  --sample-interval FLOAT       Sampling interval (seconds) [default: 1.0]\r\n  --buffer-time FLOAT           Buffer time (seconds)\r\n\r\nPrecise Location:\r\n  --precise-location            Enable precise location mode\r\n  --precise-max-iterations INT  Maximum iterations [default: 3]\r\n\r\nInterface Settings:\r\n  --visualize                   Enable visualization window\r\n  --no-rich                     Disable Rich UI\r\n\r\nOther:\r\n  -h, --help                    Show help message\r\n```\r\n\r\n### 2. Batch Processing\r\n\r\nUse the `privision-batch` command to batch process all videos in a directory.\r\n\r\n#### Basic Usage\r\n\r\n```bash\r\n# Batch process directory\r\nprivision-batch input_dir/ output_dir/\r\n\r\n# Process subdirectories recursively\r\nprivision-batch input_dir/ output_dir/ --recursive\r\n\r\n# Use ID card detector for batch processing\r\nprivision-batch input_dir/ output_dir/ --detector idcard\r\n\r\n# Smart mode + GPU acceleration\r\nprivision-batch input_dir/ output_dir/ --mode smart --device gpu:0\r\n```\r\n\r\n#### Parameters\r\n\r\n```\r\nPositional Arguments:\r\n  input_dir                     Input video directory\r\n  output_dir                    Output video directory\r\n\r\nDetector Settings:\r\n  --detector {phone,keyword,idcard}\r\n                                Detector type [default: phone]\r\n  --keywords WORD [WORD ...]    Keyword list (keyword detector only)\r\n  --case-sensitive              Keywords are case-sensitive\r\n\r\nOptional Arguments:\r\n  --blur-method {gaussian,pixelate,black}\r\n                                Masking method [default: gaussian]\r\n  --device DEVICE               Computing device [default: cpu]\r\n  --mode {frame-by-frame,smart}\r\n                                Processing mode [default: frame-by-frame]\r\n  --recursive                   Process subdirectories recursively\r\n  --output-suffix SUFFIX        Output file suffix [default: _masked]\r\n```\r\n\r\nSupported video formats: `.mp4`, `.avi`, `.mov`, `.mkv`, `.flv`, `.wmv`, `.webm`\r\n\r\n### 3. API Service\r\n\r\nUse `privision-server` to start the FastAPI server, providing RESTful API endpoints.\r\n\r\n#### Start Server\r\n\r\n```bash\r\n# Start with default configuration\r\nprivision-server\r\n\r\n# Custom port\r\nprivision-server --port 9000\r\n\r\n# Custom data directory\r\nprivision-server --data-dir /path/to/data\r\n```\r\n\r\nAfter server starts:\r\n- API Service: http://localhost:8000\r\n- Interactive Docs: http://localhost:8000/docs\r\n- API Documentation: http://localhost:8000/redoc\r\n\r\n#### API Endpoints\r\n\r\n**1. Create Task**\r\n\r\n`POST /api/tasks`\r\n\r\n```bash\r\ncurl -X POST \"http://localhost:8000/api/tasks\" \\\r\n  -F \"file=@test.mp4\" \\\r\n  -F \"detector_type=phone\" \\\r\n  -F \"blur_method=gaussian\" \\\r\n  -F \"device=cpu\"\r\n```\r\n\r\nSupported parameters:\r\n- `file`: Video file to process (required)\r\n- `detector_type`: Detector type (phone/keyword/idcard)\r\n- `keywords`: Keyword list (keyword detector only)\r\n- `case_sensitive`: Case-sensitive (keyword detector only)\r\n- `blur_method`: Masking method (gaussian/pixelate/black)\r\n- `blur_strength`: Blur strength (Gaussian blur only, odd number, default 51)\r\n- `device`: Computing device (cpu, gpu:0, gpu:1, etc.)\r\n- `sample_interval`: Sampling interval (seconds)\r\n- `buffer_time`: Buffer time (seconds)\r\n- `precise_location`: Enable precise location\r\n- `precise_max_iterations`: Maximum iterations for precise location (default 3)\r\n\r\nResponse:\r\n```json\r\n{\r\n  \"task_id\": \"550e8400-e29b-41d4-a716-446655440000\",\r\n  \"message\": \"Task created successfully\"\r\n}\r\n```\r\n\r\n**2. Query Task Progress**\r\n\r\n`GET /api/tasks/{task_id}`\r\n\r\n```bash\r\ncurl \"http://localhost:8000/api/tasks/{task_id}\"\r\n```\r\n\r\n**3. Download Result**\r\n\r\n`GET /api/tasks/{task_id}/download`\r\n\r\n```bash\r\ncurl -O -J \"http://localhost:8000/api/tasks/{task_id}/download\"\r\n```\r\n\r\n**4. Get Task List**\r\n\r\n`GET /api/tasks?status={status}&limit={limit}`\r\n\r\nSupported parameters:\r\n- `status` (optional): Filter by status (pending/processing/completed/failed)\r\n- `limit` (optional): Maximum number of tasks to return, default 100\r\n\r\n**5. Delete Task**\r\n\r\n`DELETE /api/tasks/{task_id}`\r\n\r\n#### Python Client Example\r\n\r\n```python\r\nimport requests\r\nimport time\r\n\r\nAPI_BASE = \"http://localhost:8000\"\r\n\r\n# 1. Upload video\r\nwith open(\"test.mp4\", \"rb\") as f:\r\n    files = {\"file\": f}\r\n    data = {\r\n        \"detector_type\": \"phone\",\r\n        \"blur_method\": \"gaussian\",\r\n        \"device\": \"cpu\"\r\n    }\r\n    response = requests.post(f\"{API_BASE}/api/tasks\", files=files, data=data)\r\n    task_id = response.json()[\"task_id\"]\r\n\r\n# 2. Poll for progress\r\nwhile True:\r\n    response = requests.get(f\"{API_BASE}/api/tasks/{task_id}\")\r\n    status = response.json()\r\n\r\n    if status['status'] == 'completed':\r\n        break\r\n    time.sleep(2)\r\n\r\n# 3. Download result\r\nresponse = requests.get(f\"{API_BASE}/api/tasks/{task_id}/download\")\r\nwith open(\"output.mp4\", \"wb\") as f:\r\n    f.write(response.content)\r\n```\r\n\r\n## \ud83c\udfaf Detector Documentation\r\n\r\n### 1. Phone Number Detector (phone)\r\n\r\n**Function**: Identifies 11-digit Chinese mainland phone numbers\r\n\r\n**Features**:\r\n- Regex matching: `1[3-9]\\d{9}`\r\n- Smart filtering of long digit strings and false positives\r\n- Context validation to avoid misidentification\r\n\r\n**Usage**:\r\n```bash\r\nprivision input.mp4 output.mp4 --detector phone\r\n```\r\n\r\n### 2. ID Card Number Detector (idcard)\r\n\r\n**Function**: Identifies 18-digit Chinese mainland ID card numbers\r\n\r\n**Features**:\r\n- Regex matching: `\\d{17}[\\dXx]`\r\n- Date validity verification\r\n- Excludes invalid numbers\r\n\r\n**Usage**:\r\n```bash\r\nprivision input.mp4 output.mp4 --detector idcard\r\n```\r\n\r\n### 3. Keyword Detector (keyword)\r\n\r\n**Function**: Detects custom keywords\r\n\r\n**Features**:\r\n- Custom keyword list support\r\n- Chinese and English mixed support\r\n- Optional case sensitivity\r\n- Smart boundary matching\r\n\r\n**Usage**:\r\n```bash\r\n# Default keywords (password, account, username, etc.)\r\nprivision input.mp4 output.mp4 --detector keyword\r\n\r\n# Custom keywords\r\nprivision input.mp4 output.mp4 --detector keyword --keywords name phone address\r\n\r\n# Case-sensitive\r\nprivision input.mp4 output.mp4 --detector keyword --keywords Password --case-sensitive\r\n```\r\n\r\n### Extending Custom Detectors\r\n\r\nThe project uses factory pattern design for easy extension of new detectors:\r\n\r\n1. Inherit from `BaseDetector` base class\r\n2. Implement required abstract methods\r\n3. Register in `DetectorFactory`\r\n\r\nSee `src/privision/core/detector_base.py` and `src/privision/core/detector_factory.py` for details\r\n\r\n## \ud83c\udfd7 Project Architecture\r\n\r\n### Directory Structure\r\n\r\n```\r\nPrivision/\r\n\u251c\u2500\u2500 src/                          # Source code\r\n\u251c\u2500\u2500 \u251c\u2500\u2500 privision/                # Main package\r\n\u2502   \u2502  \u251c\u2500\u2500 main.py                   # CLI entry point\r\n\u2502   \u2502  \u251c\u2500\u2500 batch.py                  # Batch processing entry\r\n\u2502   \u2502  \u251c\u2500\u2500 server.py                 # API server entry\r\n\u2502   \u2502  \u2502\r\n\u2502   \u2502  \u251c\u2500\u2500 core/                     # Core functionality\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 video_processor.py   # Video processor (frame-by-frame/smart)\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 ocr_detector.py      # OCR detection\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 detector_base.py     # Detector base class\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 detector_factory.py  # Detector factory\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 detectors/           # Detector implementations\r\n\u2502   \u2502  \u2502   \u2502   \u251c\u2500\u2500 phone_detector.py\r\n\u2502   \u2502  \u2502   \u2502   \u251c\u2500\u2500 idcard_detector.py\r\n\u2502   \u2502  \u2502   \u2502   \u2514\u2500\u2500 keyword_detector.py\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 precise_locator.py   # Precise location\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 blur.py              # Masking effects\r\n\u2502   \u2502  \u2502   \u2514\u2500\u2500 bbox_calculator.py   # Bounding box calculation\r\n\u2502   \u2502  \u2502\r\n\u2502   \u2502  \u251c\u2500\u2500 api/                      # API service\r\n\u2502   \u2502  \u2502   \u2514\u2500\u2500 task_queue.py        # Task queue management\r\n\u2502   \u2502  \u2502\r\n\u2502   \u2502  \u251c\u2500\u2500 ui/                       # User interface\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 rich_ui.py           # Rich terminal UI\r\n\u2502   \u2502  \u2502   \u251c\u2500\u2500 progress.py          # Progress callback interface\r\n\u2502   \u2502  \u2502   \u2514\u2500\u2500 visualizer.py        # Visualization window\r\n\u2502   \u2502  \u2502\r\n\u2502   \u2502  \u251c\u2500\u2500 config/                   # Configuration management\r\n\u2502   \u2502  \u2502   \u2514\u2500\u2500 args.py              # Argument parsing\r\n\u2502   \u2502  \u2502\r\n\u2502   \u2502  \u2514\u2500\u2500 test/                     # Test modules\r\n\u2502\r\n\u251c\u2500\u2500 pyproject.toml                # Project configuration\r\n\u251c\u2500\u2500 requirements.txt              # Dependency list\r\n\u251c\u2500\u2500 README.md                     # This document\r\n```\r\n\r\n### Core Modules\r\n\r\n#### Detector Architecture\r\n\r\n```\r\nBaseDetector (Abstract Base Class)\r\n    \u251c\u2500\u2500 PhoneDetector (Phone numbers)\r\n    \u251c\u2500\u2500 IDCardDetector (ID card numbers)\r\n    \u2514\u2500\u2500 KeywordDetector (Keywords)\r\n\r\nDetectorFactory (Factory)\r\n    \u2514\u2500\u2500 create_detector()\r\n```\r\n\r\n#### Processing Flow\r\n\r\n**Frame-by-Frame Mode**:\r\n```\r\nVideo Input \u2192 Frame-by-Frame Read \u2192 OCR \u2192 Detector \u2192 Precise Location (optional) \u2192 Mask \u2192 Output\r\n```\r\n\r\n**Smart Sampling Mode**:\r\n```\r\nVideo Input \u2192 Periodic Sampling \u2192 OCR \u2192 Detector \u2192 Record Areas \u2192 Batch Mask \u2192 Output\r\n```\r\n\r\n### Technology Stack\r\n\r\n- **PaddleOCR**: Text detection and recognition\r\n- **OpenCV**: Video processing and masking\r\n- **FastAPI**: RESTful API framework\r\n- **Rich**: Terminal beautification\r\n- **NumPy**: Numerical computing\r\n\r\n## \ud83d\ude80 Performance Optimization\r\n\r\n### Recommended Configuration\r\n\r\n**1. Use GPU Acceleration**\r\n```bash\r\nprivision input.mp4 output.mp4 --device gpu:0\r\n```\r\nGPU can improve OCR speed by 3-10x\r\n\r\n**2. Use Smart Sampling Mode**\r\n```bash\r\nprivision input.mp4 output.mp4 --mode smart\r\n```\r\nSpeed improvement of 10-30x, suitable for most scenarios\r\n\r\n**3. Adjust Sampling Interval**\r\n```bash\r\n# Static scenes (phone number position changes slowly)\r\nprivision input.mp4 output.mp4 --mode smart --sample-interval 2.0\r\n\r\n# Dynamic scenes (phone number position changes quickly)\r\nprivision input.mp4 output.mp4 --mode smart --sample-interval 0.5\r\n```\r\n\r\n**4. Video Preprocessing**\r\n- Ultra-high resolution videos should be downscaled first\r\n- Use H.264 encoding for faster processing\r\n\r\n**5. API Concurrent Processing**\r\n\r\nModify the `max_workers` parameter in `src/privision/api/task_queue.py`:\r\n```python\r\nget_task_queue(storage_dir=TASKS_DIR, max_workers=2)  # Increase concurrency\r\n```\r\n\r\n## \ud83d\udd27 FAQ\r\n\r\n### Q1: How to verify GPU availability?\r\n\r\n```bash\r\n# Check CUDA\r\nnvidia-smi\r\n\r\n# Check PaddlePaddle GPU support\r\npython -c \"import paddle; print('GPU available:', paddle.device.is_compiled_with_cuda())\"\r\n```\r\n\r\n### Q2: Why can't I directly run `python privision/main.py`?\r\n\r\nBecause import statements use the `privision.xxx` format, Python needs to import `privision` as a package.\r\n\r\n**Solutions**:\r\n- Run using `python -m privision.main`\r\n- Or install using `pip install -e .` and directly use the `privision` command\r\n\r\n### Q3: Why is the first run slow?\r\n\r\nThe first run automatically downloads PaddleOCR model files (about 100-200 MB), requiring network connection. After downloading, files are cached locally.\r\n\r\n### Q4: How to improve recognition accuracy?\r\n\r\n1. Ensure video clarity is sufficient\r\n2. Use frame-by-frame mode instead of smart sampling\r\n3. Enable precise location mode: `--precise-location`\r\n4. Complex fonts or backgrounds affect OCR performance\r\n\r\n### Q5: How to add new detectors?\r\n\r\n1. Create a new detector class in `src/privision/core/detectors/`\r\n2. Inherit from `BaseDetector` and implement required methods\r\n3. Register in `DetectorFactory._detectors`\r\n4. Update command-line arguments and documentation\r\n\r\n### Q6: What video formats are supported?\r\n\r\nSupports all formats supported by OpenCV: `.mp4`, `.avi`, `.mov`, `.mkv`, `.flv`, `.wmv`, `.webm`\r\n\r\nOutput format currently only supports MP4.\r\n\r\n### Q7: How to deploy API service in production?\r\n\r\n1. Use reverse proxy (such as Nginx)\r\n2. Configure HTTPS\r\n3. Modify CORS settings (in `src/privision/server.py`)\r\n4. Use process management tools (such as systemd, supervisor)\r\n5. Configure logging and monitoring\r\n\r\n## \ud83d\udee0 Development Guide\r\n\r\n### Development Environment Setup\r\n\r\n```bash\r\n# Clone repository\r\ngit clone https://github.com/0xyk3r/Privision.git\r\ncd Privision\r\n\r\n# Install development dependencies\r\npip install -e \".[dev]\"\r\n```\r\n\r\n### Run Tests\r\n\r\n```bash\r\n# Run all tests\r\npytest src/privision/test/\r\n\r\n# Run specific tests\r\npython -m privision.test.test_phone_filter\r\npython -m privision.test.test_ocr_and_detector\r\n```\r\n\r\n### Code Structure Design\r\n\r\n- **Separation of Concerns**: Core functionality, API, UI, and configuration are independently modularized\r\n- **Configuration-Driven**: Use `ProcessConfig` for unified configuration management\r\n- **Interface Abstraction**: `ProgressCallback` interface decouples business logic from UI\r\n- **Factory Pattern**: `DetectorFactory` manages detector creation\r\n- **Extensibility**: Easy to add new detectors, masking methods, and UIs\r\n\r\n### Contributing\r\n\r\nIssues and Pull Requests are welcome!\r\n\r\n1. Fork the project\r\n2. Create a feature branch (`git checkout -b feature/YourFeature`)\r\n3. Commit changes (`git commit -m 'Add some YourFeature'`)\r\n4. Push to branch (`git push origin feature/YourFeature`)\r\n5. Open a Pull Request\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the [MIT License](LICENSE).\r\n\r\n## \ud83d\ude4f Acknowledgments\r\n\r\n- [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR) - OCR toolkit\r\n- [OpenCV](https://opencv.org/) - Computer vision library\r\n- [FastAPI](https://fastapi.tiangolo.com/) - Modern web framework\r\n- [Rich](https://github.com/Textualize/rich) - Terminal beautification library\r\n\r\n## \ud83d\udce7 Contact\r\n\r\n- Author: 0xyk3r\r\n- GitHub: [https://github.com/0xyk3r/Privision](https://github.com/0xyk3r/Privision)\r\n- Issues: [https://github.com/0xyk3r/Privision/issues](https://github.com/0xyk3r/Privision/issues)\r\n\r\n---\r\n\r\n**Note**: This tool is only for legal privacy protection purposes and should not be used for illegal purposes. Users are responsible for any legal liability related to videos processed with this tool.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\u89c6\u9891\u5185\u5bb9\u8131\u654f\u5de5\u5177 - \u57fa\u4e8eOCR\u7684\u4fe1\u606f\u8bc6\u522b\u4e0e\u6253\u7801\u7cfb\u7edf",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/0xyk3r/Privision",
        "Issues": "https://github.com/0xyk3r/Privision/issues",
        "Repository": "https://github.com/0xyk3r/Privision"
    },
    "split_keywords": [
        "privision",
        " video",
        " ocr",
        " phone-number",
        " mask",
        " blur",
        " privacy"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "220dd3ddf4da377f693c05971ba8b2aa0906e85c2332ece37ff3ec043b826256",
                "md5": "bb81c9f29abe2e3b3d9580d6c9d4dc50",
                "sha256": "fd8fb8aa8c6b21d2a6c130d9549ae9c3bc9e602ea0d43ff6c658c62f01c61db6"
            },
            "downloads": -1,
            "filename": "privision-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bb81c9f29abe2e3b3d9580d6c9d4dc50",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 83191,
            "upload_time": "2025-10-07T17:32:47",
            "upload_time_iso_8601": "2025-10-07T17:32:47.251999Z",
            "url": "https://files.pythonhosted.org/packages/22/0d/d3ddf4da377f693c05971ba8b2aa0906e85c2332ece37ff3ec043b826256/privision-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fb8342afc5bd01494b0d58c9efc942895353a03ffb85a49e8d168dab0c5dab74",
                "md5": "ea22fc6baca3947ff6b41685ccd1679b",
                "sha256": "8ff3fa9ec6d631819ccf0b61904931a3b986e7c7ec6dc817ca3a73330ffc9ac9"
            },
            "downloads": -1,
            "filename": "privision-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ea22fc6baca3947ff6b41685ccd1679b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 73353,
            "upload_time": "2025-10-07T17:32:48",
            "upload_time_iso_8601": "2025-10-07T17:32:48.751444Z",
            "url": "https://files.pythonhosted.org/packages/fb/83/42afc5bd01494b0d58c9efc942895353a03ffb85a49e8d168dab0c5dab74/privision-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-07 17:32:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "0xyk3r",
    "github_project": "Privision",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "paddleocr",
            "specs": [
                [
                    ">=",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "paddlepaddle",
            "specs": [
                [
                    ">=",
                    "3.0.0"
                ]
            ]
        },
        {
            "name": "opencv-python",
            "specs": [
                [
                    ">=",
                    "4.8.0"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.24.0"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": [
                [
                    ">=",
                    "10.0.0"
                ]
            ]
        },
        {
            "name": "rich",
            "specs": [
                [
                    ">=",
                    "13.0.0"
                ]
            ]
        },
        {
            "name": "fastapi",
            "specs": [
                [
                    ">=",
                    "0.104.0"
                ]
            ]
        },
        {
            "name": "uvicorn",
            "specs": [
                [
                    ">=",
                    "0.24.0"
                ]
            ]
        },
        {
            "name": "python-multipart",
            "specs": [
                [
                    ">=",
                    "0.0.6"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        }
    ],
    "lcname": "privision"
}
        
Elapsed time: 1.49029s