Skip to content

Photogrammetry-based data synthesis for object-to-model deep learning

License

Notifications You must be signed in to change notification settings

mforcexvi/3D-DL

Repository files navigation

Photogrammetry-based data synthesis for object-to-model deep learning

About the project

The availability of large image data sets has been a crucial factor in the recent success of deep learning-based classification and detection methods. Yet, while data sets for everyday objects (e.g. ImageNet, Microsoft Coco) are widely available, data for specific use-cases (e.g. identifying packaged products in a warehouse) remains scarce. In such cases, the data sets have to be created from scratch.

We present a novel framework for using photogrammetry-based data synthesis to create an end-to-end deep learning pipeline, beginning with real-world objects and culminating in a trained model.

Our method is based on the generation of training images from 3D models obtained by applying photogrammetry to photographs of real-world objects, generally using less than 40 images per object. Using 100k synthetic images, an InceptionV3 convolutional neural network (CNN) was trained, which achieved accuracy of 96% on a separately acquired test set of real images. The image generation process supports automatic pixel annotation. This eliminates the prohibitively expensive manual annotation typically required for detection tasks. Based on this readily available data, a one-stage RetinaNet detector was trained on the synthetic, annotated images to produce a detector that can accurately localize and classify the specimen products in real-time.

Components

This repository contains all the components required to implement the pipeline explained in the paper. It also includes two front-end implementations, a Flask Web Server and an iPhone App, allowing users to perform detection/classification using a trained model.

  • Rendering API
  • Training pipeline
  • Evaluation
  • Flask server
  • iPhone App

The short demo video can be found here

Production Recognition (Classification)

Production Recognition (Detection)

Installation & Dependencies

Activate correct CUDA version to link TF to GPU

create a file in your home directory called .bash_profile with content and save:

if [ -f /vol/cuda/8.0.61-cudnn.7.0.2/setup.sh ]
then
   . /vol/cuda/8.0.61-cudnn.7.0.2/setup.sh
fi

(The above code is for Imperial Collge London Lab PC environment)

then log out and log in again or restart bash.

Create Virtual Environment

The first step is to install virtualenv.

pip install virtualenv

The next is to initialise the virtual environment with

virtualenv -p python3 venv

Get into the virtualenv

source venv/bin/activate

Install all the dependencies within the virtual environment.

pip install -r requirements.txt

How to run each program

Integrated Pipeline: main.py

provide paths to validation and test set, currently pointing to the example folders provided with this repository.

provide the path to your blender installation in bl_path = 'PATH/TO/BLENDER/INSTALLATION'

Choose all parameters in main.py for rendering and neural network training, save and run

$python main.py

Rendering API

README can be found in /src/rendering.

Training and Evaluation

README can be found in /kerasmodels.

iPhone App

README can be found in /iPhone_app.

Flask

README can be found in /flask_webserver.

Project Team Members

Should you have any questions regarding how to run the above, please contact one of the project team members.

About

Photogrammetry-based data synthesis for object-to-model deep learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published