Skip to content

Commit af8ea68

Browse files
[quality] Fix mypy issues
1 parent 8d2e8fb commit af8ea68

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

onnxtr/models/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _resolve_sub_lines(self, boxes: np.ndarray, word_idcs: list[int]) -> list[li
7474
"""
7575
lines = []
7676
# Sort words horizontally
77-
word_idcs = [word_idcs[idx] for idx in boxes[word_idcs, 0].argsort().tolist()] # type: ignore[call-overload]
77+
word_idcs = [word_idcs[idx] for idx in boxes[word_idcs, 0].argsort().tolist()]
7878

7979
# Eventually split line horizontally
8080
if len(word_idcs) < 2:

onnxtr/models/recognition/models/master.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __call__(self, logits: np.ndarray) -> list[tuple[str, float]]:
106106
"".join(self._embedding[idx] for idx in encoded_seq).split("<eos>")[0] for encoded_seq in out_idxs
107107
]
108108

109-
return list(zip(word_values, np.clip(probs, 0, 1).astype(float).tolist())) # type: ignore[arg-type]
109+
return list(zip(word_values, np.clip(probs, 0, 1).astype(float).tolist()))
110110

111111

112112
def _master(

onnxtr/utils/visualization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ def draw_boxes(boxes: np.ndarray, image: np.ndarray, color: tuple[int, int, int]
274274
_boxes[:, [1, 3]] *= h
275275
_boxes = _boxes.astype(np.int32)
276276
for box in _boxes.tolist():
277-
xmin, ymin, xmax, ymax = box # type: ignore[misc]
277+
xmin, ymin, xmax, ymax = box
278278
image = cv2.rectangle(
279279
image,
280-
(xmin, ymin), # type: ignore[has-type]
281-
(xmax, ymax), # type: ignore[has-type]
280+
(xmin, ymin),
281+
(xmax, ymax),
282282
color=color if isinstance(color, tuple) else (0, 0, 255),
283283
thickness=2,
284284
)

0 commit comments

Comments
 (0)