From 969d43f6b43654ade8948e9a0a8fe025b78c1010 Mon Sep 17 00:00:00 2001 From: ShenYuhan Date: Tue, 18 Feb 2020 10:55:18 +0800 Subject: [PATCH] turn i_img on --- paddlehub/serving/app_single.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/paddlehub/serving/app_single.py b/paddlehub/serving/app_single.py index 88d50486..ab4bcf71 100644 --- a/paddlehub/serving/app_single.py +++ b/paddlehub/serving/app_single.py @@ -135,7 +135,7 @@ def predict_gan(module, input_img, id, batch_size, extra={}): return results_pack -def predict_mask(module, input_img, id, batch_size, extra=None, r_img=False): +def predict_mask(module, input_img, id, batch_size, extra=None, r_img=True): output_folder = "detection_result" global use_gpu method_name = module.desc.attr.map.data['default_signature'].s @@ -147,9 +147,9 @@ def predict_mask(module, input_img, id, batch_size, extra=None, r_img=False): data.update(input_img) if extra is not None: data.update(extra) - r_img = True if "r_img" in extra.keys() else False + r_img = False if "r_img" in extra.keys() else True results = predict_method( - data=data, use_gpu=use_gpu, batch_size=batch_size) + data=data, visualization=r_img, use_gpu=use_gpu, batch_size=batch_size) results = utils.handle_mask_results(results) except Exception as err: curr = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())) @@ -160,7 +160,6 @@ def predict_mask(module, input_img, id, batch_size, extra=None, r_img=False): results_pack = [] if input_img is not None: if r_img is False: - shutil.rmtree(output_folder) for index in range(len(results)): results[index]["path"] = "" results_pack = results -- GitLab