Skip to main content

Automatic detection and semantic image segmentation with deep learning

Project description

This project aims at showcasing some Deep Learning use cases in terms of image analysis, especially regarding semantic segmentation.

If you want to get more details on Oslandia activities around this topic, feel free to visit our blog. You certainly want to discover some of our results in the associated web application:

Content

The project contains the following folders:

  • deeposlandia contains the main Python modules to train and test convolutional neural networks
  • docs contains some markdown files for documentation purpose
  • 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
  • tests; pytest is used to launch several tests from this folder.

Additionally, running the code may generate extra subdirectories in the chosen data repository.

Installation

Requirements

The code has been run with Python 3. The dependencies are specified in setup.py file, and additional dependencies for developing purpose are listed in requirements-dev.txt.

From source

$ git clone https://github.com/Oslandia/deeposlandia
$ cd deeposlandia
$ virtualenv -p /usr/bin/python3 venv
$ source venv/bin/activate
(venv)$ pip install -r requirements-dev.txt

GDAL

As a particular case, GDAL is not included into the setup.py file.

For Ubuntu distributions, the following operations are needed to install this program:

sudo apt-get install libgdal-dev
sudo apt-get install python3-gdal

The GDAL version can be verified by:

gdal-config --version

After that, a simple pip install GDAL may be sufficient, however considering our own experience it is not the case on Ubuntu. One has to retrieve a GDAL for Python that corresponds to the GDAL of system:

pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
python3 -c "import osgeo;print(osgeo.__version__)"

For other OS, please visit the GDAL installation documentation.

Running the code

A command-line interface is proposed with 4 available actions (datagen, train, infer and postprocess), callable as follows:

deepo [command] --options

Some files document the command use:

Supported datasets

Mapillary

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 in a images repository, and the same images after filtering process in instances and labels repositories.

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.

Example of image, with labels and predictions

AerialImage (Inria)

In the Aerial image dataset, there are only 2 labels, i.e. building or 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.

Example of image, with labels and predictions

Open AI Tanzania

This dataset comes from the Tanzania challenge, that took place at the autumn 2018. The dataset contains 13 labelled images (2 of them were assigned to validation in this project), and 9 additional images for testing purpose. The image resolution is very high (6~8 cm per pixel), that allowing a fine data preprocessing step.

In such a dataset, one tries to automatically detect building footprints by distinguishing complete buildings, incomplete buildings and foudations.

Example of image, with labels and predictions

Shapes

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.

How to add a new dataset?

If you want to contribute to the repo by adding a new dataset, please consult the following instructions.

Pre-trained models

This project implies non-commercial use of datasets, anyway we can work with the dataset emitters to get commercial licences if it fits your demand. May you be interested in any pre-trained models, please contact us at infos+data@oslandia.com!

License

The program license is described in LICENSE.md.


Oslandia, April 2018

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deeposlandia-0.6.2.tar.gz (46.7 kB view details)

Uploaded Source

Built Distributions

deeposlandia-0.6.2-py3.6.egg (126.6 kB view details)

Uploaded Source

deeposlandia-0.6.2-py3-none-any.whl (57.8 kB view details)

Uploaded Python 3

File details

Details for the file deeposlandia-0.6.2.tar.gz.

File metadata

  • Download URL: deeposlandia-0.6.2.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.9

File hashes

Hashes for deeposlandia-0.6.2.tar.gz
Algorithm Hash digest
SHA256 bc40999bcd72db81e374725813b0e7baf6aa6236870e1b506b82a2d0fae78415
MD5 ecfe2cd84eead6cb25de549dee2a4854
BLAKE2b-256 3c681672d6a410a3d3184ddca35e49937fed0fa2b4f5708f681e476978b36d31

See more details on using hashes here.

Provenance

File details

Details for the file deeposlandia-0.6.2-py3.6.egg.

File metadata

  • Download URL: deeposlandia-0.6.2-py3.6.egg
  • Upload date:
  • Size: 126.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.9

File hashes

Hashes for deeposlandia-0.6.2-py3.6.egg
Algorithm Hash digest
SHA256 492c04397d75a557dab83b87c639613b82a4707b7d97c5cfd19de85b55a89645
MD5 eb72de8c621694361dc34c45569ec52e
BLAKE2b-256 3558f3e661e05a7a05a8f04eda46cdfe533b717547ed3108bce3098976aa40cd

See more details on using hashes here.

Provenance

File details

Details for the file deeposlandia-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: deeposlandia-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 57.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.9

File hashes

Hashes for deeposlandia-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c35744d4b796f9a30dfab955dec6b0470dd679b7a1f9584ed8e7c80e4612d7a7
MD5 1f64d3ae83fc11780938fe4f01b7ba54
BLAKE2b-256 3f7df4fa80677f895c2220f85ee1854500e7014213fa30569e82a1afcdd41680

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page