CocoStuff—基于Deeplab训练数据的标定工具【一、翻译】(未完)

一、CocoStuff简介

CocoStuff是一款为deeplab设计的,运行在Matlab中的语义标定工具,其标定结果和结合Deeplab训练出的结果均为mat文件格式,该项目源码已在github上进行开源。

二、说明

本文为系列博客第一篇,主要对项目readme进行简单的翻译,主要是为了自己在学习踩坑过程中方便查阅说明,如果能帮到大家便是极好的。
*注:未完,部分只是先扔上来,将来会继续完善。

笔者在探索之前并未在网上搜索到关于CocoStuff的相关中文博客,所以这可能是第一篇,有那里不到位的请多多指教,互相学习。

三、翻译

COCO-Stuff 10K数据集 v1.1(目前已过时)

作者:Holger Caesar, Jasper Uijlings, Vittorio Ferrari

概述

欢迎来到COCO-Stuff数据集的官方主页。COCO-Stuff添加了像素级标定(标注)的流行的COCO数据集,这些标注可以用于一些像语义分割、对象检测和图像字幕的场景理解任务。

目录

亮点
更新
成果和未来计划
数据集
语义分割模型
标定工具
Misc(未翻)

亮点

10,000张来自COCO的复杂图像

稠密的像素级标注

91个things类和91个stuff类

实例级标注来自COCO的的数据

物与物的复杂空间环境

每幅coco的图片有5句说明

更新

2017年7月11日:添加了Resnet和VGG的Deeplab模型

2017年4月6日:数据集版本1.1:修改标签指数

2017年3月31日:发布JSON格式的标注

2017年3月9日:添加标签层次脚本

2017年3月8日:更正arXiv 文件中的table 2

2017年1月10日:在标注工具中添加了提取SLICO超级像素的脚本

2016年12月12日:发布数据集版本1.1和arXiv文件

成果

目前发布的COCO-Stuff-10K版本包括训练和测试的标注,以及我们邀请用户向我们报告他们的结果用来补充这张表。在不久的将来,我们会将COCO-Stuff扩展到COCO的所有图像中,并且我们会组织一个官方比赛,在比赛中的测试标注只会被组织者所知道。
点击此处查看最新表格

Method Source Class-average accuracy Global accuracy Mean IOU FW IOU
FCN-16s [3] [1] 34.0% 52.0% 22.7% -
Deeplab VGG-16 (no CRF) [4] [1] 38.1% 57.8% 26.9% -
FCN-8s [3] [6] 38.5% 60.4% 27.2% -
DAG-RNN + CRF [6] [6] 42.8% 63.0% 31.2% -
OHE + DC + FCN+ [5] [5] 45.8% 66.6% 34.3% 51.2%
Deeplab ResNet (no CRF) [4] - 45.5% 65.1% 34.4% 50.4%
W2V + DC + FCN+ [5] [5] 45.1% 66.1% 34.7% 51.0%

数据集

Filename Description Size
cocostuff-10k-v1.1.zip COCO-Stuff dataset v. 1.1, images and annotations 2.0 GB
cocostuff-10k-v1.1.json COCO-Stuff dataset v. 1.1, annotations in JSON format (optional) 62.3 MB
cocostuff-labels.txt A list of the 1+91+91 classes in COCO-Stuff 2.3 KB
cocostuff-readme.txt This document 6.5 KB
Older files
cocostuff-10k-v1.0.zip COCO-Stuff dataset version 1.0, including images and annotations 2.6 GB

用法

为了使用COCO-Stuff数据集,请按照下面的步骤:

  1. 从git上下载项目:git clone https://github.com/nightrome/cocostuff10k.git

  2. 在shell中打开数据集:cd cocostuff10k

  3. 如果你有Matlab,执行下面的命令:
    把代码文件添加到Matlab路径中:startup();
    在Matlab中运行脚本demo:demo_cocoStuff();
    这个脚本显示图像、图像内容、内容加标注以及图像标题。

  4. 或者,运行下面的Linux命令或手动下载解压数据集:
    wget --directory-prefix=downloads http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/cocostuff-10k-v1.1.zip
    unzip downloads/cocostuff-10k-v1.1.zip -d dataset/

MAT格式

COCO-Stuff的标注是储存在每张图对应的.mat文件中,这些文件的格式和Tighe等人使用的格式相同。每个文件包括以下字段:

S: 像素化的标签地图的尺寸

names:COCO-Stuff中的东西的名字和类别,更多详情请看Label Names & Indices

captions:图片标题,由5个不同的人平均标注

regionMapStuff:与S大小相同的映射,恰中包含大约值的索引,1000个区域用来注释图像。

regionLabelStuff:每个超级像素级的物品标签的列表,这些regionMapStuff的索引都对应regionLabelStuff的条目。

JSON格式

另外,我们还提供了JSON格式的标注,这些标注是从COCO中复制出来的。我们使用RLE编码格式,将图像中呈现的每种东西的类别都标注了单个注释。要获取标注:
wget--directory-prefix=dataset/annotations-json http://calvin.inf.ed.ac.uk/wpcontent/uploads/data/cocostuffdataset/cocostuff-10k-v1.1.json

或者用这个脚本从.mat文件中提取它们

标签名称&指数

为了与COCO兼容,版本1.1有91个东西类(1-91),91个东西类(92-182)和一个类“未标记”(0)。请注意,Coco2015中的11个Thing类没有任何分段注释。课桌、门和镜子既可以是东西,也可以是东西,因此既可以是可可,也可以是可可。为了避免混淆,我们在coco-thing中的那些类中添加了后缀“-东西”。类的完整列表可以找到这里.。旧版的COCO-东西1.0有80个东西类(2-81个),91个东西类(82-172个)和一个类“未标记”(1)

Label等级体系

标签的层次结构存储在CocoStuffClass‘中。为了使其可视化,在matlab中运行CocoStuffClasses.showClassHierarchyStuffThings()`(也可用于简单的东西和东西类)。输出应该类似于下面的图

语义分割模型

为了鼓励对stuff and things的进一步研究,我们提供了经过训练的语义分割模型

DeepLab VGG-16

Use the following steps to download and setup the DeepLab [4] semantic segmentation model trained on COCO-Stuff. It requires deeplab-public-ver2, which is built on Caffe:

  1. Install Cuda. I recommend version 7.0. For version 8.0 you will need to apply the fix described here in step 3.
  2. Download deeplab-public-ver2: git submodule update --init models/deeplab/deeplab-public-ver2
  3. Compile and configure deeplab-public-ver2 following the author's instructions. Depending on your system setup you might have to install additional packages, but a minimum setup could look like this:
  • cd models/deeplab/deeplab-public-ver2
  • cp Makefile.config.example Makefile.config
  • Optionally add CuDNN support or modify library paths in the Makefile.
  • make all -j8
  • cd ../..
  1. Configure the COCO-Stuff dataset:
  • Create folders: mkdir models/deeplab/deeplab-public-ver2/cocostuff && mkdir models/deeplab/deeplab-public-ver2/cocostuff/data
  • Create a symbolic link to the images: cd models/deeplab/cocostuff/data && ln -s ../../../../dataset/images images && cd ../../../..
  • Convert the annotations by running the Matlab script: startup(); convertAnnotationsDeeplab();
  1. Download the base VGG-16 model:
  • wget --directory-prefix=models/deeplab/cocostuff/model/deeplabv2_vgg16 http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/deeplabv2_vgg16_init.caffemodel
  1. Run cd models/deeplab && ./run_cocostuff_vgg16.sh to train and test the network on COCO-Stuff.

    DeepLab ResNet 101

    The default Deeplab model performs center crops of size 513*513 pixels of an image, if any side is larger than that. Since we want to segment the whole image at test time, we choose to resize the images to 513x513, perform the semantic segmentation and then rescale it elsewhere. Note that without the final step, the performance might differ slightly.

  2. Follow steps 1-4 of the DeepLab VGG-16 section above.
  3. Download the base ResNet model:
  • wget --directory-prefix=models/deeplab/cocostuff/model/deeplabv2_resnet101 http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/deeplabv2_resnet101_init.caffemodel
  1. Rescale the images and annotations:
  • cd models/deeplab
  • python rescaleImages.py
  • python rescaleAnnotations.py
  1. Run ./run_cocostuff_resnet101.sh to train and test the network on COCO-Stuff.

    标注工具

    在[1]中,我们提出了一个简单而有效的文本注释工具,用于注释可可数据集。它使用画笔工具对SLICO超级像素进行注释(使用带有内容标签的codeofAchantet al.)]进行预计算)。这些注释被现有的来自COCO的像素级事物注释所覆盖。
    我们提供了注释工具的基本版本:
  • 准备需要的数据:
  • 指定一个username annotator/data/input/user.txt.
  • 创建一个图片list文件annotator/data/input/imageLists/<user>.list.
  • 在Matlab中提取所有图片的things标签: extractThings().
  • 在Matlab中提取所有图片的超像素: extractSLICOSuperpixels().
  • 在这个文件的最上面的参数设置是否启用超像素、things标签、多边形绘图CocoStuffAnnotator.m.
  • 在Matlab中运行标注工具: CocoStuffAnnotator();
  • 工具把.mat的标签文件放在这里annotator/data/output/annotations.
  • 通过在Matlab中运行这个脚本将标注预览为.png格式 annotator/code/exportImages.m.这些预览图会存在这里 annotator/data/output/preview.

猜你喜欢

转载自www.cnblogs.com/nightmoonzjm/p/cocostuff_translate.html