Downloads · 30 days
0
Vecrist/resnet18-handsign-classifier
resnet18-handsign-classifier is a image classification model from Vecrist. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
This repository contains pre-trained PyTorch weights for a ResNet-18 model fine-tuned for American Sign Language (ASL) alphabetic hand sign classification (static letters A through Y, excluding motion-based letters J…
Downloads · 30 days
0
Access
Public
Updated Jul 20, 2026
Repo size
45.3 MB
Likes
0
Public
Click a slice to open those files.
.pth45.3 MB · 100%
From the Hugging Face model README
This repository contains pre-trained PyTorch weights for a ResNet-18 model fine-tuned for American Sign Language (ASL) alphabetic hand sign classification (static letters A through Y, excluding motion-based letters J and Z).
layer1-layer3, fine-tuned layer4 + custom head:
Linear(512, 256) -> BatchNorm1d(256) -> ReLU -> Dropout(0.3) -> Linear(256, 24)import torch
import torchvision.models as models
import torch.nn as nn
from PIL import Image
from torchvision import transforms
from huggingface_hub import hf_hub_download
# 1. Define Model Architecture
model = models.resnet18()
model.fc = nn.Sequential(
nn.Linear(512, 256),
nn.BatchNorm1d(256),
nn.ReLU(),
nn.Dropout(0.3),
nn.Linear(256, 24)
)
# 2. Download and Load Model Weights
weights_path = hf_hub_download(repo_id="Vecrist/resnet18-handsign-classifier", filename="ResNet-18_9848AccModel_weights.pth")
model.load_state_dict(torch.load(weights_path, map_location="cpu"))
model.eval()
# 3. Preprocess Image
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
# 4. Predict
# img = Image.open("path_to_handsign_image.jpg").convert("RGB")
# outputs = model(transform(img).unsqueeze(0))
# predicted_class_idx = outputs.argmax(dim=1).item()
0.0001 for layer4, 0.001 for FC head).CrossEntropyLossRandomResizedCrop(224), RandomHorizontalFlip, ImageNet Normalization.