This repository contains several CNNs for semantic segmentation (U-Net, SegNet, ResNet, FractalNet) using Keras library. The code was developed assuming the use of depth data (e.g. Kinect, Asus Xtion Pro Live).
This project has been included in the paper "Convolutional Networks for Semantic Heads Segmentation using Top-View RGB-D Data in Crowded Environment" accepted in Internation Conference on Pattern Recognition (ICPR), 2018.
You can test these scripts on the following datasets:
Provided data is processed by data.py
script. This script just loads the images and saves them into NumPy binary format files .npy
for faster loading later.
python data.py
The provided models are basically a convolutional auto-encoders.
python train_fractal_unet.py
python train_resnet.py
python train_segnet.py
python train_unet.py
python train_unet2.py
python train_unet3_conv.py
python train_unet4.py
These deep neural network is implemented with Keras functional API.
Output from the networks is a 96 x 128 which represents mask that should be learned. Sigmoid activation function makes sure that mask pixels are in [0, 1] range.
You can test the online prediction with an OpenNI registration (.oni
file).
python online_prediction.py --v <oni_video_path>
sudo apt-get install python3-pip python3-dev python-virtualenv # for Python 3.n
virtualenv -p python3 deepseg
. deepseg/bin/activate
The preceding command should change your prompt to the following:
(deepseg)$
Install TensorFlow in the active virtualenv environment:
pip3 install --upgrade tensorflow-gpu # for Python 3.n and GPU
Install the others library:
pip3 install --upgrade keras scikit-learn scikit-image h5py opencv-python primesense
- Daniele Liciotti | GitHub
- This work is partially inspired by the work of jocicmarko.