{"id":13428936,"url":"https://github.com/pintowar/sudoscan","last_synced_at":"2025-04-12T06:07:42.867Z","repository":{"id":49549782,"uuid":"291176963","full_name":"pintowar/sudoscan","owner":"pintowar","description":"Scans and solves Sudoku Puzzles from images using AI","archived":false,"fork":false,"pushed_at":"2023-05-01T15:09:47.000Z","size":2601,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T06:07:20.810Z","etag":null,"topics":["choco-solver","command-line-parser","deeplearning4j","djl","dl4j","java","kotlin","micronaut","ojalgo","opencv","spi","tensorflow2"],"latest_commit_sha":null,"homepage":"https://pintowar.github.io/sudoscan/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pintowar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-08-29T01:15:05.000Z","updated_at":"2024-03-21T12:39:25.000Z","dependencies_parsed_at":"2022-09-06T09:40:15.292Z","dependency_job_id":"5044d1cb-aa8d-4ab9-948b-af2d28928220","html_url":"https://github.com/pintowar/sudoscan","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2Fsudoscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2Fsudoscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2Fsudoscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pintowar%2Fsudoscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pintowar","download_url":"https://codeload.github.com/pintowar/sudoscan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525143,"owners_count":21118618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["choco-solver","command-line-parser","deeplearning4j","djl","dl4j","java","kotlin","micronaut","ojalgo","opencv","spi","tensorflow2"],"created_at":"2024-07-31T01:01:09.289Z","updated_at":"2025-04-12T06:07:42.841Z","avatar_url":"https://github.com/pintowar.png","language":"Kotlin","funding_links":[],"categories":["Samples"],"sub_categories":[],"readme":"# SudoScan\n![master status](https://github.com/pintowar/sudoscan/actions/workflows/gradle_master.yml/badge.svg?branch=master)\n[![Sonar Coverage](https://sonarcloud.io/api/project_badges/measure?project=pintowar_sudoscan\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=pintowar_sudoscan)\n\n![develop status](https://github.com/pintowar/sudoscan/actions/workflows/gradle_develop.yml/badge.svg?branch=develop)\n\n![GitHub tag (latest)](https://img.shields.io/github/v/tag/pintowar/sudoscan)\n![GitHub license](https://img.shields.io/github/license/pintowar/sudoscan)\n\nScan and Solve Sudoku Puzzles\n\n## Project Info\n\nThis is a toy project for educational purpose.\nI usually use this project to explore some JVM/Kotlin libs, new Gradle features/plugins,\nAI libs and CI pipes (using github actions).\n\n[![Sudoscan Project](http://img.youtube.com/vi/8D4gMhDRu-U/0.jpg)](https://youtu.be/8D4gMhDRu-U \"Sudoscan Project\")\n\nFor a more detailed explanation of how the project works, check out the [Project Blog](https://pintowar.github.io/sudoscan/).\n\n### Project Concepts\n\nThe main objective of this project is to use an image of a sudoku puzzle as input, identify the puzzle, \nrecognize the numbers, solve the problem and plot the solution back to the original image.\n\nThat been said, the project can be divided in concepts:\n\n* Parser/Plotter: computer vision components responsible the read/write information from/to an image;\n* Recognizer: responsible to recognize the number images and translate it into an integer;\n* Solver: responsible to effectively solve the sudoku puzzle;\n* Engine: a pipe that glues all above components together to achieve the main objective of the project.\n\n### Project Modules\n\nThe project was broken into the following modules (using java SPI):\n\n* sudoscan-api: module containing domain classes, spi for solvers and recognizers and main engine.\n* sudoscan-solver-choco: module containing a spi implementation using \n[choco solver](https://github.com/chocoteam/choco-solver) (a CSP solver) to solve to find the sudoku solution;\n* sudoscan-solver-ojalgo: module containing a spi implementation using \n[ojAlgo](https://github.com/optimatika/ojAlgo) (a MIP solver) to solve to find the sudoku solution;\n* sudoscan-recognizer-djl: module containing a spi implementation using [djl](https://github.com/deepjavalibrary/djl) \n(a deep learning framework) to recognize numeric images;  \n* sudoscan-recognizer-dl4j: module containing a spi implementation using \n[dl4j](https://github.com/eclipse/deeplearning4j) (a deep learning framework) to recognize numeric images (this is the \ndefault recognizer);\n* sudoscan-cli: cli application using other modules to solve sudoku problems using a webcam as user interface.\n\nBoth solvers (choco-solver and ojalgo) are implementations that use different discrete optimizations approaches. To\nlearn more about MIP and CSP approaches on Sudoku problems, take a look at the following \n[Kaggle Notebook](https://www.kaggle.com/pintowar/modeling-a-sudoku-solver-with-or-tools).\n\nBoth recognizers (dlf4 and djl) are implementations that use a pre-trained model. The model creation and training can be\nfound on the following [Kaggle Notebook](https://www.kaggle.com/pintowar/sudoscan-number-recognizer).\n\n### Project Modules Usage\n\nAdd the repository\n\n```kotlin\nmaven {\n    name = \"SudoscanLibs\"\n    url = uri(\"https://pintowar.jfrog.io/artifactory/sudoscan-libs-release\")\n}\n```\n\nAdd api, solver and recognizer the dependencies\n\n```kotlin\nimplementation(\"com.github.pintowar:sudoscan-api:x.y.z\")\nimplementation(\"com.github.pintowar:sudoscan-solver-choco:x.y.z\") // or sudoscan-solver-ojalgo\nimplementation(\"com.github.pintowar:sudoscan-recognizer-dl4j:x.y.z\") // or sudoscan-recognizer-djl\n```\n\n## Building Project\n\nTo build the fat jar client version of the app, run the following command:\n\n`gradle -PjavacppPlatform=linux-x86_64,macosx-x86_64,windows-x86_64 clean assembleCliApp`\n\nThe command above will build a fat jar containing the native dependencies of all informed platforms. \nTo build a more optimized jar, just inform the desired platform, for instance: \n\n`gradle -PjavacppPlatform=linux-x86_64 clean assembleCliApp`\n\nThis second command will build a smaller jar, but it will run only on linux-x86_64 platforms.\n\nIt is also possible to chose in compile time, which solver/recognizer module to use. The commands above (by default) \nwill generate a jar using **sudoscan-solver-choco** and **sudoscan-recognizer-dl4j** as the main solver and recognizer. \nTo use **sudoscan-solver-ojalgo** and **sudoscan-recognizer-djl** as solver and recognizer components, \nrun the following command:\n\n`gradle -Pojalgo -Pdjl -PjavacppPlatform=macosx-x86_64 clean assembleCliApp`\n\n### Native Image Build\n\nIt is also possible to generate a native image of the sudoscan-cli, using a special JVM called the \n[GraalVM](https://www.graalvm.org/).\n\nGraalVM provides this mechanism that helps to create a native image of the application which can be executed as a \nstandalone executable. The build process builds the executable with all the required dependencies such that \nthere is no need the JVM to run the application.\n\nThe latest GraalVM version tested was GraalVM CE 21.2.0 (graalvm-21.2.0+java11) which is for Java 11. \nTo build the native image, run the following command on `sudoscan-cli` module:\n\n`gradle -PjavacppPlatform=linux-x86_64 clean nativeCompile`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpintowar%2Fsudoscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpintowar%2Fsudoscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpintowar%2Fsudoscan/lists"}