lucascriistiano commited on
Commit
9bd7097
1 Parent(s): 9183f24

feat: initial version

Browse files
Files changed (3) hide show
  1. app.py +17 -3
  2. model/best.onnx +3 -0
  3. requirements.txt +2 -0
app.py CHANGED
@@ -1,7 +1,21 @@
1
  import gradio as gr
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  iface.launch()
 
1
  import gradio as gr
2
+ import torch
3
+ from transformers import pipeline
4
 
 
 
5
 
6
+ model = pipeline('onnx', model='model/best.onnx')
7
+
8
+ def object_detection(image):
9
+ results = model(image)
10
+
11
+ return {
12
+ 'image': image,
13
+ 'detections': results
14
+ }
15
+
16
+ inputs = gr.inputs.Image()
17
+ outputs = gr.outputs.Image(label='Input Image', type='numpy'), gr.outputs.JSON(label='Object Detections')
18
+
19
+ iface = gr.Interface(fn=object_detection, inputs=inputs, outputs=outputs)
20
+
21
  iface.launch()
model/best.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bde60c3139326613178f27bcdc47baf8124380722e9328987bd26390c30262a4
3
+ size 28552986
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ torch==2.0.0
2
+ git+https://github.com/huggingface/transformers.git