Spaces:
Runtime error
Runtime error
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 | |
url = 'https://drive.google.com/file/d/1GGnkicLQwgcgLq6sWClC_Igi8PWFQyV1' | |
#path_class_names = "./class_names_restnet_catsVSdogs.pkl" | |
gdown.download(url, path_class_names, quiet=False, use_cookies=False) | |
# Parameters | |
DATASET_PATH = '/content/APTOS2019' | |
PREP_PATH = DATASET_PATH + "/preprocessed/" | |
MODEL_PATH= '/content/APTOS2019/checkpoints/checkpoint_convnext.pth' | |
if not os.path.exists(PREP_PATH): | |
os.mkdir(PREP_PATH) | |
if not os.path.exists("/checkpoints"): | |
os.mkdir("/checkpoints") | |
def do_inference(): | |
return 0 | |
title = "ConvNeXt for Diabetic Retinopathy Detection" | |
description = "" | |
#examples = [['./cat.jpg'],['./dog.jpg']] | |
#article="<p style='text-align: center'><a href='https://github.com/mawady/colab-recipes-cv' target='_blank'>Colab Recipes for Computer Vision - Dr. Mohamed Elawady</a></p>" | |
iface = gr.Interface( | |
do_inference, | |
title=title, | |
description=description, | |
) | |
iface.test_launch() | |
#iface.launch() |