This project aims at showcasing some Deep Learning use cases in terms of image analysis, especially regarding semantic segmentation.
The project contains the following folders:
- deeposlandia contains the main Python modules to train and test convolutional neural networks
- examples contains some Jupyter notebooks that aim at describing data and building basic neural networks
- images contains some example images to illustrate the Mapillary dataset as well as some preprocessing analysis results
pytestis used to launch several tests from this folder.
Additionally, running the code may generate extra subdirectories in the chosen data repository.
The code has been run with Python 3. All dependencies are specified in
setup.py file, and additional dependencies for developing purpose are listed
$ git clone https://github.com/Oslandia/deeposlandia $ cd deeposlandia $ virtualenv -p /usr/bin/python3 venv $ source venv/bin/activate (venv)$ python setup.py install (venv)$ pip install -r requirements-dev.txt
Running the code
In this project we use a set of images provided by Mapillary, in order to investigate on the presence of some typical street-scene objects (vehicles, roads, pedestrians...). Mapillary released this dataset on July 2017, it is available on its website and may be downloaded freely for a research purpose.
As inputs, Mapillary provides a bunch of street scene images of various sizes
images repository, and the same images after filtering process in
There are 18000 images in the training set, 2000 images in the validation set, and 5000 images in the testing set. The testing set is proposed only for a model test purpose, it does not contain filtered versions of images. The raw dataset contains 66 labels, splitted into 13 categories. The following figure depicts a prediction result over the 13-labelled dataset version.
Aerial image dataset,
there are only 2 labels, i.e.
background and consequently the
model aims at answering one single question for each image pixel: does this
pixel belongs to a building?
The dataset contains 360 images, one half for training one half for
testing. Each of these images are 5000*5000
tif images. Amongst the 180
training images, we assigned 15 training images to validation. One example of
this image from this dataset is depicted below.
To complete the project, and make the test easier, a randomly-generated shape model is also available. In this dataset, some simple coloured geometric shapes are inserted into each picture, on a total random mode. There can be one rectangle, one circle and/or one triangle per image, or neither of them. Their location into each image is randomly generated (they just can't be too close to image borders). The shape and background colors are randomly generated as well.
A Flask Web application may be launched locally through
deeposlandia/run_webapp.py. By default, it is launched on
Some symbolic links are needed to make the application work (in development mode):
deeposlandia/static/sample_imagesmust contain the sample images, depicted on application homepage as well as in demonstration web pages (before new images are generated).
deeposlandia/static/shapesrefers to the server-side repository that contains shapes images and their labels.
deeposlandia/static/mapillary_aggrefers to the server-side repository that contains Mapillary images and their aggregated labels, i.e. 13 labels that summarize the content of the 66 native Mapillary labels.
deeposlandia/static/predicted_imageslinks to a temporary repository (for instance,
/tmp/deeposlandia/predicted/) that contains images generated during the app session as well as their corresponding predicted labelled version.
These symlinks are created when the web application is launched. Their name as
well as their destination are defined in
config.ini, a config file located on
the project root.
The program license is described in LICENSE.md.
Oslandia, April 2018