Wednesday, April 08, 2020

Pipal

Objective: Pi bot that recognizes faces and audio commands.

Phase 1:
Phase 2:
  • Audio input.
  • speech to text and google api for NLP.
Phase 3:
  • Train different actions for each person.
Phase 4:
  • Use lidar for depth.
Phase 5:
  • recognize action and correct.
  • cooking, drawing, singing, kolam.


Pre-requisites:
+ Get a Pi-4 with 4 GB ram
+ Get a pi cam

+ Install noobs for Raspbian 10 (it installs python 3.7.3 automatically).
+ Install OpenCV https://qengineering.eu/install-opencv-4.2-on-raspberry-pi-4.html
+ Install docker using the following coomand
$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
+Install Tensorflow
https://www.tensorflow.org/install/source_rpi

while setting the CI_DOCKER_EXTRA_PARAMS, update with the correct python version

CI_DOCKER_EXTRA_PARAMS="-e CI_BUILD_PYTHON=python3 -e CROSSTOOL_PYTHON_INCLUDE_PATH=/usr/include/python3.7" \
    tensorflow/tools/ci_build/ci_build.sh PI-PYTHON3 \
    tensorflow/tools/ci_build/pi/build_raspberry_pi.sh

if you get the following error:
ERRO[0000] failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: permission denied

open ci_build.sh and add
sudo docker instead of docker

Anyway, I was not able to successfully build Tensorflow 2.0.
Endedup going back to pip install, unfortunately https://www.tensorflow.org/install/pip does not have the correct whl file for pi4.
I endedup getting the correct whl from https://maker.pro/raspberry-pi/projects/how-to-set-up-the-machine-learning-software-tensorflow-on-raspberry-pi

below command did the trick:

wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.0.0/tensorflow-2.0.0-cp37-none-linux_armv7l.whl python3 -m pip install tensorflow-2.0.0-cp37-none-linux_armv7l.whl



Note1: Donot buy standard power supply(Output:5V-3000mA) for Pi-4. It doesn't give enough power for accessories. I had problems connecting to keyboard that pulls power from Pi.
I use Samsung phone charger(Output: 9V-1.67A or 5V-2.0A) since Pi4 takes USB-C power input.
Note2: Get a case with heatsink with fan as Pi gets heated easily (https://flirc.tv/more/raspberry-pi-4-case).

Useful links:
https://www.pyimagesearch.com/static/cv_dl_resource_guide.pdf
https://www.pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/


No comments: