Skip to content

Repository files navigation

Rubik’s Cube Detection using YOLOv8

This project trains a custom YOLOv8 model to detect Rubik’s Cubes in real-time using a camera feed.
It includes both model training and live object detection code, and can be connected to a robot for further manipulation tasks.


Project Structure

cube_yolo/ ├── data.yaml # Dataset configuration ├── best.pt # Trained YOLOv8 model weights ├── robot_cube_detection.ipynb # Training + real-time detection notebook ├── test_realsense.py # Camera test script (for Intel RealSense) ├── yolo_realsence_detect.py # Real-time detection with YOLO + RealSense ├── yolo_realsence_detect_final_position_desktop_plane.py # Detect whether the cube is on the table and return its 3D position.


Useage

1. Test camera connection

python test_realsense.py

2. Run YOLO detection

python yolo_realsence_detect.py


Results

Precision: 0.997

Recall: 0.965

mAP@0.5: 0.994

mAP@0.5:0.95: 0.809

The trained model can accurately detect both solved and unsolved Rubik’s cubes under varied lighting conditions.


Author

Jane (Juan Du) MADS graduate student Volunteer researcher at UVic ACIS Lab Focus: robot vision, human–robot interaction, and visual data analysis

About

YOLOv8-based real-time Rubik’s Cube detection and classification (Solved vs Unsolved) — built for robotics vision tasks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages