Your shopping cart is empty!
Face Detection using HuskyLens
- Hao Khee Tan
- 09 Aug 2023
- Tutorial
- Beginner
- 561
In this tutorial, you will learn how to detect faces using HuskyLens and retrieve data to Maker Pi Pico using CircuitPython code. By the end of this tutorial, you will be able to print the number of faces on the HuskyLens screen to the shell, and the LED will light up when a face is detected.
Hardware Required
2. Gravity HuskyLens - AI Machine Vision Camera with Silicone Case
Connection
Maker Pi Pico | HuskyLens |
---|---|
GP9 | T / (Green) |
GP8 | R / (Blue) |
GND | - / (Black) |
VBUS | + / (Red) |
Getting Started
In this tutorial, we will use Thonny editor and CircuitPython to write the code for this project. If you are not familiar with Thonny, check out the video below:
Required Libraries
Download the HuskyLens CircuitPython library from here.
Unzip and place the circuitPyHuskyLib.py file in your CIRCUITPY/lib folder.
You also need to include these libraries in your CIRCUITPY/lib folder.
- adafruit_bus_device
- neopixel.mpy
You can download it from https://circuitpython.org/libraries
All the libraries are placed inside the CIRCUITPY/lib folder.
Code
You can download the code here: face_detection.py
Demo Video
You may view the demo here: https://photos.app.goo.gl/EXL36QkjQr2xuJGB7
Result
- When you point the HuskyLens at faces, it will automatically detect and highlight them with a white frame and display the word "Face" on the screen.
- The shell will also indicate the number of faces that are detected.
- The LED at GP28 (top right corner) will also light up when face is detected.
What you can do with Face Detection?
You can build a face tracking robot with HuskyLens and Robo Pico.
You can refer to this link to get the code for the face tracking robot.