video cnn

video cnn

WORK IN PROGRESS …

Setup Raspberry Pi with camera as client with camera …

Install Python 3.7

# install some required packages
sudo apt install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev python-dev
# download the Python 3.7.1 tar ball and unpack it
wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
tar -xzvf Python-3.7.1.tgz
# now build and install
cd Python-3.7.1/
./configure
make -j 4 # RPi3 has 4 cores
sudo -H make altinstall

Now setup an environment for Python 3.7 and activate it

cd
python3.7 -m venv py37
source py37/bin/activate

Install required packages, update pip and some install the libraries to work with

sudo apt-get install libjpeg-dev zlib1g-dev
pip install --upgrade pip
pip install picamera jupyterlab 
# optional pillow

From your main computer with GPU ssh into the raspberry opening a tunnel for port 8888

ssh -L 8888:localhost:8888 10.1.69.200

and then on the Raspberry Pi start jupyter lab

source py37/bin/activate
jupyter lab

Copy and paste the Url that it spits out into your main computer's browser (something like http://localhost:8888/?token=...)

For more info on picamera check out https://picamera.readthedocs.io/en/release-1.13/recipes1.html

For more info on sockets in Python see https://docs.python.org/3/howto/sockets.html

Setup on computer with GPU

# open port 3301 in firewall. This is not permanent. Reboot will close it again. 
sudo ufw allow from any to any port 33001 proto tcp

Leave a Reply

Your email address will not be published. Required fields are marked *