Spaces:
Runtime error
Runtime error
Niv Sardi
commited on
Commit
·
63501c1
1
Parent(s):
1415715
obey mypy
Browse filesSigned-off-by: Niv Sardi <[email protected]>
- python/common/mkdir.py +2 -1
- python/imtool.py +2 -2
python/common/mkdir.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import pathlib
|
|
|
2 |
|
3 |
-
def make_dirs(dirs: [str]):
|
4 |
for p in dirs:
|
5 |
pathlib.Path(p).mkdir(parents=True, exist_ok=True)
|
6 |
|
|
|
1 |
import pathlib
|
2 |
+
from typing import List
|
3 |
|
4 |
+
def make_dirs(dirs: List[str]):
|
5 |
for p in dirs:
|
6 |
pathlib.Path(p).mkdir(parents=True, exist_ok=True)
|
7 |
|
python/imtool.py
CHANGED
@@ -4,7 +4,7 @@ import os
|
|
4 |
import math
|
5 |
import cv2
|
6 |
import numpy as np
|
7 |
-
from typing import NamedTuple
|
8 |
|
9 |
from entity import Entity
|
10 |
from common import mkdir
|
@@ -92,7 +92,7 @@ def coord_to_point(cx, cy, cw, ch):
|
|
92 |
def floor_point(x: float, y: float):
|
93 |
return (math.floor(x), math.floor(y))
|
94 |
|
95 |
-
def cut_img(im, s:
|
96 |
x = s[0]
|
97 |
y = s[1]
|
98 |
w = e[0] - x
|
|
|
4 |
import math
|
5 |
import cv2
|
6 |
import numpy as np
|
7 |
+
from typing import NamedTuple, Tuple
|
8 |
|
9 |
from entity import Entity
|
10 |
from common import mkdir
|
|
|
92 |
def floor_point(x: float, y: float):
|
93 |
return (math.floor(x), math.floor(y))
|
94 |
|
95 |
+
def cut_img(im, s: Tuple[float, float], e: Tuple[float, float]):
|
96 |
x = s[0]
|
97 |
y = s[1]
|
98 |
w = e[0] - x
|