Skip to content

Show camera feed and annotations of the AIY Vision Kit in a webpage

License

Notifications You must be signed in to change notification settings

chadwallacehart/aiy_vision_web_server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIY Vision Kit Web Service

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.

example image

Architecture

project architecture

Installation

  1. Buy a AIY Vision Kit
  2. Follow the Vision Kit Assembly Guide to build it
  3. Install UV4L (see the next section)
  4. Install git if you don't have it: sudo apt-get install git
  5. Clone the repo: git clone https://github.com/webrtcHacks/aiy_vision_web_server.git
  6. Go to the directory: cd aiy_vision_web_server/
  7. Install Python dependencies: sudo python3 setup.py install
  8. Turn the default Joy Detection demo off: sudo systemctl stop joy_detection_demo.service
  9. Run the server: python3 server.py
  10. Point your web browser to http://raspberrypi.local:5000 or whatever you set your hostname or IP address to

UV4L Installation

Raspberry Pi Zero

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

Raspberry Pi 2 and 3

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

Command Line Options

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

About

Show camera feed and annotations of the AIY Vision Kit in a webpage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 48.7%
  • JavaScript 47.9%
  • HTML 2.9%
  • Shell 0.5%