{"id":14972629,"url":"https://github.com/marcogdepinto/deep-learning-model-deploy-with-django","last_synced_at":"2025-10-26T19:31:41.463Z","repository":{"id":39736236,"uuid":"201507148","full_name":"marcogdepinto/Deep-learning-model-deploy-with-django","owner":"marcogdepinto","description":"Serving a keras model (neural networks) in a website with the python Django-REST framework.","archived":false,"fork":false,"pushed_at":"2023-03-24T23:38:11.000Z","size":31385,"stargazers_count":97,"open_issues_count":7,"forks_count":38,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-31T23:03:13.295Z","etag":null,"topics":["api","api-rest","artificial-intelligence","artificial-neural-networks","deep-learning","deep-neural-networks","django","django-application","django-framework","django-rest-framework","keras","keras-model","keras-models","keras-neural-networks","keras-tensorflow","prediction","python","python-3","python3","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcogdepinto.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":null,"support":null}},"created_at":"2019-08-09T16:45:16.000Z","updated_at":"2025-01-26T19:45:06.000Z","dependencies_parsed_at":"2023-01-31T04:45:13.621Z","dependency_job_id":null,"html_url":"https://github.com/marcogdepinto/Deep-learning-model-deploy-with-django","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcogdepinto%2FDeep-learning-model-deploy-with-django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcogdepinto%2FDeep-learning-model-deploy-with-django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcogdepinto%2FDeep-learning-model-deploy-with-django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcogdepinto%2FDeep-learning-model-deploy-with-django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcogdepinto","download_url":"https://codeload.github.com/marcogdepinto/Deep-learning-model-deploy-with-django/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238394323,"owners_count":19464583,"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":["api","api-rest","artificial-intelligence","artificial-neural-networks","deep-learning","deep-neural-networks","django","django-application","django-framework","django-rest-framework","keras","keras-model","keras-models","keras-neural-networks","keras-tensorflow","prediction","python","python-3","python3","tensorflow"],"created_at":"2024-09-24T13:47:14.617Z","updated_at":"2025-10-26T19:31:41.457Z","avatar_url":"https://github.com/marcogdepinto.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep learning model deploy with Django\n\n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n\n**Executive Summary**\n\nThis project is a Django-REST API that offers the consumption of a deep learning model using a simple front end. The model adopted in this work is the previous version of an Emotion Classifier trained with audio files of the [RAVDESS dataset](https://zenodo.org/record/1188976#.XvO2WZMza3c). To know more, see [this repository](https://github.com/marcogdepinto/emotion-classification-from-audio-files). \n\n# How does this work?\n\n**User Journey**\n\nThe user journey starts on the index page at ```/index/``` where it is possible to choose if \n\n1) Upload a new file on the server;\n2) Delete a file from the server (WIP);\n3) Make a prediction on a file already on the server;\n\n![Picture1](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/index.png)\n\nChoosing ```Upload your audio file``` the user will be redirected to a modified home page. The user will be asked to pick a file from his computer. The UI will confirm if the operation has been successful. \n\n![Picture2](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/fileuploadv2.png)\n\nChoosing ```Make your prediction``` the user will be redirected to a modified home page. In this page, it will be possible to see a list of the files already on the server. Following the path ```media/{filename}``` it will be also possible to listen to the audio file.\n\n![Picture3](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/fileselectionv2.png)\n\nAfter clicking on ```Submit```, the user will be redirected to a modified home page that will include the prediction made by the Keras model for the file selected.\n\n![Picture4](https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/blob/master/gitmedia/predict.png)\n\n# Developers stuff\n\n**DB creation**\n\nPostgreSQL needs to be installed. To facilitate the configuration, I suggest to use a Db manager with UI, like [pgAdmin](https://www.pgadmin.org/). \n\nAfter the installation of PostgreSQL, it is possible to use pgAdmin to create a ```django-emotion-classification``` database and a ```App_filemodel``` table.\n\nThe ```App_filemodel``` table can be created with the following script:\n\n```\nCREATE DATABASE django-emotion-classification;\n\nCREATE USER marco WITH PASSWORD 'test';\n\nCREATE TABLE App_filemodel (\n   id INT PRIMARY KEY NOT NULL,\n   file TEXT NOT NULL,\n   timestamp DATE NOT NULL,\n   path TEXT NOT NULL\n);\n\nGRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA django-emotion-classification TO marco;\n\nALTER USER marco CREATEDB; -- This is to run the automatic tests, otherwise you will get an \"unable to create database\" error when running python manage.py test\n\n```\n\nPlease note the above script is made with the data available in the ```settings.py```, but it is possible to change it if needed.\n```\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql_psycopg2',\n        'NAME': 'django-emotion-classification',\n        'USER': 'marco',\n        'PASSWORD': 'test',\n        'HOST': 'localhost',\n        'PORT': '',\n        'OPTIONS': {'sslmode': 'disable'},\n    }\n}\n```\n\n**How to start the server and try it**\n\n1) ```git clone https://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API.git```\n2) ```$ pip install -r requirements.txt```\n3) Open a terminal window, ```cd``` into the project folder and run ```python manage.py runserver```.\n\n**How to run the tests**\n\n```python manage.py test```\n\n**Other important topics**\n\nThe Keras model is stored in the ```models``` folder.\n\n```gitmedia``` folder includes the pictures used for this README.\n\n```media``` folder includes the audio files loaded using the server. \n\nIt is possible to have an overview of the application even without knowing how Django works by looking at the ``App/views.py`` file.\n\n**User Stories**\n\nhttps://github.com/marcogdepinto/Django-Emotion-Classification-Ravdess-API/projects/2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcogdepinto%2Fdeep-learning-model-deploy-with-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcogdepinto%2Fdeep-learning-model-deploy-with-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcogdepinto%2Fdeep-learning-model-deploy-with-django/lists"}