File size: 363 Bytes
f87a566
e89f6b4
cbb2e86
5738df6
 
 
 
 
 
cbb2e86
5738df6
 
f87a566
1
2
3
4
5
6
7
8
9
10
11
12
13
14

import numpy as np

def image_classifier(inp):
  confidence_scores = np.random.rand(3)
  confidence_scores/= np.sum(confidence_scores)
  classes= ['cable','case', 'cpu']
  result= {classes[i]: confidence_scores[i] for i in range(3)}
  return result

import gradio as gr
demo = gr.Interface(fn=image_classifier, inputs = "image", outputs = "label")
demo.launch()