File size: 553 Bytes
e5066c4
e13a0a4
6ac8084
e5066c4
e13a0a4
c484425
e5066c4
 
6ac8084
e13a0a4
 
 
e5066c4
e13a0a4
 
 
 
 
 
e5066c4
e13a0a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
import numpy as np
import tensorflow as tf

# Assuming your model is loaded here
model = tf.keras.models.load_model("pain_analysis.h5")

def predict(image):
    image = np.array(image) / 255.0  # Normalize the image
    # Make predictions using your model here
    # result = model.predict(image)
    return result

# Change this line to use gr.Image directly
iface = gr.Interface(
    fn=predict,
    inputs=gr.Image(type="numpy"),  # Use gr.Image directly
    outputs="label"  # Specify the output type as needed
)

iface.launch()