{"id":23425419,"url":"https://github.com/jannepaakkari/digit-recognition-local-model","last_synced_at":"2025-04-09T11:45:41.596Z","repository":{"id":199527799,"uuid":"387776530","full_name":"jannepaakkari/Digit-recognition-local-model","owner":"jannepaakkari","description":"Django REST API demonstrating local AI/ML integration: Client sends a digit image, server predicts and returns the result. ","archived":false,"fork":false,"pushed_at":"2024-12-19T14:41:08.000Z","size":3221,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-15T05:44:17.558Z","etag":null,"topics":["ai","django","django-rest-framework","machine-learning","python","virtual-environment"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jannepaakkari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-20T11:57:54.000Z","updated_at":"2024-12-19T14:41:14.000Z","dependencies_parsed_at":"2023-10-10T21:18:14.545Z","dependency_job_id":"661820bb-4ac7-4aa9-904f-610d7dc0bd32","html_url":"https://github.com/jannepaakkari/Digit-recognition-local-model","commit_stats":null,"previous_names":["jannepaakkari/ai_numbers_2021"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jannepaakkari%2FDigit-recognition-local-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jannepaakkari%2FDigit-recognition-local-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jannepaakkari%2FDigit-recognition-local-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jannepaakkari%2FDigit-recognition-local-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jannepaakkari","download_url":"https://codeload.github.com/jannepaakkari/Digit-recognition-local-model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248034246,"owners_count":21036953,"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":["ai","django","django-rest-framework","machine-learning","python","virtual-environment"],"created_at":"2024-12-23T05:12:29.525Z","updated_at":"2025-04-09T11:45:41.573Z","avatar_url":"https://github.com/jannepaakkari.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digit-recognition-local-model\n\nDigit-recognition-local-model is a digit recognition application originally developed in 2021 using Django 3 and updated to Django 5.1 in 2024. The application utilizes AI/ML to recognize handwritten digits from 28x28 pixel PNG images. Though a relatively simple project, it demonstrates the integration of several technologies.\n\nTechnologies:\n- Django 3.2 (Python) and Django 5.1 (updated)\n- REST API\n- Django commands\n- AI/ML for digit recognition with a locally trained model (digits.keras)\n- Unit tests\n- Virtual environment\n\n# Environment\n\nThis is a suggested environment setup, but you're free to use any approach you prefer. The project has been designed to be flexible and not overly opinionated about the environment. As long as you have installed the required dependencies, you should be able to run the project without issues.\n\nNote: You may want to unfreeze the requirements (currently frozen as of 23.11.2024) if you'd like to update to the latest versions of the dependencies.\n\n# App\n\nYou can clone or download the app using Git.\nAfter setting up the project, make sure to define a secret key in settings.py. The project currently tries to import it from environment import secret_key, but the secret_key is not included with the project. Without setting a secret key, the project will not start.\n\n## Host Machine\n\nGo to the project\n\n```bash\npip install virtualenv # if you already have virtualenv installed, you can skip this most likely\npy -m venv venv # create virtual environment called venv / needs only to be done once\nvenv\\Scripts\\activate.bat # activate virtual environment\n```\n\n## Installation of requirements \u0026 run project (inside of virtual environment)\n\n```bash\npip install -r requirements.txt # needs only to be done once, make sure you have activated your virtual environment and are inside of it.\ncd ai_numbers_project\npython manage.py makemigrations # needs only to be done once or if you do modifications to the db models\npython manage.py migrate # needs only to be done once or if you do modifications to the db models\npython manage.py runserver\n```\n\n\n## Use/test model\n\nPOST .png file (28x28) of your digit to path/api/recognize/digit/ (i.e: http://localhost:8000/api/recognize/digit/). You can of course copy digit(s) from /example_digits folder if you do not wish to make your own digits, but you want to test that setup works as intended. \"Key\" which you should use with the digit is \"image\".\n\nAlternatively you can replace digits in /example_digits folder with your own digits (make sure they are .png, 28x28, and image name is same than in image which you replace) and then run:\n\n```bash\npython manage.py test # Runs unit tests in tests.py Run from /ai_numbers_project\n```\n\nResult should be \"ok\".\n\n\n# Train model\n\nThe project should already include a pre-trained model (digits.keras), so you typically don't need to retrain it. However, if you want to re-train the model for any reason, you can use the following command:\n\n```bash\npython manage.py train_model # you probably do not need to run this command\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjannepaakkari%2Fdigit-recognition-local-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjannepaakkari%2Fdigit-recognition-local-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjannepaakkari%2Fdigit-recognition-local-model/lists"}