Source code for DIAS, P. A.; TABB, A.; MEDEIROS, H. “Multispecies Fruit Flower Detection Using a Refined Semantic Segmentation Network” IEEE Robotics and Automation Letters, vol. 3, no. 4, 2018.
Published in https://ieeexplore.ieee.org/document/8392727
- MATLAB, OpenCV (required by Caffe)
- RGR: to clone already with this submodule, please use the following command
git clone --recurse-submodules https://bitbucket.org/phil_dias/flowernet_iros18.git
- Custom Caffe implementation tailored for DeeplabV2. Available at: https://bitbucket.org/phil_dias/caffe_flowerdeeplab2.git
Option 1: Configure using Docker (recommended): ###
- If you haven't configured docker before, please refer to the official instructions at https://docs.docker.com/install/linux/docker-ce/ubuntu/
To add GPU support to Docker, install nvidia-docker https://github.com/NVIDIA/nvidia-docker
Navigate to "./docker"
To configure Docker container, run the following command (it does take some minutes):
sudo docker build -t caffeflower-docker .
"caffeflower-docker" will be the container name, used in docker_getFeats.sh . It can be replaced by any desired name, as long as the .sh is also updated accordingly.
Option 2: Compile Caffe from source:
- Below is a summary of instructions need for installation. Please refer to official Caffe documentation for more details: https://caffe.berkeleyvision.org/installation.html
- Requires cuda-8.0 and the following packages
- build-essential cmake git libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libboost-all-dev libgflags-dev libgoogle-glog-dev liblmdb-dev python-setuptools python-dev python-pip libopencv-dev
- Configure matio:
cd matio && ./configure && make && make install
- Compile Caffe using cmake:
cd .. && mkdir build && cd build cmake -DBUILD_python=OFF -DBUILD_python_layer=OFF .. make -j`nproc`
- Set getFeats.sh accordingly with the paths where Caffe was installed
We adapted it from: https://github.com/xmyqsh/deeplab-v2.git, which on its turn adapted from https://bitbucket.org/aquariusjay/deeplab-public-ver2
- Run pred_example.m in MATLAB. Code will ask for "sudo" password to deploy Caffe model
- Calls to Docker container take about 30-40sec for initialization, plus ~60sec for processing all portraits generate for example images of 2704x1520 pixels (286 portraits)
- outputs are saved in "output" folder. Subfolders contain
- "./Blend": heatmap of flower likelihood estimated by the model
- "./Binary": segmentation mask with flowers boundaries highlighted in blue
Example of expected outputs: