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.
Model | ROC AUC | F1 Score | Model Type |
---|---|---|---|
Resnet 18 | 0.9221371 | 0.910283516 | Pytorch |
Resnet 30 | 0.94394 | 0.943229 | Pytorch |
The model is trained to recognize the following attributes:
Age
Gender
Hair Length
Upper Body Features
Lower Body Features
Accessories
Clone the repository and navigate to the project directory:
git clone https://github.com/dsabarinathan/attribute-recognition.git
cd attribute-recognition
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
Install the required Python packages:
pip install -r requirements.txt
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.
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])}
We welcome contributions! If you find any issues or have suggestions for improvements, please create an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.