Aravindan's picture
Create app.py
839facb
raw
history blame
374 Bytes
import cv2, torch
import gradio as gr
import numpy as np
import torchvision.models as models
from torchvision import transforms as T
new_model = models.resnet18()
num_ftrs = new_model.fc.in_features
new_model.fc = nn.Linear(num_ftrs, 75)
checkpoint = torch.load('model_best_checkpoint.pth.tar')
new_model.load_state_dict(checkpoint['model'])
new_model.to(device)