models.get_model
The get_model function provides a way to quickly download a prebuilt model for easy testing of leap-ie.
preprocessing_fn, model, class_list = get_model(model_name)Arguments
model_name(str): Name of a Torchvision or Hugging Face model.Required: Yes
Default: None
Examples:
Torchvision:
get_model('torchvision.resnet18')Hugging Face:
get_model('nateraw/vit-age-classifier')
Returns
preprocessing_fnThe preprocessing function used on inputs for inference.
modelThe model.
class_listList of class names corresponding to the model's output classes.