Giter Site home page Giter Site logo

s-you / ar-browser-sudoku Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atomic14/ar-browser-sudoku

0.0 1.0 0.0 73.92 MB

Solving Sudoku Puzzles in the Browser Using Augmented Reality

License: Creative Commons Zero v1.0 Universal

Shell 0.03% JavaScript 0.09% Python 1.22% TypeScript 19.03% CSS 0.41% HTML 1.04% Jupyter Notebook 78.18%

ar-browser-sudoku's Introduction

ko-fi

Augmented Reality Sudoku Solver

You can find details on how this project works in the video. You can also try it out here:

https://sudoku.cmgresearch.com

Demo Video

This project will let you use your phone (or your computers webcam) as an Augmented Reality camera for solving Sudoku puzzles.

It's an interesting proof of concept to see how powerful browsers on phone are now.

To perform the OCR we use tensorflowjs. The image processing is all carried out in customer code.

Hopefully after watching the video it should be mostly self explanatory...

A good place to start is the code in app/src/augmentedReality/Processor.ts as this steps through the processing pipeline described in the video.

This project consists of two folders:

  • app - the JavaScript application that runs in the browser using a phone's camera or webcam
  • tensorflow - the training and test code for the neural network used for the OCR

Building the App

To build the application you will need to have node and yarn installed.

Setup

cd app
yarn
yarn start

If you want to run the app locally then you will need to use something like ngrok to proxy https connections from your phone to your local server (most phones will not allow access to the camera unless the page is served over https).

Running in your desktop browser should work so long as you use the localhost connection as this bypasses the https requirement.

Building

yarn build

Training the neural network

The application invluces a pretrained network so you only need to do this if you want to train the network on new images.

Setup

cd tensorflow
python3 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt

You may need to upgrade pip to the latest version if you have errors during the pip install phase.

pip install --upgrade pip

You will need to go into the tensorflow/fonts folder and unzip the fonts files. You'll then need to run the list.sh script to update the list of fonts.

sh list.sh

Running the notebooks

jupyter notebook .

There are three notebooks - train.ipynb, test-model.ipynb and generate_training_data.ipynb

train.ipynb containts the training code. This is a very simple model so should be trainable on a CPU.

test-model.ipynb contains some code for showing which images the network is failing on.

generate_training_data.ipynb contains code for creating the training and test set data.

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.