YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Argentinian ID Validation Model
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.
Usage
- The model can be loaded in PyTorch using the
.pthfile or in ONNX format for deployment in a variety of environments. - You can test the model with the
test_model.pyscript.
Files
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.
Conversion to ONNX
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)
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support