# Additional tools
## Convert the label files to CSV
### Introduction
To train the images on [Google Cloud AutoML](https://cloud.google.com/automl), we should prepare the specific csv files follow [this format](https://cloud.google.com/vision/automl/object-detection/docs/csv-format).
`label_to_csv.py` can convert the `txt` or `xml` label files to csv file. The labels files should strictly follow to below structure.
### Structures
* Images
To train the object detection tasks, all the images should upload to the cloud storage and access it by its name. All the images should stay in the **same buckets** in cloud storage. Also, different classes should have their own folder as below.
```
<bucket_name> (on the cloud storage)
| -- class1
| | -- class1_01.jpg
| | -- class1_02.jpg
| | ...
| -- class2
| | -- class2_01.jpg
| | -- class2_02.jpg
| | ...
| ...
```
Note, URI of the `class1_01.jpg` is `gs://<bucket_name>/class1/class1_01.jpg`
* Labels
There are four types of training data - `TRAINING`, `VALIDATION`, `TEST` and `UNASSIGNED`. To assign different categories, we should create four directories.
Inside each folder, users should create the class folders with the same name in cloud storage (see below structure).
```
labels (on PC)
| -- TRAINING
| | -- class1
| | | -- class1_01.txt (or .xml)
| | | ...
| | -- class2
| | | -- class2_01.txt (or .xml)
| | | ...
| | ...
| -- VALIDATION
| | -- class1
| | | -- class1_02.txt (or .xml)
| | | ...
| | -- class2
| | | -- class2_02.txt (or .xml)
| | | ...
| | ...
| -- TEST
| | (same as TRAINING and VALIDATION)
| -- UNASSIGNED
| | (same as TRAINING and VALIDATION)
```
### Usage
To see the argument of `label_to_csv.py`,
```commandline
python label_to_csv.py -h
```
```commandline
usage: label_to_csv.py [-h] -p PREFIX -l LOCATION -m MODE [-o OUTPUT]
[-c CLASSES]
optional arguments:
-h, --help show this help message and exit
-p PREFIX, --prefix PREFIX
Bucket of the cloud storage path
-l LOCATION, --location LOCATION
Parent directory of the label files
-m MODE, --mode MODE 'xml' for converting from xml and 'txt' for converting
from txt
-o OUTPUT, --output OUTPUT
Output name of csv file
-c CLASSES, --classes CLASSES
Label classes path
```
For example, if mine bucket name is **test**, the location of the label directory is **/User/test/labels**, the mode I choose from is **txt**, the output name and the class path is same as default.
```commandline
python label_to_csv.py \
-p test\
-l /User/test/labels \
-m txt
```
The output file is `res.csv` by default. Afterwards, upload the csv file to the cloud storage and you can start training!
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于labelImg和YOLOv5的图形化半自动标注工具 通过现有 yolov5 pytorch 模型对数据集进行半自动标注 新闻 labelGo 现在支持最新版本的 YOLOv5 和自动类 .txt 文件生成 半自动贴标功能演示 一键将Yolo格式转换为VOC格式的演示 注意 如果有问题,请在问题中提出。 批注文件保存在与图片文件夹相同的位置。 推荐的 python 版本:python 3.8。 建议用于 conda 环境。 本项目支持最新版本的 YOLOv5,如果需要使用支持 YOLOv5 version5 的旧版本,可以在 Release 中找到源码。
资源推荐
资源详情
资源评论
收起资源包目录
基于YOLOV5及labelImg的图形化半自动标注工具 (163个子文件)
test.512.512.bmp 257KB
setup.cfg 97B
Dockerfile 821B
demo1.gif 5.07MB
demo2.gif 3.29MB
.gitignore 176B
.gitignore 108B
.gitignore 9B
app.icns 8B
labelGo.iml 284B
MANIFEST.in 300B
臉書.jpg 747B
LICENSE 1KB
Makefile 520B
README.md 3KB
README.md 2KB
readme_zh_cn.md 2KB
README.md 1KB
README.md 454B
feBlend-icon.png 8KB
format_createml.png 4KB
resetall.png 4KB
autolabel.png 3KB
close.png 3KB
save-as.png 3KB
labels.png 2KB
color_line.png 2KB
fit.png 2KB
done.png 2KB
verify.png 2KB
cancel.png 2KB
undo.png 2KB
undo-cross.png 2KB
quit.png 2KB
prev.png 2KB
next.png 2KB
help.png 2KB
delete.png 1KB
color.png 1KB
open.png 1KB
fit-width.png 1KB
save.png 1KB
eye.png 1KB
zoom.png 1KB
objects.png 1KB
fit-window.png 1KB
zoom-in.png 1KB
edit.png 1KB
app.png 1KB
zoom-out.png 1KB
new.png 977B
format_voc.png 786B
file.png 765B
format_yolo.png 675B
copy.png 646B
expert2.png 335B
expert1.png 278B
strings-zh-CN.properties 5KB
strings-ja-JP.properties 3KB
strings.properties 2KB
strings-zh-TW.properties 2KB
resources.py 272KB
labelGo.py 73KB
datasets.py 41KB
common.py 33KB
general.py 30KB
canvas.py 26KB
tf.py 20KB
plots.py 18KB
yolo.py 15KB
metrics.py 13KB
torch_utils.py 13KB
augmentations.py 11KB
loss.py 10KB
autoLabeler.py 9KB
autoanchor.py 7KB
label_to_csv.py 7KB
shape.py 6KB
export.py 6KB
labelFile.py 6KB
pascal_voc_io.py 6KB
downloads.py 6KB
callbacks.py 6KB
google_utils.py 5KB
yolo_io.py 5KB
experimental.py 4KB
test_io.py 4KB
create_ml_io.py 4KB
activations.py 4KB
setup.py 3KB
labelDialog.py 3KB
utils.py 3KB
yolo2voc.py 3KB
stringBundle.py 3KB
colorDialog.py 1KB
settings.py 1KB
toolBar.py 1KB
resume.py 1KB
restapi.py 1KB
test_stringBundle.py 1KB
共 163 条
- 1
- 2
资源评论
hakesashou
- 粉丝: 4192
- 资源: 1083
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功