TINKER PiEDESIGN IN INDIA
Advanced

Deploy Your Model to the AI CubeRun a model you trained in Model Studio, on the ESP32-S3 chip, with live results over USB.

You write a short TinkerPie Python program by following the Code guide in the workspace, then press Run. The sample program and step-by-step guide are always there to help.

What you will learn

  • int8 quantization
  • Memory limits of microcontrollers
  • On-device inference speed

What you need

  • TinkerPie AI Cube with Intermediate or Advanced firmware and a USB-C data cable
  • Virtual Cube runs the same int8 model in the browser

Steps

  1. Train a model in Model Studio and save it as "My model" (or use your own name in the program).
  2. Type the program from the Code guide.
  3. Choose AI Cube, connect, and press Run: the model is sent to the cube if it is not there yet.
  4. Compare the speed on the chip and in the browser.

How it works

Your model is stored as 8-bit integers, four times smaller than normal numbers, and uses only integer maths. The browser and the AI Cube run exactly the same steps, so they give the same answer for the same picture. The time per picture shows how fast a microcontroller really is.

Coding concepts

Library
A box of ready-made commands. "import tinkerpie as tp" gives you the AI commands.
Object
A thing with its own commands, like camera or detector. You use them with a dot: camera.start()
Loop
"while True:" repeats the indented lines again and again, once per camera picture.
int8 model
Your model uses 8-bit whole numbers, so it fits in the ESP32-S3.
Timing
guess.ms is how many milliseconds one picture took.

Expected output

Class name and confidence from the model, with inference time in milliseconds.

Challenges

  • Make the model smaller in Model Studio. How does speed change?
  • Check: does int8 accuracy match float accuracy?
  • Use the result to switch an LED on the cube.

More Advanced projects

Advanced30 minRobotics, Gesture Recognition

Gesture-Controlled Servo

AI + robotics: the number of fingers sets a servo angle on the AI Cube (0 to 180 degrees).

  • From AI output to motor control
  • Smoothing noisy predictions
  • Safe pin use
Hardware: AI Cube + SG90 servo on the servo pin (or the on-screen servo with the Virtual Cube)AI Cube: in the browser, AI Cube camera · Virtual Cube: laptop or phone camera
Advanced25 minRobotics, Computer Vision

Colour Sorter Robot

A servo arm points left for red things and right for blue things, like a factory sorting machine.

  • Turning AI results into movement
  • Servo angles
  • Robotics decisions
Hardware: AI Cube with a servo, or the Virtual CubeAI Cube: in the browser, AI Cube camera · Virtual Cube: laptop or phone camera
Advanced30 minRobotics, Image Classification

Smart Face Door

Open a servo "door" only for faces you taught, and keep it locked for everyone else.

  • Face recognition with actions
  • Security ideas
  • Servo control
Hardware: AI Cube with a servo, or the Virtual CubeAI Cube: in the browser, AI Cube camera · Virtual Cube: laptop or phone camera