Welcome to RDT-Reader

Quickstart

  1. Enable git LFS so that the models can be downloaded. Refer

  1. Clone this repo into <rdt-reader> .

git clone --recurse-submodules https://github.com/DigitalHealthIntegration/rdt-reader.git
  1. Move the tensorflow-yolov3-models/models sub folder in tensorflow-yolov3/

  2. Extract the folder obj.tar for the dataset used to train the line detection model

  3. For data annotation you can use any tool that you like. We used VOTT version 1.7.2

  4. Install Anaconda 3 to recreate the python enviroment link .

PS: If you come across an error such as Import Error: libGL.so not found then follow the steps below:

sudo apt update

sudo apt install libgl1-mesa-glx

Data Format

Two data formats are used, the first one listed below is to train the object detection model and the second for the red and blue line detection.

  1. Example

  1. You can find an example of the annotations in the labels folder, each file contains annotations for an image with the same base file name in this folder.

Set-up python enviroment

conda create --name <envname> --file spec-file.txt python=3.6 (for windows 64-bit)

                                OR

conda create --name <envname> --file spec-file_linux.txt python=3.6 (for linux 64-bit)

conda activate <envname>

Using service with pretrained models

python flasker.py

A local flask server will be setup running on localhost:9000.

You can hit this server as described in the documentation here.

There is a saved postman collection (audere_local.postman_collection) in the root directory which can be used to test the API with Postman. Please change the image file to a file that resides on your system.

Train Object recognition model

For detailed instructions please follow the README . Edit the config file first and set the absolute paths correctly. There is a sample dataset in the repo with a few images to train both models. Make sure to change the absolute paths in the annotations.

cd tensorflow-yolov3
python train.py

You will find models being saved in the checkpoint directory.

Freeze Object recognition model for inference

Run the script . Please change the paths to select the newly trained model and new export directory.

Train red-line detection model

python train_blue_red.py

You can change the name and location of the saved model from within the script.

Freeze red-line detection model for inference

Use the script freeze_line_detection module . Please change the paths to select the newly trained model and new export directory.

Indices and tables