Spaces:
Runtime error
Runtime error
import gradio as gr | |
def process_images(files): | |
# Instantiate your AI model | |
ai_model = gr.Interface.load("models/facebook/dino-vitb16") | |
processed_files = [] | |
for file in files: | |
# Process the image with your AI model | |
processed_image = ai_model.predict(file) | |
processed_files.append(processed_image) | |
return processed_files | |
# Define the Gradio interface | |
iface = gr.Interface( | |
fn=process_images, | |
inputs=[ | |
gr.inputs.File(multiple=True, label="Upload Blueprints"), | |
], | |
outputs=[ | |
gr.outputs.Image(type="pil", multiple=True, label="Processed Blueprints"), | |
], | |
) | |
# Launch the Gradio interface | |
iface.launch() | |