This PR is about adding how to predict a person face age by deep learning architecture name Vision Transformers
We utilized the available Huggingface ViT nateraw/vit-age-classifier model
ViT prediction code:
def get_age_range(img):
# Transform our image and pass it through the model
inputs = transforms(img, return_tensors='pt')
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
# Predicted Classes
preds = model.config.id2label[predicted_class_idx]
return preds
This PR is about adding how to predict a person face age by deep learning architecture name
Vision Transformers
We utilized the available Huggingface ViT nateraw/vit-age-classifier modelViT prediction code:
Example result: link
or screenshot here: