Spaces:
Runtime error
Runtime error
Niv Sardi
commited on
Commit
·
5dea5bb
1
Parent(s):
e7640ca
types types types
Browse filesSigned-off-by: Niv Sardi <xaiki@evilgiggle.com>
- python/imtool.py +3 -3
python/imtool.py
CHANGED
|
@@ -81,7 +81,7 @@ def read_bounding_boxes(filename: str):
|
|
| 81 |
def read_centroids(filename: str):
|
| 82 |
return read_marker(filename, Centroid)
|
| 83 |
|
| 84 |
-
def coord_dict_to_point(c):
|
| 85 |
return coord_to_point(c['x'], c['y'], c['width'], c['heigh'])
|
| 86 |
|
| 87 |
def coord_to_point(cx, cy, cw, ch):
|
|
@@ -89,10 +89,10 @@ def coord_to_point(cx, cy, cw, ch):
|
|
| 89 |
y = math.floor(cy + ch/2)
|
| 90 |
return f"{x} {y} {math.ceil(cw)} {math.ceil(ch)}"
|
| 91 |
|
| 92 |
-
def floor_point(x, y):
|
| 93 |
return (math.floor(x), math.floor(y))
|
| 94 |
|
| 95 |
-
def cut_img(im, s, e):
|
| 96 |
x = s[0]
|
| 97 |
y = s[1]
|
| 98 |
w = e[0] - x
|
|
|
|
| 81 |
def read_centroids(filename: str):
|
| 82 |
return read_marker(filename, Centroid)
|
| 83 |
|
| 84 |
+
def coord_dict_to_point(c: dict):
|
| 85 |
return coord_to_point(c['x'], c['y'], c['width'], c['heigh'])
|
| 86 |
|
| 87 |
def coord_to_point(cx, cy, cw, ch):
|
|
|
|
| 89 |
y = math.floor(cy + ch/2)
|
| 90 |
return f"{x} {y} {math.ceil(cw)} {math.ceil(ch)}"
|
| 91 |
|
| 92 |
+
def floor_point(x: float, y: float):
|
| 93 |
return (math.floor(x), math.floor(y))
|
| 94 |
|
| 95 |
+
def cut_img(im, s: (float, float), e: (float, float)):
|
| 96 |
x = s[0]
|
| 97 |
y = s[1]
|
| 98 |
w = e[0] - x
|