File size: 727 Bytes
8e8fa00
c074efd
900259d
 
8e8fa00
 
900259d
8e8fa00
 
900259d
 
3ddee97
 
900259d
 
 
 
 
 
 
 
 
376136d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from PIL import Image

# Import the ObstructionDetector class from your module
from obstruction_detector import ObstructionDetector

# Create an instance of ObstructionDetector
detector = ObstructionDetector()

# Define a Gradio function to process the image and return the report
def process_image(image):
    # Call the detect_obstruction method of the ObstructionDetector with the PIL image
    report = detector.detect_obstruction(image)
    
    return report

# Define the Gradio interface
iface = gr.Interface(fn=process_image, 
                     inputs=gr.inputs.Image(shape=(224, 224)),  # Adjust shape as needed
                     outputs="text")

# Launch the Gradio interface
iface.launch()