mamechin commited on
Commit
3095c45
1 Parent(s): a332a52

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +31 -0
  2. best.pt +3 -0
  3. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from ultralytics import YOLO
3
+ import torch
4
+ # model = YOLO('best.pt')
5
+ path = 'best.pt'
6
+ model = torch.hub.load("WongKinYiu/yolov7","custom",path,trust_repo=True)
7
+
8
+ def predict(input_image):
9
+ """
10
+ Predict model output
11
+ """
12
+ price = "0"
13
+ return [input_image, price]
14
+
15
+ with gr.Blocks() as demo:
16
+ # Title
17
+ gr.Markdown(
18
+ """
19
+ <h1 align="center">AI Cafeteria Price Evaluator</h1>
20
+ """)
21
+
22
+ # Model Evaluation
23
+ gr.Interface(
24
+ fn=predict,
25
+ inputs=gr.Image(type="pil"),
26
+ outputs=[gr.Image(type="pil", label="Image Prediction"),
27
+ gr.Textbox(type="text", label="Price Prediction")]
28
+ )
29
+
30
+ if __name__ == "__main__":
31
+ demo.launch()
best.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e649c278fc179eb0b75e136f2ea86a58a2dd84a7f77dba4fe2b93987d56e63df
3
+ size 75247994
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ torch
2
+ ultralytics