Views
No views yet
achedguerra/resnet-50-signal_language, is a fine-tuned version of microsoft/resnet-50 for real-time sign language detection. It has been trained on a dataset of sign language images to provide accurate and efficient detection of sign language gestures.pip install transformers1from transformers import AutoFeatureExtractor, AutoModelForImageClassification
2import torch
3from PIL import Image
4
5model_name = "achedguerra/resnet-50-signal_language"
6
7# Load the model and feature extractor
8feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
9model = AutoModelForImageClassification.from_pretrained(model_name)1# Load and preprocess the image
2image_path = "path/to/your/image.jpg"
3image = Image.open(image_path)
4inputs = feature_extractor(images=image, return_tensors="pt")
5
6# Perform inference
7with torch.no_grad():
8 outputs = model(**inputs)
9
10# Get the predicted class
11predicted_class_idx = outputs.logits.argmax(-1).item()
12predicted_class = model.config.id2label[predicted_class_idx]
13
14print(f"Predicted sign: {predicted_class}")@misc{SignLanguageDetectionModel,
author = Hugo Alejandro Guerra Peralta,
title = Sign Language Detection using Fine-tuned ResNet-50,
year = 2024,
howpublished = {\url{https://huggingface.co/achedguerra/resnet-50-signal_language}}
}