HaS Image Model (FP32)

HaS (Hide and Seek) is an on-device image privacy model that performs pixel-level detection and segmentation of sensitive regions in images.

  • 📦 YOLO11-based instance segmentation, FP32, 119 MB
  • 🔒 Data never leaves device — local inference, no network required
  • 🎯 21 privacy categories covering biometrics, ID documents, financial cards, screens, and more
  • ~20ms per image inference speed on modern hardware

1. Core Capabilities

Traditional image redaction relies on face-only detectors or manual masking. HaS Image is an on-device privacy segmentation model — it recognizes 21 categories of sensitive content with pixel-level masks, enabling precise and automated redaction.

Capability Description
21 Privacy Categories Covers biometrics (face, fingerprint, palmprint), ID documents (ID card, passport, permit), financial (bank card), screens (mobile, monitor), and more
Pixel-Level Segmentation Instance segmentation, not just bounding boxes — masks follow the exact contour of each sensitive region
Multiple Redaction Methods Supports mosaic, Gaussian blur, and solid fill — configurable strength and style per use case
Batch Processing Process entire directories of images in one command
Category Filtering Selectively redact only specific categories (e.g., faces only, or faces + license plates)
High Speed ~20ms per image, suitable for real-time and batch workflows

2. Supported Privacy Categories

6 groups, 21 categories:

Group ID Category Description
Biometrics 0 face Human faces
1 fingerprint Fingerprints
2 palmprint Palm prints
ID Documents 3 id_card National ID cards
4 hk_macau_permit HK/Macau travel permits
5 passport Passports
6 employee_badge Employee badges
Transportation 7 license_plate Vehicle license plates
Financial 8 bank_card Bank/credit cards
Security 9 physical_key Physical keys
Documents 10 receipt Receipts
11 shipping_label Shipping/courier labels
12 official_seal Official stamps/seals
20 paper Paper documents
Information Carriers 13 whiteboard Whiteboards
14 sticky_note Sticky notes
15 mobile_screen Mobile phone screens
16 monitor_screen Computer monitor screens
Medical 17 medical_wristband Hospital wristbands
Codes 18 qr_code QR codes
19 barcode Barcodes

Category filtering supports English names, Chinese names, or numeric IDs (comma-separated).

3. Quick Start

Installation

pip install ultralytics

Python Usage

from ultralytics import YOLO

model = YOLO("sensitive_seg_best.pt")

# Detect all privacy regions
results = model.predict("photo.jpg", conf=0.25)

# Process results
for result in results:
    for box, mask in zip(result.boxes, result.masks):
        category_id = int(box.cls)
        confidence = float(box.conf)
        print(f"Category: {category_id}, Confidence: {confidence:.2f}")

CLI Usage (via HaS)

HaS ships with a CLI tool has-image that wraps the model into ready-to-use commands:

# Scan — detect privacy regions without modifying the image
has-image scan --image photo.jpg

# Hide — detect and redact with mosaic (default)
has-image hide --image photo.jpg

# Hide — redact faces only, with Gaussian blur
has-image hide --image photo.jpg --types face --method blur --strength 25

# Hide — batch process a directory
has-image hide --dir ./photos/ --output-dir ./redacted/

4. Redaction Methods

Method Flag Description
Mosaic --method mosaic Pixelated blocks (default). --strength controls block size
Gaussian Blur --method blur Smooth blur. --strength controls blur radius
Solid Fill --method fill Solid color overlay. --fill-color sets hex color (default #000000)

5. Usage Scenarios

Scenario Description Method
Photo Publishing Redact faces and license plates before sharing photos online hide --types face,license_plate
Document Redaction Mask ID cards, bank cards, and seals in scanned documents hide --types id_card,bank_card,official_seal
Dataset Anonymization Batch-anonymize images in ML training datasets hide --dir ./dataset/
Compliance Screening Scan uploaded images for sensitive content before processing scan --image uploaded.jpg
Video Frame Processing Extract frames, redact per-frame, reassemble hide per frame
Screen Recording Privacy Mask phone/monitor screens in recordings hide --types mobile_screen,monitor_screen

6. Redaction Example

image

Figure 1. Before and after privacy redaction with HaS Image model

7. Model Specifications

Property Value
Architecture YOLO11 Instance Segmentation
Precision FP32
File Size 119 MB
Task Instance Segmentation
Categories 21 privacy classes
Inference Speed ~20ms per image
Input Any resolution (auto-scaled)
Output Bounding boxes + pixel-level masks + confidence scores
Framework Ultralytics
License MIT

8. Related Models

Model Type Description
HaS Text Q8_0 Text Text anonymization, 0.6B params, Q8_0 quantized, 639 MB
HaS Text Q4_K_M Text Text anonymization, 0.6B params, Q4_K_M quantized, 397 MB
HaS Image FP32 Image Image privacy segmentation, YOLO11, FP32, 119 MB

HaS Text handles text anonymization (named entities, PII); HaS Image handles image anonymization (visual privacy regions). Together they provide a complete on-device privacy solution for both text and images.


中文版

HaS Image Model (FP32)

HaS(Hide and Seek) 是一个端侧部署的图像隐私模型,对图片中的隐私区域进行像素级识别和分割。

  • 📦 基于 YOLO11 实例分割,FP32 精度,119 MB
  • 🔒 数据不出设备,本地推理,无需联网
  • 🎯 21 类隐私类别,覆盖生物特征、证件、金融卡、屏幕等
  • 单张图片 ~20ms 推理速度

一、核心能力

传统图像脱敏依赖人脸检测器或手动遮挡。HaS Image 是一个端侧隐私分割模型——识别 21 类敏感内容,提供像素级掩码,实现精准自动化脱敏。

能力 说明
21 类隐私类别 覆盖生物特征(人脸、指纹、掌纹)、证件(身份证、护照、通行证)、金融(银行卡)、屏幕(手机、显示器)等
像素级分割 实例分割而非仅边界框——掩码精确贴合每个敏感区域的轮廓
多种遮挡方式 支持马赛克、高斯模糊、纯色填充——可按场景配置强度和样式
批量处理 一条命令处理整个目录的图片
类别过滤 选择性脱敏指定类别(如仅人脸,或人脸+车牌)
高速推理 单张图片 ~20ms,适合实时和批量工作流

二、支持的隐私类别

6 大分组,21 个类别:

分组 ID 类别 中文
生物特征 0 face 人脸
1 fingerprint 指纹
2 palmprint 掌纹
证件 3 id_card 身份证
4 hk_macau_permit 港澳通行证
5 passport 护照
6 employee_badge 工牌
交通 7 license_plate 车牌
金融 8 bank_card 银行卡
安全 9 physical_key 钥匙
文档 10 receipt 收据
11 shipping_label 快递单
12 official_seal 公章
20 paper 纸张
信息载体 13 whiteboard 白板
14 sticky_note 便签
15 mobile_screen 手机屏幕
16 monitor_screen 显示器屏幕
医疗 17 medical_wristband 医用腕带
编码 18 qr_code 二维码
19 barcode 条形码

类别过滤支持英文名、中文名或数字 ID,逗号分隔。

三、快速开始

安装

pip install ultralytics

Python 使用

from ultralytics import YOLO

model = YOLO("sensitive_seg_best.pt")

# 检测所有隐私区域
results = model.predict("photo.jpg", conf=0.25)

# 处理结果
for result in results:
    for box, mask in zip(result.boxes, result.masks):
        category_id = int(box.cls)
        confidence = float(box.conf)
        print(f"类别: {category_id}, 置信度: {confidence:.2f}")

CLI 使用(通过 HaS)

HaS 配套了 CLI 工具 has-image,将模型封装为开箱即用的命令:

# 扫描——仅检测隐私区域,不修改图片
has-image scan --image photo.jpg

# 脱敏——检测并遮挡(默认马赛克)
has-image hide --image photo.jpg

# 脱敏——仅遮挡人脸,使用高斯模糊
has-image hide --image photo.jpg --types face --method blur --strength 25

# 批量处理整个目录
has-image hide --dir ./photos/ --output-dir ./redacted/

四、遮挡方式

方式 参数 说明
马赛克 --method mosaic 像素化方块(默认)。--strength 控制块大小
高斯模糊 --method blur 平滑模糊。--strength 控制模糊半径
纯色填充 --method fill 纯色覆盖。--fill-color 设置十六进制颜色(默认 #000000

五、使用场景

场景 说明 方法
照片发布 分享照片前遮挡人脸和车牌 hide --types face,license_plate
文档脱敏 遮挡扫描件中的身份证、银行卡、公章 hide --types id_card,bank_card,official_seal
数据集匿名化 批量匿名化 ML 训练数据集中的图片 hide --dir ./dataset/
合规审查 上传图片处理前扫描敏感内容 scan --image uploaded.jpg
视频帧处理 抽帧 → 逐帧脱敏 → 重新组装 逐帧 hide
录屏隐私 遮挡录屏中的手机/显示器屏幕 hide --types mobile_screen,monitor_screen

六、脱敏示例

image

图 1. HaS Image 模型脱敏前后对比

七、模型规格

属性
架构 YOLO11 实例分割
精度 FP32
文件大小 119 MB
任务 实例分割
类别数 21 类隐私实体
推理速度 单张图片 ~20ms
输入 任意分辨率(自动缩放)
输出 边界框 + 像素级掩码 + 置信度分数
框架 Ultralytics
许可证 MIT

八、相关模型

模型 类型 说明
HaS Text Q8_0 文本 文本脱敏,0.6B 参数,Q8_0 量化,639 MB
HaS Text Q4_K_M 文本 文本脱敏,0.6B 参数,Q4_K_M 量化,397 MB
HaS Image FP32 图像 图像隐私分割,YOLO11,FP32,119 MB

HaS Text 处理文本脱敏(命名实体、个人信息);HaS Image 处理图像脱敏(视觉隐私区域)。二者结合,提供完整的端侧文本+图像隐私保护方案。

Downloads last month
62
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support