Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,7 @@ def detect_ellipses(img_path):
|
|
17 |
|
18 |
ammed_size = 600
|
19 |
|
|
|
20 |
iheight, iwidth = imgG.shape
|
21 |
imax = max(iheight, iwidth)
|
22 |
iscale = ammed_size / imax
|
@@ -36,19 +37,23 @@ def detect_ellipses(img_path):
|
|
36 |
else:
|
37 |
ipad = int((imax - iwidth) / 2 * iscale)
|
38 |
imgG = cv2.copyMakeBorder(imgG, 0, 0, ipad, ipad, cv2.BORDER_REPLICATE)
|
|
|
39 |
|
40 |
aamed = pyAAMED(ammed_size, ammed_size)
|
41 |
aamed.setParameters(3.1415926/3, 3.4, 0.77)
|
42 |
|
43 |
result = aamed.run_AAMED(imgG)
|
44 |
print(result)
|
|
|
|
|
45 |
if result != "":
|
46 |
result = ",".join(filter(lambda s: s != "", result.split(" ")))
|
47 |
print(result)
|
48 |
result = json.loads(result)
|
49 |
print(result)
|
|
|
50 |
|
51 |
-
return [Image.fromarray(imgG),
|
52 |
|
53 |
examples = [
|
54 |
["./AAMED/python/002_0038.jpg"]
|
|
|
17 |
|
18 |
ammed_size = 600
|
19 |
|
20 |
+
"""
|
21 |
iheight, iwidth = imgG.shape
|
22 |
imax = max(iheight, iwidth)
|
23 |
iscale = ammed_size / imax
|
|
|
37 |
else:
|
38 |
ipad = int((imax - iwidth) / 2 * iscale)
|
39 |
imgG = cv2.copyMakeBorder(imgG, 0, 0, ipad, ipad, cv2.BORDER_REPLICATE)
|
40 |
+
"""
|
41 |
|
42 |
aamed = pyAAMED(ammed_size, ammed_size)
|
43 |
aamed.setParameters(3.1415926/3, 3.4, 0.77)
|
44 |
|
45 |
result = aamed.run_AAMED(imgG)
|
46 |
print(result)
|
47 |
+
|
48 |
+
"""
|
49 |
if result != "":
|
50 |
result = ",".join(filter(lambda s: s != "", result.split(" ")))
|
51 |
print(result)
|
52 |
result = json.loads(result)
|
53 |
print(result)
|
54 |
+
"""
|
55 |
|
56 |
+
return [Image.fromarray(imgG), result]
|
57 |
|
58 |
examples = [
|
59 |
["./AAMED/python/002_0038.jpg"]
|