Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SWHL authored Mar 28, 2024
1 parent 163a566 commit cbcf238
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 65 deletions.
94 changes: 54 additions & 40 deletions content/docs/SupportConversions/coco_to_labelimg.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,57 @@ description: ""
publishdate: "2022-09-30T05:33:22+01:00"
---

- One-click conversion of COCO format data to labelImg labeled yolo format data.
- COCO format directory structure(see `dataset/COCO_format` for details):
```text {linenos=table}
COCO_format
├── annotations
│ ├── instances_train2017.json
│ └── instances_val2017.json
├── train2017
│ ├── 000000000001.jpg
│ └── 000000000002.jpg
└── val2017
└── 000000000001.jpg
```
- Convert
```bash {linenos=table}
coco_to_labelImg --data_dir dataset/COCO_format --save_dir dataset/labelImg_format
```
- `--data_dir`: the directory where the COCO format dataset is located. Default is `dataset/COCO_format`.
- `--save_dir`: Path to save the converted dataset. Default is `f"{data_dir.name}_labelImg_format"`
- Converted directory structure (see `dataset/labelImg_format` for details):
```text {linenos=table}
labelImg_format
├── train
│ ├── 000000000001.jpg
│ ├── 000000000001.txt
│ ├── 000000000002.jpg
│ └── classes.txt
└── val
├── 000000000001.jpg
├── 000000000001.txt
└── classes.txt
```
- For the converted directory, you can directly use the [labelImg](https://github.com/tzutalin/labelImg) library to open it directly and change the label. The specific commands are as follows:
```bash {linenos=table}
$ cd dataset/labelImg_format
$ labelImg train train/classes.txt

# or
$ labelImg val val/classes.txt
```
#### 简介
将COCO格式数据集转换为可以直接用[labelImg](https://github.com/HumanSignal/labelImg)工具可视化标注的YOLO格式。


#### COCO格式如下:

{{< alert text="具体结构示例文件,可移步:[COCO_dataset](https://github.com/RapidAI/LabelConvert/tree/main/tests/test_files/COCO_dataset)" />}}

```text {linenos=table}
COCO_format
├── annotations
│ ├── instances_train2017.json
│ └── instances_val2017.json
├── train2017
│ ├── 000000000001.jpg
│ └── 000000000002.jpg
└── val2017
└── 000000000001.jpg
```

#### 转换
```bash {linenos=table}
coco_to_labelImg --data_dir dataset/COCO_format --save_dir dataset/labelImg_format
```

- `--data_dir`: COCO格式数据集所在目录。默认是`dataset/COCO_format`
- `--save_dir`: 保存转换后的数据集目录。默认是COCO数据集同级目录下

#### 转换后结构如下:

{{< alert text="具体结构示例文件,可移步:[labelImg_dataset](https://github.com/RapidAI/LabelConvert/tree/main/tests/test_files/labelImg_dataset)" />}}


```text {linenos=table}
labelImg_format
├── train
│ ├── 000000000001.jpg
│ ├── 000000000001.txt
│ ├── 000000000002.jpg
│ └── classes.txt
└── val
├── 000000000001.jpg
├── 000000000001.txt
└── classes.txt
```

#### labelImg可视化
```bash {linenos=table}
$ cd dataset/labelImg_format
$ labelImg train train/classes.txt

# or
$ labelImg val val/classes.txt
```
2 changes: 1 addition & 1 deletion content/docs/SupportConversions/coco_visual.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ weight: 60
date: "2022-09-30T05:33:22+01:00"
draft: false
author: "SWHL"
title: "Visualize COCO image"
title: "可视化COCO数据集"
icon: "bike_scooter"
toc: true
description: ""
Expand Down
5 changes: 5 additions & 0 deletions content/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ description: ""
publishdate: "2023-09-08"
---

#### 2024-03-28 v0.0.8 update:
- 优化各个模块代码
- 添加单元测试
- 去除无效数据集文件

#### 2023-11-01 v0.0.7 update:
- 修复[Issue #9](https://github.com/RapidAI/LabelConvert/issues/9)

Expand Down
42 changes: 18 additions & 24 deletions content/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,28 @@ description: ""
publishdate: "2023-09-08"
---


<div align="center">
<img src="https://github.com/RapidAI/LabelConvert/releases/download/v0/LabelConvertv3.png" width="55%" height="55%"/>
</div>

## Label Convert
<div align="center">
<img src="https://github.com/RapidAI/LabelConvert/releases/download/v0/LabelConvertv3.png" width="55%" height="55%"/>
</div>
<br/>

<a href=""><img src="https://img.shields.io/badge/Python->=3.6,<3.12-aff.svg"></a>
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
<a href="https://github.com/RapidAI/LabelConvert/graphs/contributors"><img src="https://img.shields.io/github/contributors/RapidAI/LabelConvert?color=9ea"></a>
<a href="https://github.com/RapidAI/LabelConvert/stargazers"><img src="https://img.shields.io/github/stars/RapidAI/LabelConvert?color=ccf" ></a>
<a href="https://pepy.tech/project/label_convert"><img src="https://static.pepy.tech/badge/label_convert?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads"></a>
<a href="https://pypi.org/project/label_convert/"><img alt="PyPI" src="https://img.shields.io/pypi/v/label_convert"></a>
<a href="https://choosealicense.com/licenses/apache-2.0/"><img src="https://img.shields.io/badge/License-Apache%202-dfd.svg"></a>
<a href="https://semver.org/"><img alt="SemVer2.0" src="https://img.shields.io/badge/SemVer-2.0-brightgreen"></a>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>

<p align="left">
<a href=""><img src="https://img.shields.io/badge/Python->=3.6,<3.12-aff.svg"></a>
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
<a href="https://github.com/RapidAI/LabelConvert/graphs/contributors"><img src="https://img.shields.io/github/contributors/RapidAI/LabelConvert?color=9ea"></a>
<a href="https://github.com/RapidAI/LabelConvert/stargazers"><img src="https://img.shields.io/github/stars/RapidAI/LabelConvert?color=ccf" ></a>
<a href="https://pepy.tech/project/label_convert"><img src="https://static.pepy.tech/badge/label_convert?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads"></a>
<a href="https://pypi.org/project/label_convert/"><img alt="PyPI" src="https://img.shields.io/pypi/v/label_convert"></a>
<a href="https://choosealicense.com/licenses/apache-2.0/"><img src="https://img.shields.io/badge/License-Apache%202-dfd.svg"></a>
<a href="https://semver.org/"><img alt="SemVer2.0" src="https://img.shields.io/badge/SemVer-2.0-brightgreen"></a>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
</p>
</div>

A dataset format conversion tool for object detection and image segmentation, which supports mutual conversion between **labelme, labelImg tools and YOLO, VOC, and COCO** dataset formats.
目标检测和图像分割的数据集格式转换工具,支持**labelme、labelImg与YOLO、VOC和COCO** 数据集格式之间的相互转换。


### Supported conversions
### 支持的转换
```mermaid
flowchart LR
Expand All @@ -45,13 +44,8 @@ F(darknet) --> D
G(labelme) --> D
```

### Installation
### 安装
```bash {linenos=table}
pip install label_convert
```

### Contributing
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

Please make sure to update tests as appropriate.

0 comments on commit cbcf238

Please sign in to comment.