It’s remarkable, how quickly technology moves. A few years ago, AI vision development kits would cost you an arm and leg and have a footprint of a mini-computer, but in 2021, these things can be enclosed in devices barely bigger than your thumb. M5Stack UnitV2 is just that – an AI vision and Edge Computing platform that you can put inside your pocket. If you ever wanted to try AI vision and play with Edge computing, it’s the easiest way to try things out.
M5Stack UnitV2
You won’t believe how small it is until you see one in your hands. It’s an ARM-based dual-core Cortex A7 device clocked at 1.2Ghz wrapped in a shell so small that raised the doubts of my colleagues about its stand-alone AI capabilities. Rest assured, it can! A closer look at the spec sheet reveals a really powerful device, and the departure from ESP32 chips usually present in other M5Stack development boards:
AI core | Sigmstar SSD202D |
CPU | Dual Cortex-A7 1.2Ghz Processor |
RAM | 128MB DDR3 |
Storage | 512MB NAND Flash + microSD |
Camera | GC2145 1080P Colored Sensor |
WiFi | 150Mbps 2.4GHz 802.11 b/g/n |
Other | Microphone, USB-C, Grove connector, microSD card reader |
M5Stack continues to innovate. M5Stack UnitV2 is slightly bigger than M5StickC PLUS (review) aptly called by me: the most featured ESP board per mm². This board can singlehandedly capture images, resolve them using AI models uploaded to the board and deliver JSON formatted results over WIFI or USB-C.
I expect these to sell out like fresh buns, so here are official stores across different pages where you can try to get yours:
- M5Stack UnitV2 (official)
- M5Stack UnitV2 on AliExpress
- M5Stack UnitV2 on Banggood
Other M5Stack products talked about in detail:
- M5Stack Core
- M5Stack Core 2
- M5Stack UnitV2
- M5Dial
- M5Stack Atom Matrix (pending)
AI vision and Edge Computing
M5Stack has a strong history of making programming as accessible as possible. Their UIFlow turns to tinker with ESP devices into wireless magic thanks to OTG programming and built-in batteries. Playing with M5Stack UnitV2 is no different. To get started, all you need is a web browser.
The web server created by the device (10.254.239.1 or unitv2.py) will load the camera interface with basic settings, a preview of the output and over a dozen operational modes to test with your camera straight away.
- Audio FFT
- Code Detector
- Face Detector
- Lane Line Tracker
- Motion Tracker
- Shape Matching
- Camera Stream
- Online Classifier
- Color Tracker
- Face Recognition
- Target Tracker
- Shape Detector
- Object Recognition
At the time of the writing, there is a glitch in the firmware which disabled the WiFi on my unit, but I reached out to the M5Stack team and they are aware of the issue. This should be resolved soon. For the time being, I’m using the USB-C to access the interface.
M5Stack UnitV2 connects via USB-C and creates WiFi AP which you can connect to and configure to your liking. Then the data stream is available via serial port or
Update 10/09/2021
New firmware is available for UnitV2m which brings WiFi connectivity to the device. Check out a dedicated guide to WiFi and how to make the credentials persist when the device loses power. M5Stack is aware of the issues I run into and they are working on the fix, until then follow the guide to bypass the issue.
Web interface
If you load up the web interface, you will see access to all tools available on the device. The web interface can be used to troubleshoot and aid your development, as for the most part, you will be working with JSON formatted results. If you are new to JSON, I have a quick guide here to get you started.
The interface lets you try and preview all listed above mode and monitor the payloads submitted by M5Stack UnitV2 in real-time. It’s a great tool to visualise what M5Stack UnitV2 sees and refine the AI vision process in your code.
Extra options allow you to upload your training models and work with more than one. Be aware that depending on the model and calculations this can slow down the rate at which M5Stack UnitV2 delivers the results.
M5Stack UnitV2 will display a resized 480p stream in the web browser and draw up overlays indicating found shapes and objects by the AI training models. Included models are pretty fast and update at 15fps. It’s pretty impressive if you consider that the device is barely bigger than your thumb. It displays the capability of the device pretty well. For more specific tasks you are expected to create your own recognition models.
The video stream is available through the web browser and you can access it through:
http://unitv2.py/video_feed
or
http://10.254.239.1//video_feed
Jupiter
Jupiter is a web-based notepad/IDE which you can use to quickly test or modify the behaviour of your code without going back and forth between M5Stack UnitV2 and the computer. It’s handy for smaller edits, but if you want to take full advantage of AI vision, use proper IDE for MicroPython & Python 3.8.
M5Stack has a basic guide for Jupiter too so you won’t feel lost if you never used it before. Feel free to try their basic examples to understand the programming flow and get a better grasp of things. If Jupiter isn’t sufficient, you can always SSH into M5Stack UnitV2 and interact with it like with any other Linux machine.
ssh m5stack@10.254.239.1
//user: m5stack
//pwd: 12345678
//user: root
//pwd: 7d219bec161177ba75689e71edc1835422b87be17bf92c3ff527b35052bf7d1f
AI training
The development board is only as good as the tools given to work with. For ESP32 based boards, we have UIFlow to turn programming into OTG magic, but for M5Stack UnitV2 we have something cool too! A dedicated training engine that lets you train image recognition to achieve specific goals.
While the training process is relatively simple: upload and annotate the pictures, download a training model file. Digital elbow grease and time is required. Bigger the picture sample, the better the training model is. Online guides suggest batches of 30-50 images to use and annotate to get reasonably good training models.
M5Stack V2 training module is browser-based and creates the training models for you, but the task of collecting the right pictures and annotating the targets correctly lays with you. It’s a possible time sink, but if you want to get great results, expect to put the time in.
There are built-in tools that will speed up annotating process (COCO SSD) which use rectangles to mark up objects on your uploaded pictures, but you are in charge of assigning the labels to it. You will need at least 30 pictures, the process takes about 10 min and it’s recommended that pictures are of similar quality to what your testing scenario will look like.
I won’t dive into much details in this article, as I’m planning an entire project that will show you how to use AI vision to order your M5Stack UnitV2 now and follow along when the project is out!
What can you do with it?
The use of AI vision is unlimited. M5Stack UnitV2 is too slow to turn your car into a driverless machine, but there are many projects that you can use this platform for. I have a couple of ideas that I would like to try down the line once I feel more comfortable with it:
- AI Doorbell – with the ability to recognise faces, couriers and possibly unwanted guests
- RC car – it may not be fast enough for real cars, but you can try with RC cars
- Sorting systems – sorting items by shape, colour etc
- and more
If you would like to see how M5Stack UnitV2 handles traffic recognitions, I have uploaded the full video to my 2nd YouTube channel. You will be able to compare different training models and the speed it is able to process the data.
Final thoughts
I’m waiting for the WiFi fix, as I want to take the camera to my garden. I would like to train the AI to recognise the birds feeding of my feeder and log the feed event times for each species to find out what birds eat the most of the grain and nuts. For that, I will need WiFi to interact with the camera remotely. M5Stack UnitV2 (official, AliExpress, Banggood) is a great little device to get you started with AI vision. At $75 it’s reasonably priced and if the support as good as it has been with M5Paper (review), we should expect the fixes soon. In the package from M5Stack, I also got Core Ink (review pending) and Core2 (review pending) devices, which I’m going to covers soon. What would you use M5Stack UnitV2 for? Let me know in this Reddit thread.
🆓📈 – See the transparency note for details.