Skip to content

Commit b0ba540

Browse files
committed
fix: fixed the elapse
1 parent 4dce0a5 commit b0ba540

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rapid_table/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import time
66
from dataclasses import asdict
77
from pathlib import Path
8-
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union, get_args
8+
from typing import Any, Dict, List, Optional, Tuple, Union, get_args
99

1010
import numpy as np
1111
from tqdm import tqdm
@@ -72,6 +72,8 @@ def __call__(
7272
ocr_results: Optional[Tuple[np.ndarray, Tuple[str], Tuple[float]]] = None,
7373
batch_size: int = 1,
7474
) -> RapidTableOutput:
75+
s = time.perf_counter()
76+
7577
if not isinstance(img_contents, list):
7678
img_contents = [img_contents]
7779

@@ -82,11 +84,9 @@ def __call__(
8284
type(img_content).__name__ if img_content is not None else "None"
8385
)
8486
raise TypeError(
85-
f"Type Error: Expected input of type [{type_names}], but received '{img_content}' of type {actual_type}."
87+
f"Type Error: Expected input of type [{type_names}], but received type {actual_type}."
8688
)
8789

88-
s = time.perf_counter()
89-
9090
results = RapidTableOutput()
9191

9292
total_nums = len(img_contents)
@@ -119,7 +119,7 @@ def __call__(
119119
return results
120120

121121
def _load_imgs(
122-
self, img_content: Union[Sequence[InputType], InputType]
122+
self, img_content: Union[List[InputType], InputType]
123123
) -> List[np.ndarray]:
124124
img_contents = img_content if isinstance(img_content, list) else [img_content]
125125
return [self.load_img(img) for img in img_contents]

0 commit comments

Comments
 (0)