...
Code Block |
---|
pip3 install -i https://mirrors.aliyun.com/pypi/simple tensorflow pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow |
Install OpenCV
Opencv windows install package page: https://opencv.org/releases/, the download link: https://nchc.dl.sourceforge.net/project/opencvlibrary/4.3.0/opencv-4.3.0-vc14_vc15.exe
click the opencv-4.3.0-vc14_vc15.exe the file , you shoule select the install path . I select the install path is d:\temp, so the opencv install the d:\ temp\opencv.
...
Trian the model
The opencv set the environment variables script is the : setup_vars_opencv4.cmd
...
At first, you must execute the script for setup the opencv environment variables,
...
you can download the attachment file, for train the model,
View file | ||
---|---|---|
|
...
the train.py set up the 5 types of the gestures ,”0”, “1”, “2“, “3“, “4”, 500 pictures of data collected in each type. Hand.h5 file (tensorflow model file) and hand.tflite(tensorflow lite) will be created in the current directory。you press the 'Space' key to start the train .
SP7021 install the Tensorflow-lite and python opencv
Install the python3-opencv
Code Block |
---|
pi@raspberrypi:~$ sudo apt install pyhton3-opencv |
Install the tensorflow lite
Code Block |
---|
pi@raspberrypi:~$ pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl |
View file | ||
---|---|---|
|
Insert the USB camera and download the attachment and copy the model file trained by tensorflow. Put these two files together and execute test.py.