Metadata-Version: 2.4
Name: labelme-augmentor
Version: 0.1.1
Summary: A data augmentation tool for LabelMe annotated datasets
Author: Alex Chen(miracle757@gmail.com)
License: MIT License
        
        Copyright (c) 2024 Alex Chen
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: opencv-python
Dynamic: license-file

# LabelMe Image Augmentor

一个用于 LabelMe 标注数据集的数据增强工具。支持图像及其对应的 JSON 标注文件同步增强。

## 功能特性

- 支持多种增强方式：
  - 旋转 (Rotation)
  - 翻转 (Flip: 水平/垂直)
  - 缩放 (Scale)
  - 平移 (Translate)
  - 颜色/亮度调整 (Color/Brightness)
- 自动同步更新 LabelMe 格式的 JSON 标注文件
- 正确处理 Rectangle 类型的旋转（转换为包围盒）
- 命令行接口，易于集成

## 安装

```bash
pip install labelme-augmentor
```

## 使用方法

### 命令行工具

```bash
# 基本用法
labelme-augmentor --src_dir /path/to/input --dist_dir /path/to/output --num_aug 3

# 参数说明
# --src_dir: 输入图片和JSON所在的目录
# --dist_dir: 增强后数据的输出目录
# --num_aug: 每个原始图像生成的增强样本数量 (默认: 3)
```

### Python 代码调用

```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
