File size: 727 Bytes
43721ce 5517146 c5da014 5517146 a900d50 5517146 5dc06ac 5517146 5dc06ac 5517146 3125630 5517146 |
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() |