fjenett commited on
Commit
88de542
1 Parent(s): fb41312

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -8
app.py CHANGED
@@ -1,15 +1,28 @@
1
  import gradio as gr
2
  import AAMD
 
 
3
 
4
- pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
 
 
 
5
 
6
- def predict(image):
7
- predictions = pipeline(image)
8
- return {p["label"]: p["score"] for p in predictions}
 
 
 
 
 
 
 
 
9
 
10
  gr.Interface(
11
- predict,
12
- inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
13
- outputs=gr.outputs.Label(num_top_classes=2),
14
- title="Hot Dog? Or Not?",
15
  ).launch()
 
1
  import gradio as gr
2
  import AAMD
3
+ from pyAAMED import pyAAMED
4
+ import cv2
5
 
6
+ title = """
7
+ <h1>Arc Adjacency Matrix based Fast Ellipse Detection</h1>
8
+ <a href="https://github.com/Li-Zhaoxi/AAMED">Gitub</a>
9
+ """
10
 
11
+ def detect_ellipses(img_path):
12
+ imgC = cv2.imread(img_path)
13
+ imgG = cv2.cvtColor(imgC, cv2.COLOR_BGR2GRAY)
14
+
15
+ aamed = pyAAMED(600, 600)
16
+
17
+ aamed.setParameters(3.1415926/3, 3.4, 0.77)
18
+ res = aamed.run_AAMED(imgG)
19
+ print(res)
20
+
21
+ return img
22
 
23
  gr.Interface(
24
+ detect_ellipses,
25
+ inputs=gr.inputs.Image(label="Upload image with ellipses", type="filepath"),
26
+ outputs=gr.outputs.Image(label="Detected ellipses"),
27
+ title=title,
28
  ).launch()