(self, args)
| 37 | |
| 38 | class LayoutPredictor(object): |
| 39 | def __init__(self, args): |
| 40 | pre_process_list = [ |
| 41 | {"Resize": {"size": [800, 608]}}, |
| 42 | { |
| 43 | "NormalizeImage": { |
| 44 | "std": [0.229, 0.224, 0.225], |
| 45 | "mean": [0.485, 0.456, 0.406], |
| 46 | "scale": "1./255.", |
| 47 | "order": "hwc", |
| 48 | } |
| 49 | }, |
| 50 | {"ToCHWImage": None}, |
| 51 | {"KeepKeys": {"keep_keys": ["image"]}}, |
| 52 | ] |
| 53 | postprocess_params = { |
| 54 | "name": "PicoDetPostProcess", |
| 55 | "layout_dict_path": args.layout_dict_path, |
| 56 | "score_threshold": args.layout_score_threshold, |
| 57 | "nms_threshold": args.layout_nms_threshold, |
| 58 | } |
| 59 | |
| 60 | self.preprocess_op = create_operators(pre_process_list) |
| 61 | self.postprocess_op = build_post_process(postprocess_params) |
| 62 | ( |
| 63 | self.predictor, |
| 64 | self.input_tensor, |
| 65 | self.output_tensors, |
| 66 | self.config, |
| 67 | ) = utility.create_predictor(args, "layout", logger) |
| 68 | self.use_onnx = args.use_onnx |
| 69 | |
| 70 | def __call__(self, img): |
| 71 | ori_im = img.copy() |
nothing calls this directly
no test coverage detected