Idein / chainer-pose-proposal-net

Chainer implementation of Pose Proposal Networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cool, but how to run it on Pi?

lovehuanhuan opened this issue · comments

Cool, but how to run it on Pi? Could you help me?

Hi, Did you train your model already? Nice.

I wrote a step by step instruction how to run our scripts on Raspberry Pi3.

Setup OS

  • Go to the website to download image of RASPBIAN STRETCH WITH DESKTOP (1.0 GB)
  • write the image into your microSD card. I used Etcher to burn it.
  • Insert the microSD card into your Raspberry Pi3.
    • It will initialize a Desktop Environment.
  • Open terminal and run sudo raspi-config to enable camera and SSH.
    • You are supposed to reboot system of Raspbian after that.

Install Python dependencies

Open a terminal of your Raspberry Pi, and install some packages to install OpenCV using
study-picamera-examples as a reference.

$ sudo apt update
$ sudo apt install -y build-essential cmake pkg-config
$ sudo apt install -y libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
$ sudo apt install -y libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
$ sudo apt install -y libxvidcore-dev libx264-dev
$ sudo apt install -y libgtk2.0-dev libgtk-3-dev
$ sudo apt install -y libatlas-base-dev gfortran
$ sudo apt install -y libqtgui4 libqt4-test
$ sudo apt install -y libilmbase12 libopenexr22 libgstreamer1.0-dev
$ sudo apt install -y python3-dev python3-pip
$ sudo pip3 install numpy opencv-python

Also, we need to install Chainer and some dependencies.

$ sudo pip3 install matplotlib scipy
$ sudo pip3 install numpy -U
$ sudo pip3 install chainer==5.0.0 chainercv==0.11.0

Move the repository

Copy chainer-pose-proposal-net to your Raspberry Pi from your workstation.
The most easy way is to use SSH:

scp -r chainer-pose-proposal-net pi@xxx.xxx.xxx.xxx:~/

Run script

Open a terminal of your Raspberry Pi

$ sudo modprobe bcm2835-v4l2
$ python3 video.py

ta-dah! It will run on your Raspberry Pi.

But please do not expect too much.
It doesn't run fast than you think.

Close this issue due to lack of response.

commented

@terasakisatoshi
Hi, could you tell that if the Raspberry Pi(32bit) support to install ideep4py?

@lxy5513

ideep4py is A Chainer module providing numpy like API and DNN acceleration using MKL-DNN
Where MKL-DNN means Intel(R) Math Kernel Library for Deep Neural Networks (Intel(R) MKL-DNN).

On the other hand, the Raspberry Pi 3 is the successor to the Raspberry Pi 2. It builds upon the Pi 2 by upgrading the ARM cores to Cortex-A53 and adding an onboard single-band 2.4GHz-only wireless chipset.

commented

@terasakisatoshi
Thanks for your explanation!
I want to run docker in my Pi
However, when I build docker in my computer, the docker image can't be used on pi,

error: standard_init_linux.go:190: exec user process caused "exec format error" .

when I build dockerfile in pi,
It can't install scipy package

Stuck when 'Running setup.py bdist_wheel for scipy ... '

Could you tell me the reasons? Thank you a lot.

You must encounter the same problem as follow:

https://stackoverflow.com/questions/44925788/dockerfile-compile-in-local-machine-but-fails-in-docker-hub-for-automated-build

Like I said, RPI does not have Intel CPU as same as your main PC has. When you want to build docker image for RPi, you must introduce cross-compiler or prepare Docker image for Raspberry Pi. If Google it e.g.

  • QEMU
  • cross compiler
  • docker image raspberry pi

you must find other docker image or dockerfile running on RaspberryPi including OpenCV etc.