Skip to content

๐ŸŽฏThis project leverages TensorFlow.js ๐Ÿ–ฅ๏ธ and RetinaNet-SpineNet-49 ๐Ÿค– (retinanet_spinenet_mobile_coco) to build an AI-powered system capable of recognizing Rubik's Cube faces ๐Ÿง  & colors in real-time ๐ŸŽฒ.

License

Notifications You must be signed in to change notification settings

itsiiromiuy/Model-Rubik-Cube-Recognition-with-TensorFlow.js-RetinaNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Project Summary: AI Rubik's Cube Recognition Using TensorFlow.js and RetinaNet-SpineNet-49

This project utilizes TensorFlow.js and the RetinaNet-SpineNet-49 model (retinanet_spinenet_mobile_coco) to train an AI system that recognizes and interprets Rubik's Cube patterns via a camera. By integrating computer vision ๐Ÿ–ผ๏ธ, COCO annotations ๐Ÿ—‚๏ธ, and state-of-the-art object detection models ๐Ÿš€, the system detects and identifies each face and tile color of a Rubik's Cube, paving the way for automated solving.

๐Ÿ“ Description

The project is structured into three core components:

  1. Data Preparation ๐Ÿ–Œ๏ธ:

    • Collected Rubik's Cube images annotated using LabelMe.
    • Converted annotations from LabelMe JSON format to COCO JSON format using a custom Python script.
    • Defined detection categories, including color tiles (red_tile, white_tile, blue_tile, etc.).
  2. Model Training ๐Ÿ‹๏ธโ€โ™€๏ธ:

    • This project uses the RetinaNet-SpineNet-49 architecture, specifically the retinanet_spinenet_mobile_coco model provided by TensorFlow as the base model.
    • Fine-tuned the model for real-time classification and localization of Rubik's Cube tiles.
  3. Visualization and Evaluation ๐Ÿ‘€:

    • Developed a visualization script to overlay predictions on test images with bounding boxes and labels.
    • Exported results to PNG format for validation and analysis.

โœจ Key Features

  • Advanced Object Detection ๐ŸŽฏ: High-precision Rubik's Cube tile detection using the RetinaNet-SpineNet-49 model.
  • Dynamic Tile Recognition ๐Ÿ•น๏ธ: Real-time identification of cube tiles and colors via camera input.
  • Streamlined Annotation Workflow ๐Ÿ”„: Seamless conversion of LabelMe JSON annotations into the COCO JSON format.
  • Custom Visualization Tools ๐Ÿ–ผ๏ธ: Debugging and enhancing predictions through overlayed visual outputs.

โš™๏ธ How It Works

  1. Data Collection: Annotate Rubik's Cube images using LabelMe. โœ๏ธ
  2. COCO Conversion: Convert annotations with the labelme_to_coco.py script. ๐Ÿ”„
  3. Model Training:
    • Configure the retinanet_spinenet_mobile_coco model using TensorFlow Model Garden.
    • Train the model on a custom Rubik's Cube dataset. ๐Ÿง 
  4. Deployment: Use TensorFlow.js to deploy the trained model for real-time detection. ๐ŸŒ

๐Ÿš€ Getting Started

Prerequisites ๐Ÿ› ๏ธ

  • Python 3.8+
  • TensorFlow
  • TensorFlow.js
  • TensorFlow Model Garden
  • LabelMe for annotation

Installation ๐Ÿ“ฆ

  1. Clone the repository:

    git clone [repository_link]
    cd rubiks-cube-detection
  2. Install dependencies:

    pip install -r requirements.txt
  3. Annotate your Rubik's Cube images using LabelMe and place them in the images/ folder.


Usage ๐Ÿ’ป

  1. Convert Annotations:

    python labelme_to_coco.py
  2. Train the Model:

    • Modify the configuration for retinanet_spinenet_mobile_coco.
    • Train the model:
      python train.py --model=retinanet_spinenet_mobile_coco --config=configs/retinanet_spinenet_mobile_coco.config --data_dir=path_to_coco_data
  3. Run Detection:

    • Convert the trained model to TensorFlow.js format.
    • Deploy the model for real-time detection.

๐Ÿ“Š Results

Sample visualizations with bounding boxes and labels are saved in the outputs/ folder. ๐Ÿ–ผ๏ธ


๐Ÿ›ค๏ธ Roadmap

  • ๐Ÿค– Integrate a Rubik's Cube-solving algorithm.
  • ๐Ÿ“ˆ Expand the dataset to improve detection accuracy.
  • ๐ŸŒ Deploy the system as a web-based application.

๐Ÿค Contributions

Contributions are welcome! Feel free to submit issues or pull requests for improvements. ๐Ÿ’ก

About

๐ŸŽฏThis project leverages TensorFlow.js ๐Ÿ–ฅ๏ธ and RetinaNet-SpineNet-49 ๐Ÿค– (retinanet_spinenet_mobile_coco) to build an AI-powered system capable of recognizing Rubik's Cube faces ๐Ÿง  & colors in real-time ๐ŸŽฒ.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published