A data augmentation tool for LabelMe annotated datasets
Project description
LabelMe Image Augmentor
一个用于 LabelMe 标注数据集的数据增强工具。支持图像及其对应的 JSON 标注文件同步增强。
功能特性
- 支持多种增强方式:
- 旋转 (Rotation)
- 翻转 (Flip: 水平/垂直)
- 缩放 (Scale)
- 平移 (Translate)
- 颜色/亮度调整 (Color/Brightness)
- 自动同步更新 LabelMe 格式的 JSON 标注文件
- 正确处理 Rectangle 类型的旋转(转换为包围盒)
- 命令行接口,易于集成
安装
pip install labelme-augmentor
使用方法
命令行工具
# 基本用法
labelme-augmentor --src_dir /path/to/input --dist_dir /path/to/output --num_aug 3
# 参数说明
# --src_dir: 输入图片和JSON所在的目录
# --dist_dir: 增强后数据的输出目录
# --num_aug: 每个原始图像生成的增强样本数量 (默认: 3)
Python 代码调用
from labelme_augmentor import ImageAugmentor
augmentor = ImageAugmentor(
input_dir="/path/to/input",
output_dir="/path/to/output"
)
# 运行增强
augmentor.run_augmentation(num_augmentations=3, random_seed=42)
依赖
- numpy
- opencv-python
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file labelme_augmentor-0.1.1.tar.gz.
File metadata
- Download URL: labelme_augmentor-0.1.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f913f6fdbb63cf85d401be86cd5838f04008af133c457c673b29c447624df3d
|
|
| MD5 |
2d887d19ad9dbc411af9c894a8705092
|
|
| BLAKE2b-256 |
6e4bc07af5fda32fe13e9adf4c1119eeaa6abdc354bb0fc80a8a196210c6262c
|
File details
Details for the file labelme_augmentor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: labelme_augmentor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b929dab6e0064fde4ecd5f4c0ab459d45e2717361b28445ef6c13d0f2447b830
|
|
| MD5 |
2e4bdfa8dd1c42ef92466fa053060810
|
|
| BLAKE2b-256 |
e027a0c6139fe927aecd78966e8995f2d30ee162de34c53e02e56057eb6b6bc6
|