1Batch Size: 32
2Epochs: 100 (early stopped at 42)
3Learning Rate: 1e-3 (OneCycleLR)
4Weight Decay: 1e-4
5Dropout: 0.3
6Train Samples: 6,160
7Val Samples: 1,540
1import torch
2import numpy as np
3from train_asl_improved import ImprovedASLModel
4
5# Load model
6model = ImprovedASLModel(num_classes=77)
7checkpoint = torch.load('best_model.pth', map_location='cpu')
8model.load_state_dict(checkpoint['model_state_dict'])
9model.eval()
10
11# Load label encoder
12classes = np.load('label_encoder_classes.npy', allow_pickle=True)
13
14# Inference
15landmarks = torch.randn(1, 30, 2, 21, 3) # (batch, seq_len, hands, landmarks, coords)
16mask = torch.ones(1, 30) # Valid frames mask
17
18with torch.no_grad():
19 logits = model(landmarks, mask)
20 pred = torch.argmax(logits, dim=-1)
21 print(f"Predicted: {classes[pred.item()]}")
1@misc{asl-recognition-improved,
2 title={Improved ASL Recognition with CNN+LSTM},
3 author={namratha2412},
4 year={2025},
5 howpublished={\url{https://huggingface.co/namratha2412/asl-recognition}}
6}