mirror of
https://github.com/PaddlePaddle/PaddleClas.git
synced 2025-06-03 21:55:06 +08:00
Merge branch 'whole_chain' of https://github.com/RainFrost1/PaddleClas into whole_chain
This commit is contained in:
commit
a7b0b49726
@ -37,22 +37,25 @@ class RecPredictor(Predictor):
|
|||||||
self.postprocess = build_postprocess(config["RecPostProcess"])
|
self.postprocess = build_postprocess(config["RecPostProcess"])
|
||||||
self.benchmark = config["Global"].get("benchmark", False)
|
self.benchmark = config["Global"].get("benchmark", False)
|
||||||
|
|
||||||
import auto_log
|
if self.benchmark:
|
||||||
pid = os.getpid()
|
import auto_log
|
||||||
self.auto_logger = auto_log.AutoLogger(
|
pid = os.getpid()
|
||||||
model_name=config["Global"].get("model_name", "rec"),
|
self.auto_logger = auto_log.AutoLogger(
|
||||||
model_precision='fp16' if config["Global"]["use_fp16"] else 'fp32',
|
model_name=config["Global"].get("model_name", "rec"),
|
||||||
batch_size=config["Global"].get("batch_size", 1),
|
model_precision='fp16'
|
||||||
data_shape=[3, 224, 224],
|
if config["Global"]["use_fp16"] else 'fp32',
|
||||||
save_path=config["Global"].get("save_log_path", "./auto_log.log"),
|
batch_size=config["Global"].get("batch_size", 1),
|
||||||
inference_config=self.config,
|
data_shape=[3, 224, 224],
|
||||||
pids=pid,
|
save_path=config["Global"].get("save_log_path",
|
||||||
process_name=None,
|
"./auto_log.log"),
|
||||||
gpu_ids=None,
|
inference_config=self.config,
|
||||||
time_keys=[
|
pids=pid,
|
||||||
'preprocess_time', 'inference_time', 'postprocess_time'
|
process_name=None,
|
||||||
],
|
gpu_ids=None,
|
||||||
warmup=2)
|
time_keys=[
|
||||||
|
'preprocess_time', 'inference_time', 'postprocess_time'
|
||||||
|
],
|
||||||
|
warmup=2)
|
||||||
|
|
||||||
def predict(self, images, feature_normalize=True):
|
def predict(self, images, feature_normalize=True):
|
||||||
input_names = self.paddle_predictor.get_input_names()
|
input_names = self.paddle_predictor.get_input_names()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user