File size: 618 Bytes
6e577c6 f5b910d b30795f f5b910d b30795f 0de94bc 5af6a0f 6e577c6 5af6a0f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import gradio as gr
from ultralytics import YOLO
# import torch
model = YOLO('best.pt')
def predict(input_image):
"""
Predict model output
"""
price = "0"
return [input_image, price]
with gr.Blocks() as demo:
# Title
gr.Markdown(
"""
<h1 align="center">AI Cafeteria Price Evaluator</h1>
""")
# Model Evaluation
gr.Interface(
fn=predict,
inputs=gr.Image(type="pil"),
outputs=[gr.Image(type="pil", label="Image Prediction"),
gr.Textbox(type="text", label="Price Prediction")]
)
if __name__ == "__main__":
demo.launch()
|