/EthinicAPI

Predict race, age, gender of a person using this API.

Primary LanguagePythonMIT LicenseMIT

Ethinic-API

EthinicAPI is a RESTful API which is written in Python and predicts the ethinicity, age and gender from an image provided by the user.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Output
  5. Roadmap
  6. Contributing
  7. License
  8. Contact

About The Project

I was working on an Android-app that promoted equality and I wanted to use the pytorch model that I had but there were a lot of issues and very less support. This was the reason I built this API. Ethinic-API was built so that I could predict the race, age and gender of a person in my Android-app. A funny story I guess.

Built With

Getting Started

Follow the instructions to setup the project locally!

Prerequisites

Make sure to have virtualenv package from python installed before proceeding to installation.

pip install virtualenv

Installation

  1. Clone the repo
    git clone https://github.com/lazyCodes7/EthinicAPI.git
  2. Activate the virtual environment
    cd EthinicAPI
    virtualenv venv
    . venv/bin/activate
  3. Install the required packages using pip
    pip install -r requirements.txt
  4. Run the app
    python app.py
  5. Start using the API at '/predict' endpoint in Postman Screenshot from 2021-07-15 18-33-42

Usage

  1. The API can be accessed at the following endpoint on Postman by making a POST request in the following way.

ezgif com-gif-maker

  1. Use the RaceClassifier inside the 'classifier' directory to make predictions
# image = cv2.imread(cvImage) (uncomment this line in RaceClassifier.py)
# then import it
from classifier.RaceClassifier import *
clf = RaceClassifer(model_path="fair_face_models/res34_fair_align_multi_7_20190809.pt")
clf.predict(image_path="path to your desired image")

Output

georgina output-img!

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Rishab Mudliar - @cheesetaco19 - rishabmudliar@gmail.com

Telegram: lazyCodes7