dsabarinathan / attribute-recognition

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.
MIT License
6 stars 0 forks source link

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:

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.