TINKER PiEDESIGN IN INDIA
Basic

AR SunglassesPut cool AR sunglasses on every face in the camera, like a photo filter app.

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

  • What augmented reality (AR) is
  • Placing pictures on detected faces
  • Filters you see in apps

What you need

  • A laptop, tablet or phone with a camera (Virtual Cube)

Steps

  1. Type the program from the Code guide, then press Run.
  2. Look at the camera: you wear sunglasses.
  3. Ask friends to join: everyone gets a pair.

How it works

AR adds computer pictures to the real camera view. The face AI finds each face box; tp.sticker() draws the glasses at the eye line inside that box, so they move with you.

Coding concepts

Loop
"while True:" repeats the indented lines once per camera picture.
AR
Augmented reality: computer pictures on top of the real world.
Sticker
A drawing placed on a face or hand.

Expected output

Sunglasses on every face and the number of faces on screen.

Challenges

  • Try "hat", "crown", "cat" or "mask".
  • Use two stickers at once.
  • Show "Looking good!" when 2 faces are seen.

More AR/VR projects

Basic15 minAR / VR, Gesture Recognition

AR Filter Switcher

Change your AR face filter by holding up 1, 2, 3 or 4 fingers.

  • Two AIs together: face and hand
  • Choosing with if / elif
  • Interactive AR
Hardware: Laptop, tablet or phone cameraAI Cube: Virtual Cube only · Virtual Cube: laptop or phone camera
Basic15 minAR / VR

My First VR World

Build a 3D world with code: a sky, grass, a red box, a ball, a tree and a sign.

  • What virtual reality (VR) is
  • 3D positions: x, y and z
  • Building scenes with code
Hardware: Any device; a phone VR viewer for headset modeAI Cube: Virtual Cube only · Virtual Cube: laptop or phone camera