Giter Site home page Giter Site logo

prembharwani / bosch-age-gender Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bo-t10/mp_bo_t10_code

0.0 0.0 0.0 120.47 MB

Inter IIT Tech Meet 10.0 - Bosch's Age and Gender Detection

Jupyter Notebook 4.36% Python 84.62% CMake 0.33% C++ 10.46% C 0.22%

bosch-age-gender's Introduction

BOSCH'S AGE AND GENDER DETECTION MODEL


DESCRIPTION:

We had to come up with a solution that could estimate Age & Gender of people from a surveillance video feed. The pain points included :

  • Low-resolution surveillance footages made it difficult to extract features to predict age & gender. And as a result, Super Resolution Models didn't perform well.
  • Cameras at varying height posed a challenge as the viewing angles became more complicated.
  • Occlusion between objects made it difficult to assign a unique tracking-ID to a person throughout the video.

After experimenting with various models, reading the literature available and trying what worked best for us, we came up with a pipeline which makes use of YOLOX for Object Detection, ByteTrack tracking algorithm for Object Tracking, and finally a custom model that estimates the age & gender.

RESULTS:

Results we achieved by running our model on a low-resolution surveillance footage from VIRAT Ground Dataset

USAGE:

Setup :

In case the below Setup fails due to some reason, please go to this colab instance created by us and run the commands there. Finally just upload your evaluation files(images/videos) on the colab instance (LINK HERE) and correspondingly update the test code. (The same colab notebook is available as MP_BO_T10_COLAB.ipynb in the repo as well.)

Before proceeding ensure that you are inside the MP_BO_T10_CODE/ directory.

Installing the dependencies:

# Changing the working directory into the repository
cd <TODO : insert repo name here>
# Installing the dependencies
pip3 install -r requirements.txt
pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
pip3 install --upgrade --no-cache-dir gdown

Downloading the pretrained models directory & storing them as /pretrained. Please note, if these commands do not work please download the zip file manually from the drive link provided here and extract it as a directory /pretrained.

gdown "18qPkmJIZ4fID5fA309uc8UA0HDMUjF4U"
unzip pretrained
rm -rf pretrained.zip

Finally your /pretrained/ directory should look as follows

pretrained
   ├── New_32CL_5LR_43Epoc
   └── bytetrack_x_mot17.pth.tar

Finally run the setup:

python3 setup.py develop

Testing on images/videos:

The output csv file will be stored under the /final_output directory as predictions.csv. The csv file follows the format : frame_id, track_id, x, y, w, h, age_actual, gender

To test on videos :

python3 tools/demo_track.py video -c pretrained/bytetrack_x_mot17.pth.tar --path "<$path_to_video>" 

To test on a single image :

python3 tools/demo_track.py image -c pretrained/bytetrack_x_mot17.pth.tar --path "<$path_to_image>" 

To test on a directory of images :

python3 tools/demo_track.py image -c pretrained/bytetrack_x_mot17.pth.tar --path "<$path_to_directory_of_images>" 

bosch-age-gender's People

Contributors

bo-t10 avatar

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.