Display the video feed and annotations of the AIY Vision Kit face detection or object detection models from the PiCamera to any web page using WebRTC and UV4L.
See the Part 2: Building a AIY Vision Kit Web Server with UV4L webrtcHacks post for more details.
- Buy a AIY Vision Kit
- Follow the Vision Kit Assembly Guide to build it
- Install UV4L (see the next section)
- Install git if you don't have it:
sudo apt-get install git
- Clone the repo:
git clone https://github.com/webrtcHacks/aiy_vision_web_server.git
- Go to the directory:
cd aiy_vision_web_server/
- Install Python dependencies:
sudo python3 setup.py install
- Turn the default Joy Detection demo off:
sudo systemctl stop joy_detection_demo.service
- Run the server:
python3 server.py
- Point your web browser to http://raspberrypi.local:5000 or whatever you set your hostname or IP address to
curl http://www.linux-projects.org/listing/uv4l_repo/lpkey.asc | sudo apt-key add -
echo "deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/stretch stretch main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y uv4l uv4l-raspicam uv4l-raspicam-extras uv4l-webrtc-armv6 uv4l-raspidisp uv4l-raspidisp-extras
curl http://www.linux-projects.org/listing/uv4l_repo/lpkey.asc | sudo apt-key add -
echo "deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/stretch stretch main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y uv4l uv4l-raspicam uv4l-raspicam-extras uv4l-webrtc uv4l-raspidisp uv4l-raspidisp-extras
They following options are available after python server.py
:
Verbose switch | Short switch | Default | Description |
---|---|---|---|
--model MODEL | -m MODEL | face | Sets the model to use: face or object |
--cam-mode CAM_MODE | -c CAM_MODE | 5 | Sets the Pi Camera Mode |
--framerate FRAMERATE | -f FRAMERATE | 15 | Sets the camera frame rate |
--hres HRES | -hr HRES | 1280 | Sets the horizontal resolution |
--vres VRES | -vr VRES | 720 | Sets the vertical resolution |