Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added PP-LCNet_x1_0_doc_ori_infer.onnx
Binary file not shown.
6 changes: 4 additions & 2 deletions rapid_table_det/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ class PPLCNet:
def __init__(self, config: Dict[str, Any]):
self.model = OrtInferSession(config)
self.img_loader = LoadImage()
self.resize_shape = [624, 624]
# self.resize_shape = [624, 624]
self.resize_shape = [224, 224]

def __call__(self, img, **kwargs):
start = time.time()
Expand All @@ -311,7 +312,8 @@ def __call__(self, img, **kwargs):
pred_label = mini_batch_result[0]
return pred_label, time.time() - start

def img_preprocess(self, img, resize_shape=[624, 624]):
#def img_preprocess(self, img, resize_shape=[624, 624]):
def img_preprocess(self, img, resize_shape=[224, 224]):
im, new_w, new_h, left, top = ResizePad(img, resize_shape[0])
im = np.array(im).transpose((2, 0, 1)) / 255.0
return im[None, :].astype("float32")