File size: 539 Bytes
8c2dbd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from fastai.vision.all import *
learn=load_learner("resnet_finetuned.pkl")

def classify_images(im):
    pred,idx,probs=learn.predict(im)
    s='Your submitted case has Prostate cancer of IUPC Grade '+pred
    return s



img=gr.Image(shape=(512,512),source="upload")
label=gr.Label()
examples=["0.jpeg","2.jpeg","4.jpeg"]

intf=gr.Interface(title="PCa Detection ProtoType",description="This is Protorype for our model presiction",fn=classify_images,inputs=img,outputs=label,examples=examples)
intf.launch(inline=False)