Image Classification
Transformers
Safetensors
English
siglip
Hindi-Sign-Language-Detection
SigLIP2
93M
Instructions to use prithivMLmods/Hindi-Sign-Language-Detection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Hindi-Sign-Language-Detection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="prithivMLmods/Hindi-Sign-Language-Detection") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForImageClassification processor = AutoProcessor.from_pretrained("prithivMLmods/Hindi-Sign-Language-Detection") model = AutoModelForImageClassification.from_pretrained("prithivMLmods/Hindi-Sign-Language-Detection", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files12345632 unmodified lines39404142---license: apache-2.0---```pyClassification Report:32 unmodified linesaccuracy 0.9425 16177macro avg 0.9433 0.9426 0.9413 16177weighted avg 0.9457 0.9425 0.9425 16177```12345678910111213141516171819202132 unmodified lines54555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169---license: apache-2.0datasets:- Vedant3907/Hindi-Sign-Language-Datasetlanguage:- enbase_model:- google/siglip2-base-patch16-224pipeline_tag: image-classificationlibrary_name: transformerstags:- Hindi-Sign-Language-Detection- SigLIP2- 93M---# Hindi-Sign-Language-Detection> Hindi-Sign-Language-Detection is a vision-language model fine-tuned from google/siglip2-base-patch16-224 for multi-class image classification. It is trained to detect and classify Hindi sign language hand gestures into corresponding Devanagari characters using the SiglipForImageClassification architecture.```pyClassification Report:32 unmodified linesaccuracy 0.9425 16177macro avg 0.9433 0.9426 0.9413 16177weighted avg 0.9457 0.9425 0.9425 16177```---## Label Space: 29 ClassesThe model classifies a hand sign into one of the following 29 Hindi characters:```json"id2label": {"0": "ऋ","1": "क","2": "ख","3": "ग","4": "घ","5": "ङ","6": "च","7": "छ","8": "ज","9": "झ","10": "ट","11": "ठ","12": "ड","13": "ण","14": "त","15": "थ","16": "द","17": "न","18": "प","19": "फ","20": "ब","21": "भ","22": "म","23": "य","24": "र","25": "ल","26": "व","27": "स","28": "ह"}```---## Install Dependencies```bashpip install -q transformers torch pillow gradio```---## Inference Code```pythonimport gradio as grfrom transformers import AutoImageProcessor, SiglipForImageClassificationfrom PIL import Imageimport torch# Load model and processormodel_name = "prithivMLmods/Hindi-Sign-Language-Detection" # Replace with actual pathmodel = SiglipForImageClassification.from_pretrained(model_name)processor = AutoImageProcessor.from_pretrained(model_name)# Hindi label mappingid2label = {"0": "ऋ", "1": "क", "2": "ख", "3": "ग", "4": "घ","5": "ङ", "6": "च", "7": "छ", "8": "ज", "9": "झ","10": "ट", "11": "ठ", "12": "ड", "13": "ण", "14": "त","15": "थ", "16": "द", "17": "न", "18": "प", "19": "फ","20": "ब", "21": "भ", "22": "म", "23": "य", "24": "र","25": "ल", "26": "व", "27": "स", "28": "ह"}def classify_hindi_sign(image):image = Image.fromarray(image).convert("RGB")inputs = processor(images=image, return_tensors="pt")with torch.no_grad():outputs = model(**inputs)logits = outputs.logitsprobs = torch.nn.functional.softmax(logits, dim=1).squeeze().tolist()prediction = {id2label[str(i)]: round(probs[i], 3) for i in range(len(probs))}return prediction# Gradio Interfaceiface = gr.Interface(fn=classify_hindi_sign,inputs=gr.Image(type="numpy"),outputs=gr.Label(num_top_classes=3, label="Hindi Sign Classification"),title="Hindi-Sign-Language-Detection",description="Upload an image of a Hindi sign language hand gesture to identify the corresponding character.")if __name__ == "__main__":iface.launch()```---## Intended UseHindi-Sign-Language-Detection can be used in:* Educational tools for learning Indian sign language.* Assistive technology for hearing and speech-impaired individuals.* Real-time sign-to-text translation applications.* Human-computer interaction for Hindi users.
README.md+128-1