/Pi-Ai

Senior Capstone repo for integrating Raspberry Pi and neural computing stick for real time image processing

Primary LanguagePython

Pi-Ai Object Detection Model

Senior Capstone repo for integrating Raspberry Pi and neural computing stick for real time image processing

Development Dependencies

  • Anaconda

Run the app locally:

  1. Clone the repo.
  2. Run conda env create -f env.yml
  3. Run conda activate piai-env
  4. Run piai.py

Exporting yml environment

Run conda env export > env.yml

Pipeline

  1. Gather training images
  2. Annotate training images using labelImg to get Pascal Voc format (.xml)
  3. use xml_to_csv.py to convert .xml annotations to .csv format
  4. Make test.record and train.record for Tensorflow to use in training
  5. Make a object_detection.pbtxt with labels
  6. Set paths and hyperparameters in pipeline.config file
  7. Train model using Tensorflow (train.py)
  8. View training results in Tensorboard
  9. Create frozen model (export_inference_graph.py)
  10. Run model on set of images (object_detection_tutorial.ipynb)
  11. Make adjustments to pipeline.config, add training images, retrain
  12. Put frozen model on USB, connect to RPi, copy frozen model to RPi
  13. Use openVINO model optimizer to convert frozen_inference_graph.pb file to RPi compatible format
  14. Run model on RPi using Pi camera
  15. From drone, connect battery and use remote connection
  16. View results in real time

alt text

Resources

openVINO:

TensorFlow

LabelImg

Tensorflow GPU install

Training a Custom Model

Guide for TensorFlow 1: