Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| from huggingface_hub import from_pretrained_keras | |
| def infer(filepath): | |
| image_tensor = np.load(filepath) | |
| prediction = model.predict(np.expand_dims(image_tensor, axis=0))[0] | |
| confidence = 100 * (1 - prediction[0]) | |
| return confidence | |
| model = from_pretrained_keras('jalFaizy/3D_CNN') | |
| filepath = gr.inputs.File() | |
| text = gr.outputs.Textbox() | |
| iface = gr.Interface( | |
| infer, | |
| filepath, | |
| text, | |
| title='3D CNN for CT scans', | |
| examples=['example_1_normal.npy'] | |
| ) | |
| iface.launch() |