Introduction
This project is to show how to detect and recognize buttons in an elevator for robotics.
- Button Detection: tensorflow(<2.0) detection API
- Button Recognition: OCR
- Button Status (On/Off): Mean color value of each button
Environment
$ conda create -n detection python=3.7 pyqt=5
$ conda activate detection
(detection)$ git clone https://github.com/supertigim/elevator_buttons_recognition.g it
(detection)$ cd elevator_buttons_recognition
(detection)elevator_buttons_recognition$ pip install -r requirements.txt
(detection)elevator_buttons_recognition$ mkdir addons && cd addons
(detection)elevator_buttons_recognition/addons$ git clone https://github.com/tzutalin/labelImg.git
(detection)elevator_buttons_recognition/addons$ cd labelImg
(detection)elevator_buttons_recognition/addons/labelImg$ pip install -r requirements/requirements-linux-python3.txt
(detection)elevator_buttons_recognition/addons/labelImg$ cd ../..
(detection)elevator_buttons_recognition$ git clone https://github.com/tensorflow/models.git
When labelImge doesn't work properly,
(detection)elevator_buttons_recognition/addons/labelImg$ sudo apt-get install pyqt5-dev-tools
(detection)elevator_buttons_recognition/addons/labelImg$ sudo pip3 install -r requirements/requirements-linux-python3.txt
(detection)elevator_buttons_recognition/addons/labelImg$ make qt5py3
pyrcc5 -o libs/resources.py resources.qrc
Training
Before training, environment needs to be setup.
(detection)elevator_buttons_recognition$ sudo apt-get install protobuf-compiler
(detection)elevator_buttons_recognition$ cd models/research
# Once done, Don't need to do again
(detection)elevator_buttons_recognition/models/research$ wget -O protobuf.zip https://github.com/google/protobuf/releases/download/v3.0.0/protoc-3.0.0-linux-x86_64.zip
(detection)elevator_buttons_recognition/models/research$ unzip protobuf.zip
(detection)elevator_buttons_recognition/models/research$ protoc object_detection/protos/*.proto --python_out=.
# For each terminal or put it in .bashrc for convenience
(detection)elevator_buttons_recognition/models/research$ export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim