{"id":18644850,"url":"https://github.com/zuruoke/race-classification-keras-rest-api","last_synced_at":"2025-11-05T02:30:34.305Z","repository":{"id":113055727,"uuid":"278659530","full_name":"zuruoke/Race-Classification-Keras-Rest-API","owner":"zuruoke","description":"A Simple Keras Rest API for Race Classification using Flask","archived":false,"fork":false,"pushed_at":"2020-07-18T10:23:29.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T11:32:26.378Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zuruoke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-10T14:49:11.000Z","updated_at":"2021-01-23T16:14:33.000Z","dependencies_parsed_at":"2023-06-07T14:00:32.344Z","dependency_job_id":null,"html_url":"https://github.com/zuruoke/Race-Classification-Keras-Rest-API","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FRace-Classification-Keras-Rest-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FRace-Classification-Keras-Rest-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FRace-Classification-Keras-Rest-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FRace-Classification-Keras-Rest-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuruoke","download_url":"https://codeload.github.com/zuruoke/Race-Classification-Keras-Rest-API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239449544,"owners_count":19640532,"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":[],"created_at":"2024-11-07T06:13:49.955Z","updated_at":"2025-11-05T02:30:34.279Z","avatar_url":"https://github.com/zuruoke.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Race Classification Keras Rest API\n\nThis repository contains the code to build and run a Keras REST API to classify different races such as Caucasian, Mongoloid and Negroid given a query image\n\n- Caucasian: includes people of American and European descent, also known as whites\n\n- Mongoloid: includes people of Asian descent, especially Eastern Asian\n\n- Negroid: includes people of African descent or black Americans\n\n\nTo get more details on how this Race Classification Model was trained, refer to this [repository](https://github.com/zuruoke/Race_Classification_Using_Deep_CONVNET)\n\n\n# Getting started\n\nI assume you already have numpy, pillow, Keras and a supported backend (tensorflow in this case) installed on your system. From there you need to install Flask, urllib, and requests:\n                \n                \n    $ pip install flask gevent requests\n                                    \n\nNext, clone the repo:\n                            \n    $ git clone https://github.com/zuruoke/Race-Classification-Keras-Rest-API.git\n                            \n\nNext, navigate into the main directory:\n                              \n    $ cd Race-Classification-Keras-Rest-API\n                          \n\n\n# Starting the Keras server\n\nBelow is our query image (kim.jpg) which we wish to classify as either a  Caucasian, Mongoloid or a Negroid:\n\n![kim](https://user-images.githubusercontent.com/51057490/87179658-fce6de80-c2d6-11ea-8355-7c12fb436745.jpg)\n\nThe Flask + Keras server can be started by running:\n\n    $ python run_keras_server.py \n    Using TensorFlow backend.\n    * Loading Zuruoke model and Flask starting server...please wait until server has fully started\n    ...\n    * Running on http://127.0.0.1:1000\n                              \nYou can now access the REST API via http://localhost:1000. \n\nWe will use this url attached with an endpoint to send a POST request to the server. In this case:\n\n    KERAS_REST_API_URL = \"http://localhost:1000/predict\"\n                             \n                             \n# Consuming the Keras REST API\n\nWe have to send a POST request to the server running to consume the API.\n\nTo consume the Keras REST API:\n\n- First ensure run_keras_server.py (i.e., the Flask web server) is currently running\n\n- Then open another terminal in the same environment and navigate to the main directory\n\n- Then run post_request.py\n\n      $ python post_request.py\n                            \n- Then you will be asked to enter the image path of the query image\n                                \n       $ python post_request.py\n       Enter the image path:\n       kim.jpg\n                             \n \n - And then when you have provided the query image path, it will display the predictions along with the probabilities or confidence level\n \n       $ python post_request.py\n       Enter the image path:\n       kim.jpg\n       1. Caucasian: 0.7900\n       2. Mongoloid: 99.2011\n       3. Negroid: 0.0089\n\n                            \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuruoke%2Frace-classification-keras-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuruoke%2Frace-classification-keras-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuruoke%2Frace-classification-keras-rest-api/lists"}