Downloads · 30 days
0
Lautarosuarez/argentinian_ids
argentinian_ids is a machine learning model from Lautarosuarez. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model was trained to validate Argentinian IDs based on images of the front, back, and invalid IDs. The model uses a ResNet18 architecture and classifies images into three categories: validfront, validback, and in…
Downloads · 30 days
0
Access
Public
Updated Sep 27, 2024
Repo size
44.8 MB
Likes
0
Public
Click a slice to open those files.
.pth44.8 MB · 100%
From the Hugging Face model README
This model was trained to validate Argentinian IDs based on images of the front, back, and invalid IDs. The model uses a ResNet18 architecture and classifies images into three categories: valid_front, valid_back, and invalid.
.pth file or in ONNX format for deployment in a variety of environments.test_model.py script.argentinian_id_validation.py: Code used for training the model.test_model.py: Script to test the model on new data.dni_image_validation_model.pth: PyTorch model weights.dni_image_validation_model.onnx: ONNX version of the model.To convert the PyTorch model to ONNX, the following code was used:
import torch
import torchvision.models as models
model = models.resnet18(pretrained=False)
model.fc = torch.nn.Linear(model.fc.in_features, 3) # 3 classes
model.load_state_dict(torch.load('dni_image_validation_model.pth'))
dummy_input = torch.randn(1, 3, 224, 224) # Input shape
torch.onnx.export(model, dummy_input, "dni_image_validation_model.onnx",
input_names=['input'], output_names=['output'],
opset_version=11)