Instructions to use lrzjason/hand-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lrzjason/hand-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="lrzjason/hand-classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("lrzjason/hand-classifier") model = AutoModelForImageClassification.from_pretrained("lrzjason/hand-classifier") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoImageProcessor, AutoModelForImageClassification
processor = AutoImageProcessor.from_pretrained("lrzjason/hand-classifier")
model = AutoModelForImageClassification.from_pretrained("lrzjason/hand-classifier")Quick Links
a hand classifier detect the image is showing left hand or right hand
it is trained with hagrid dataset on vit model, google/vit-base-patch16-224-in21k.
Limitation: it couldn't predict both hand and no hand images.
inputs = image_processor(image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_label = logits.argmax(-1).item()
print(f'predicted_label: {model.config.id2label[predicted_label]}')
- Downloads last month
- 9
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="lrzjason/hand-classifier") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")