Skip to content

idootop/MigicCube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MigicCube

Solve any 3x3 Rubik's Cube in 20 moves using Xiaomi AI Glasses.

中文文档 | Demo Video

Overview

This project uses Xiaomi AI Glasses to recognize Rubik's cubes and provides optimal solutions (within 20 moves) in under 1 second, then demonstrates each move with 3D animations, making solving Rubik's cubes easier and more fun than ever before.

Demo Video

👉 https://www.youtube.com/watch?v=t4JbJy1Jbgw

Demo

Features

  • 📷 Smart Recognition: Automatically captures photos using Xiaomi AI Glasses and recognizes cube state using YOLO11 + OpenCV.
  • ⚡️ Fast Solving: Uses Kociemba's two-phase algorithm to provide optimal solutions (within 20 moves) in under 1 second.
  • 🎲 3D Visualization: Displays realistic 3D animations on a web page, step-by-step demonstrating how to rotate each face of the cube.
  • 🔊 Voice Guidance: Supports real-time voice interaction to get operation hints for each step (Xiaomi AI Glasses have no screen).

Technical Details

Yolo

Important

Note: The following operations are based on ADB debugging mode, but Xiaomi AI Glasses do not enable this feature by default, so you may not be able to reproduce this project.

First, we obtain images and voice interaction records from Xiaomi AI Glasses via ADB (related code).

After obtaining the images, we use an object detection model (based on YOLO11m) to identify the cube position (related code | model download).

Then we use OpenCV for perspective transformation to correct the image and identify the color of each face's color blocks (related code).

Next, we use the Kociemba two-phase solving algorithm to provide optimal solutions within 20 moves in under 1 second (related code | pruning table download).

Finally, we synchronize the solution to the web interface and use Roofpig to display 3D cube animations (related code).

Update History

  • Support operators: U(u), D(d), F(f), B(b), L(l), R(r), M, E, S, x, y, z and counterclockwise('), repeat operations (U2'), etc.
  • Complete cube initialization, operator mapping, and state observation interfaces
  • Web interface supports previewing cube operation sequence results and replaying solution steps
  • Implement complete CFOP 3x3 Rubik's cube speed-solving algorithm (based on PyCube-Solver)
  • Use Kociemba method to solve cubes (compressed to within 20 moves)
  • Implement Xiaomi AI Glasses text conversation real-time monitoring and photo capture POC
  • Implement YOLO11 cube recognition model data collection, processing, training, and inference pipeline
  • Implement cube state extraction from visual (image/camera) input and automatic solution generation
  • Optimize interaction flow (support voice interaction, photo button, and volume up/down event monitoring)
  • Support real-time preview of cube state and previous/next/reset operations
  • Implement TTS voice prompts and voice interaction flow

License

MIT License © 2025-PRESENT Del Wang

About

👓 Solve Rubik's Cube in 20 moves using Xiaomi AI Glasses. 用小米 AI 眼镜在 20 步内还原魔方。

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors