import torch import torch.nn as nn import numpy as np from torchvision import models, transforms import time import os import copy import pickle from PIL import Image import datetime import gdown import urllib.request import gradio as gr import markdown # load model state and class names from gdrive # issue accessing the link. updated permissions #https://drive.google.com/file/d/1m9C-WMfKRDCmScxTh8JmcoFtymxAqjS3/view?usp=sharing # url = 'https://drive.google.com/uc?id=1m9C-WMfKRDCmScxTh8JmcoFtymxAqjS3' path_class_names = "./class_names_restnet_leeds_butterfly.pkl" # MAX_TRIES = 10 # i = 0 # while(iPyTorch image classification - A pretrained ResNet18 CNN trained on the Leeds Butterfly Dataset

The Leeds Butterfly Dataset consists of 832 images in 10 classes:


Part of a dissertation project. Author: ttheland

''') iface = gr.Interface( do_inference, im, gr.outputs.Label(num_top_classes=3), live=False, interpretation=None, title=title, description=description, article= article_text, examples=examples, theme="dark-peach" ) iface.test_launch() iface.launch(share=True, enable_queue=True)