Image Annotation QC Tool
Automatically detect quality issues in image annotations and generate detailed reports with visualization.
Features
- - ✅ Multi-format Support: COCO / YOLO / VOC / LabelMe
- ✅ Auto-detection: Automatically identify format without specification
- ✅ Scene-specific QC: general / road / industrial / security
- ✅ Auto-save Reports: Save to
qc_report/ directory automatically - ✅ Visualization: Generate images with error annotations (red boxes)
- ✅ Multi-format Reports: TXT / JSON / Excel
Quick Start
CODEBLOCK0
Parameters
| Parameter | Short | Description | Default |
|---|
| INLINECODE1 | INLINECODE2 | Image directory | (required) |
| INLINECODE3 |
-a | Annotation file or directory | (required) |
|
--format |
-f | Annotation format |
auto |
|
--domain |
-d | Application scenario |
general |
|
--sample |
-s | Sample size | all |
|
--output |
-o | Output directory |
./qc_report |
|
--formats | - | Report formats |
txt json |
|
--no-visual | - | Disable visualization | false |
Scenarios
- - general: General purpose
- road: Autonomous driving (small objects, occlusions)
- industrial: Industrial inspection (micro-defects)
- security: Security monitoring
Output Example
CODEBLOCK1
Output Files
After QC completes, the following files are generated in the annotation directory:
CODEBLOCK2
Error Types
| Error | Description | Weight |
|---|
| Missing | Obvious targets not labeled | 1.0 |
| Wrong |
Annotation region doesn't match target | 0.8 |
| Offset | Box edge deviates >10px | 0.5 |
| Too Large | Box significantly larger than target | 0.3 |
| Too Small | Box doesn't fully contain target | 0.5 |
| Duplicate | Same object annotated multiple times | 0.5 |
| Label Error | Wrong class label | 0.8 |
Quality Score
CODEBLOCK3
Installation
CODEBLOCK4
As Module
CODEBLOCK5
图像标注质量控制工具
自动检测图像标注中的质量问题,并生成带有可视化结果的详细报告。
功能特性
- - ✅ 多格式支持:COCO / YOLO / VOC / LabelMe
- ✅ 自动检测:无需指定格式,自动识别
- ✅ 场景化质量控制:通用 / 道路 / 工业 / 安防
- ✅ 自动保存报告:自动保存至 qc_report/ 目录
- ✅ 可视化:生成带有错误标注(红色框)的图像
- ✅ 多格式报告:TXT / JSON / Excel
快速开始
bash
基本用法(自动检测格式)
python3 scripts/qc_tool.py -i <图片目录> -a <标注目录>
指定格式
python3 scripts/qc_tool.py -i ./images -a ./annotations -f labelme
工业检测场景
python3 scripts/qc_tool.py -i ./images -a ./annotations -d industrial
抽样100张图片
python3 scripts/qc_tool.py -i ./images -a ./annotations -s 100
指定输出目录
python3 scripts/qc
tool.py -i ./images -a ./annotations -o ./myreport
生成Excel报告
python3 scripts/qc_tool.py -i ./images -a ./annotations --formats txt json xlsx
参数说明
| 参数 | 简写 | 说明 | 默认值 |
|---|
| --image-dir | -i | 图片目录 | (必填) |
| --annotation |
-a | 标注文件或目录 | (必填) |
| --format | -f | 标注格式 | auto |
| --domain | -d | 应用场景 | general |
| --sample | -s | 抽样数量 | 全部 |
| --output | -o | 输出目录 | ./qc_report |
| --formats | - | 报告格式 | txt json |
| --no-visual | - | 禁用可视化 | false |
场景说明
- - general:通用场景
- road:自动驾驶(小目标、遮挡)
- industrial:工业检测(微小缺陷)
- security:安防监控
输出示例
╔══════════════════════════════════════════╗
║ 图像标注质量控制 ║
╠══════════════════════════════════════════╣
║ 图片:1000 标注:4523 ║
║ 错误:127 质量评分:85.5 ║
║ 准确率:97.2% ║
╚══════════════════════════════════════════╝
输出文件
质量控制完成后,在标注目录中生成以下文件:
annotations/
├── qc_report/
│ ├── qc_report.txt # 文本报告
│ ├── qc_report.json # JSON详细报告
│ ├── qc_report.xlsx # Excel报告(可选)
│ └── visual/ # 可视化图片
│ ├── frame001qc.png
│ └── frame002qc.png
错误类型
标注区域与目标不匹配 | 0.8 |
| 偏移 | 框边缘偏差>10像素 | 0.5 |
| 过大 | 框明显大于目标 | 0.3 |
| 过小 | 框未完全包含目标 | 0.5 |
| 重复 | 同一对象多次标注 | 0.5 |
| 标签错误 | 类别标签错误 | 0.8 |
质量评分
评分 = 100 × (标注数 - 错误数×权重) / 标注数
等级划分:
- - 90分以上:优秀
- 80-89分:良好
- 70-79分:合格
- 70分以下:不合格
安装
bash
pip install Pillow openpyxl
作为模块使用
python
from qc_tool import AnnotationQC
qc = AnnotationQC(images/, annotations/, format=labelme)
data = qc.load_annotations()
result = qc.check_annotations(data)
qc.generate_report(result, formats=[txt, json])
qc.visualize_errors(result)
print(f质量评分:{result.quality_score})