Code Monkey home page Code Monkey logo

race_model's Introduction

Race predictor from single selfie

Installation

git clone https://github.com/Kichkun/race_model.git
cd race_model
pip install .

Race recognition including asian, white, middle eastern, indian, latino and black predictions.

from race_model import RaceModel
import cv2
img = cv2.imread("img4.jpg")
demography = RaceModel.analyze(img)
#demography = RaceModel.analyze([img, img]) #analyze multiple images
print("Race: ", demography["dominant_race"])
#print("Race: ", demography)

{'dominant_race': 'white',
 'race': {'asian': 1.3692333378223509e-08,
  'black': 1.682867603949867e-10,
  'indian': 1.8962782455389515e-07,
  'latino hispanic': 0.0014391415788850281,
  'middle eastern': 0.01635842927498743,
  'white': 99.98220801353455}}

Pretrained weights can be downloaded from here and should be placed in "models" folder

race_model's People

Contributors

kichkun avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bellyfat

race_model's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.