Introduction

NKL (short for NanKai Lines) is a dataset for semantic line detection. Semantic lines are meaningful line structures that outline the conceptual structure of natural images.

The NKL dataset contains 5,000 images of various scenes. Each of these images is annotated by multiple skilled human annotators. The dataset is split into training and validation subsets. There are 4,000 images in the training set and 1,000 in the validation set.

Statistics of NKL compared to the SEL[1] dataset.
Dataset Total
(#Images / #Lines)
Training
(#Images / #Lines)
Validation
(#Images / #Lines)
SEL [1] 1,715 / 2,791 1,541 / 2,493 174 / 298
NKL (Ours) 6,500 / 13,148 5,200 / 10,498 1,300 / 2,650

Below is the category distribution of SEL [1] and NKL datasets. Category labels are obtained by passing the images into a Places365 [2] pretrainedmodel. There are 288 (out of 365) scene labels presented in NKL dataset, in contrast to 167 in SEL dataset. The labels of NKL are also more fairly distributed compared to that of SEL [1].

Files and Annotations

The images and annotations are organised into a single zip file http://data.kaizhao.net/projects/deep-hough-transform/NKL.zip (MD5SUM: 2e2dc0c8f4b995e4baa0afc9f30915e7). After download and decompression, the directory structure is as below:

├── train
│   ├── 1.jpg
│   ├── 1.txt
│   ├── ...
│   └── ...
└── val
├── 4001.jpg
├── 4001.txt
├── ...
└── ...


where 'xxx.txt' is the annotation.

Each annotation is a single line text file with format: n x11 y11 x12 y12 ... xn1 yn1 xn2 yn2 where n is the number of lines and xn1 yn1 xn2 yn2 are the coordinates of endpoints of the n-th line.

Below is the example code to mask the line annotations to the image for visualization:

from PIL import Image, ImageDraw
im = Image.open("1.jpg")
N = int(lines[0])
lines = np.delete(lines, 0)
lines = np.reshape(lines, (N, 4)).astype(int)
draw = ImageDraw.Draw(im)
for l in range(N):
draw.line(lines[l, :].tolist(), fill="red", width=4)
im.save("1-visualization.jpg")


Bibliography:

@article{han2020deep,
title={Deep Hough Transform for Semantic Line Detection},
author={Zhao, Kai and Han, Qi and Zhang, Chang-bin and Xu, Jun and Cheng, Mingg-Ming},
journal={arXiv preprint arXiv:2003.04676},
year={2020}
}

References:

1. Lee JT, Kim HU, Lee C, Kim CS. Semantic line detection and its applications. InProceedings of the IEEE International Conference on Computer Vision 2017 (pp. 3229-3237).
2. Zhou, B., Lapedriza, A., Khosla, A., Oliva, A. and Torralba, A., 2017. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 40(6), pp.1452-1464.

(The comment system is provided by Disqus that is blocked by the GFW. For users from mainland China you may need a VPN.)