Coder Social home page Coder Social logo

palominojulio / automatic_rubiks_cube_solver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mustafa1728/automatic_rubiks_cube_solver

0.0 0.0 0.0 258 KB

From images of the faces of a 3 x 3 Rubik's cube, get efficient algorithm to solve it

Python 4.98% Jupyter Notebook 95.02%

automatic_rubiks_cube_solver's Introduction

Automatic_Rubiks_Cube_Solver

Open In Colab

This project allows you to input images of the faces of a cube and prints out an algorithm to solve it. It uses Segmentation to detect the actual faces of the cube and then assumes a uniform 3*3 grid-like distribution to find the color of each piece.

Current logic: Find closest color from a set of 6 predefined colors (Logic needs to be changed with different cubes). I am working on clustering algorithms to solve this issue.

Once the colors are detected, it is converted into a format according to Kociemba Solver, and then solved by the Kociemba algorithm, which allows any configuration to be solved in less than 30 steps. The final output is an algorithm to solve the cube (and the number of steps).

Instructions of use:

  1. Clone the repository and open cube_solving.ipynb in Google Colaboratory.
  2. The Google colab file has commands to install all the prerequisites and you simply need to run the cells to get the required.
  3. Copy the weights file from here into your google drive account and note the location. Follow instructions in the colab file to put the location (path) in a line of code.
  4. Run the cells of the cube_solving.ipynb file in order upto the section 'Main Inference'. They have requirements and helper functions.
  5. take images of each face of the cube such that the image in the below figure would look straight.

  1. make a directory '/content/scramble/' and add the files in the format 'cube.png' (This format can be changed by changing the final inference function)
  2. run the final inference function to get the algorithms to solve the cube. The algorithm consists of a list of characters that follow this convention.

Example output:

Below is a screenshot of the output obtained for one cube: output

Fun with Pycuber:

Pycuber is a fun interactive environment that visualises a cube. I am planning to make a web app that uses this to make a user-friendly interactive cube solver.

automatic_rubiks_cube_solver's People

Contributors

mustafa1728 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.