Since 2012, when Alex Krizhevsky has published his ground breaking AlexNet, Deep Learning toolsets made a long way from just a bunch of CUDA C++ files to a great and easy-to-use frameworks like Tensorflow and Caffe, staffed with already implemented powerful architectures like UNet or SSD .

There are also a lot of freely available datasets from different areas, like sign recognition or image captioning.

Now everyone can build and train their very own model. With all that stuff here and now — what could possible go wrong?

Cooking data may be hard.

Unfortunately, there are a few things you should worry about:

First, you need to obtain interesting dataset. Sometimes, it’s not an easy task, because some links are broken and some datasets require you to send request and wait for a few days (or weeks, or forever). You gotta be cautious with statistics and distributions. It’s really easy to spend a lot of time training your model with no results if don’t know your data well. Sometimes you want to annotate something specific, that is not already there on public dataset. For example, you could label car plates with actual license plate number or mark road defects. More data is better (in Deep Learning). It’s always a good idea to combine a few datasets together to make training easier. Of course, you should first do some pre-processing: for example, in one dataset you have just “Vehicle”, while in another you have “Car”, “Bike” and “Bus”. Re-mapping class labels is a must-do. Augmentations is also a great idea of how you could make your data bigger. And yes, most frameworks don’t have that feature ready to use.

Here at Deep Systems we come across this kind of difficulties everyday. Preparing data is not the fun part of building a model — but very important, so we created a service that would help to solve all those problems above (and much more!).

In this article we want to introduce you to Supervise.ly and show you an example of a real-world problem: we will train our very own road segmentation model on combination of several publicly available datasets with the help of Tensorflow, Keras and promising architecture called UNet.

Disclaimer: you can skip the Supervise.ly data preparation part and do it on your own, but it would probably take much more time.

Preparing Cityscapes

Cityscapes is a street scenes dataset from 50 cities. It has 5000 high quality annotated frames and 30 classes like “Sidewalk” or “Motorcycle”.

Cityscapes annotation example

What makes it different from similar datasets is that Cityscapes provides annotations in form of polygons and points, not just large bitmaps.

Step 1: Download dataset

You can obtain dataset here — you will probably have to wait a day or two to get a conformation link: dataset license doesn’t allow distribution.

After you get login, download the following archives: gtFine_trainvaltest.zip (241MB) and leftImg8bit_trainvaltest.zip (11GB) .

We only interested in pixel-level subset of Cityscapes dataset, so you don’t have to download other archives.

Now unpack downloaded archives into a folder so you will end with the following structure:

Both gtFine and leftImg8bit contain folders like train and val , and these folders contain folders-cities, like aachen .

As you can see, Cityscapes is a big dataset. If you want, you can complete this tutorial with the whole Cityscapes dataset, but we suggest to leave only a few cities: at least, for the first try. So, in the end, you should have something like this:

$ tree -d

.

├── gtFine

│ ├── train

│ │ ├── aachen

│ │ ├── bochum

│ │ └── bremen

│ └── val

│ └── frankfurt

└── leftImg8bit

├── train

│ ├── aachen

│ ├── bochum

│ └── bremen

└── val

└── frankfurt

Pack this whole directory into a new archive in one of supported Supervisely import formats : .zip , .tar or .tar.gz . Now we are ready to move forward.

Step 2: Signup to Supervise.ly

Create an account — it takes just a minute and completely free.

Signup page

Step 3: Import Cityscapes dataset

Great! Right now you have no datasets in Supervisely — it’s time to create your first one. You can upload your own images, but for now we will use Cityscapes. Open “Import” page and select “Open-source dataset format” option. We support several most popular public datasets. Choose “Cityscapes”. At the right side you will see an example of archive you would have to upload — this is the file, we’ve created in the first step.