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.
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.
python test_realsense.py
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