# 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:LabelLabelImg是图形图像注释工具和图像中的标签对象边界框
共105个文件
png:39个
py:27个
svg:6个
4星 · 超过85%的资源 89 下载量 25 浏览量
2021-05-10
14:43:15
上传
评论
收藏 6.29MB ZIP 举报
温馨提示
标签图 LabelImg是图形图像注释工具。 它是用Python编写的,并将Qt用于其图形界面。 批注以PASCAL VOC格式( 所使用的格式)另存为XML文件。 此外,它还支持YOLO和CreateML格式。 安装 从源代码构建 Linux / Ubuntu / Mac至少需要 ,并已通过进行了测试。 但是,强烈建议使用以及 。 的Ubuntu Linux的 Python 3 + Qt5 sudo apt-get install pyqt5-dev-tools sudo pip3 install -r requirements/requirements-linux-python3.txt make qt5py3 python3 labelImg.py python3 labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE] 苹果系统 P
资源详情
资源评论
资源推荐
收起资源包目录
labelImg:LabelLabelImg是图形图像注释工具和图像中的标签对象边界框 (105个子文件)
test.512.512.bmp 257KB
setup.cfg 97B
.gitignore 250B
.gitignore 108B
.gitignore 9B
app.icns 8B
MANIFEST.in 300B
demo3.jpg 89KB
demo.jpg 57KB
臉書.jpg 747B
LICENSE 1KB
Makefile 520B
README.md 3KB
README.md 454B
issue_template.md 145B
demo5.png 3.09MB
demo4.png 2.71MB
app.png 31KB
prev.png 30KB
next.png 30KB
feBlend-icon.png 8KB
format_createml.png 4KB
resetall.png 4KB
close.png 3KB
verify.png 3KB
save-as.png 3KB
labels.png 2KB
color_line.png 2KB
fit.png 2KB
done.png 2KB
cancel.png 2KB
open.png 2KB
undo.png 2KB
undo-cross.png 2KB
quit.png 2KB
help.png 2KB
delete.png 1KB
color.png 1KB
fit-width.png 1KB
eye.png 1KB
save.png 1KB
zoom.png 1KB
objects.png 1KB
fit-window.png 1KB
zoom-in.png 1KB
edit.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.properties 2KB
strings-zh-CN.properties 2KB
strings-zh-TW.properties 2KB
labelImg.py 65KB
canvas.py 26KB
label_to_csv.py 7KB
shape.py 6KB
labelFile.py 6KB
pascal_voc_io.py 6KB
yolo_io.py 5KB
test_io.py 4KB
create_ml_io.py 4KB
setup.py 3KB
labelDialog.py 3KB
utils.py 3KB
stringBundle.py 2KB
colorDialog.py 1KB
settings.py 1KB
toolBar.py 1KB
test_stringBundle.py 1KB
combobox.py 967B
hashableQListWidgetItem.py 784B
test_settings.py 782B
zoomWidget.py 780B
test_utils.py 723B
constants.py 668B
ustr.py 534B
test_qt.py 310B
__init__.py 76B
__init__.py 0B
resources.qrc 2KB
README.rst 10KB
README.zh.rst 6KB
HISTORY.rst 2KB
CONTRIBUTING.rst 83B
envsetup.sh 2KB
build-windows-binary.sh 882B
build-for-macos.sh 724B
build-for-pypi.sh 680B
build-ubuntu-binary.sh 656B
run-in-container.sh 383B
save-as.svg 63KB
labels.svg 36KB
save.svg 30KB
done.svg 22KB
open.svg 18KB
共 105 条
- 1
- 2
花花鼓
- 粉丝: 34
- 资源: 4646
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2