Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,7 +38,21 @@ def detect_ellipses(img_path):
|
|
38 |
|
39 |
result = aamed.run_AAMED(imgG)
|
40 |
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
examples = []
|
44 |
|
|
|
38 |
|
39 |
result = aamed.run_AAMED(imgG)
|
40 |
|
41 |
+
if len(result) > 0:
|
42 |
+
imgN = imgG.copy()
|
43 |
+
imgN = cv2.cvtColor(imgN, cv2.COLOR_BRAY2RGB)
|
44 |
+
for e in result:
|
45 |
+
x, y, w, h, a, _ = e
|
46 |
+
imgN = cv2.ellipse(imgN, (x, y), (w, h), -a, 0, 360, (0, 255, 0), 3) # image, center_coordinates, axesLength, angle, startAngle, endAngle, color, thickness
|
47 |
+
"""
|
48 |
+
temp.center.x = detEllipses[i].center.y;
|
49 |
+
temp.center.y = detEllipses[i].center.x;
|
50 |
+
temp.size.height = detEllipses[i].size.width;
|
51 |
+
temp.size.width = detEllipses[i].size.height;
|
52 |
+
temp.angle = -detEllipses[i].angle;
|
53 |
+
"""
|
54 |
+
|
55 |
+
return [Image.fromarray(imgN), json.dumps(result.tolist())]
|
56 |
|
57 |
examples = []
|
58 |
|