Spaces:
Runtime error
Runtime error
import gradio as gr | |
import tensorflow as tf | |
import keras | |
from keras.datasets import mnist | |
import matplotlib.pyplot as plt | |
(train_images, train_labels), (test_images, test_labels) = mnist.load_data() | |
def get_digit(digit_choice): | |
digit = train_images[digit_choice] | |
fig = plt.figure() | |
plt.imshow(digit) | |
out_txt = "digit: %d" % digit_choice | |
return fig, out_txt | |
iface = gr.Interface( | |
fn = get_digit, | |
#inputs='image', | |
#inputs=[gr.inputs.Image(label="Input Image", source="webcam")], | |
inputs = [ | |
gr.inputs.Dropdown([0, 1, 2, 3]) | |
#gr.inputs.Number() | |
#'text' | |
], | |
#outputs='image', | |
outputs=[gr.outputs.Image(type="plot"), 'text'], | |
title='page title', | |
description='page description' | |
) | |
iface.launch() | |