Skip to content

Latest commit

 

History

History
139 lines (98 loc) · 3.31 KB

README.md

File metadata and controls

139 lines (98 loc) · 3.31 KB

Person Attribute Recognition with Deep Learning

License: GPL By

Star History

Star History Chart

Overview

This repository contains a PyTorch implementation of a person attribute recognition model. The model has been trained to recognize various attributes such as age, gender, hair length, upper body features, lower body features, and accessories.

Pre-trained model

Model ROC AUC F1 Score Model Type
Resnet 18 0.9221371 0.910283516 Pytorch
Resnet 30 0.94394 0.943229 Pytorch

Model Details

The model is trained to recognize the following attributes:

  • Age

    • Young
    • Adult
    • Old
  • Gender

    • Female
  • Hair Length

    • Short
    • Long
    • Bald
  • Upper Body Features

    • Length
      • Short
    • Color
      • Black
      • Blue
      • Brown
      • Green
      • Grey
      • Orange
      • Pink
      • Purple
      • Red
      • White
      • Yellow
      • Other
  • Lower Body Features

    • Length
      • Short
    • Color
      • Black
      • Blue
      • Brown
      • Green
      • Grey
      • Orange
      • Pink
      • Purple
      • Red
      • White
      • Yellow
      • Other
    • Type
      • Trousers & Shorts
      • Skirt & Dress
  • Accessories

    • Backpack
    • Bag
    • Glasses
      • Normal
      • Sun
    • Hat

Usage

1. Installation

Clone the repository and navigate to the project directory:

git clone https://github.com/dsabarinathan/attribute-recognition.git
cd attribute-recognition

2. Download Pre-trained Model

Download the pre-trained model weights file from the releases section of this repository and place it in the models/ directory.

The pre-trained model weights can be downloaded from Google Drive. Download Model

3. Install Dependencies

Install the required Python packages:

pip install -r requirements.txt

4. Run Inference

Use the provided script to perform attribute recognition on an input image:

python inference.py --image_path path/to/your/image.jpg

Replace path/to/your/image.jpg with the path to the image you want to analyze.

5. Sample Results:

Input image:

0028_c3s1_002001_02

Output:

Predicted results: {'labels': array(['Age-Adult', 'Gender-Female', 'LowerBody-Color-Black',
       'LowerBody-Type-Trousers&Shorts'], dtype='<U30'), 'prob': array([0.64786081, 0.61053316, 0.63944295, 0.85024354])}

Contributing

We welcome contributions! If you find any issues or have suggestions for improvements, please create an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.