Browse Source

修改print为logging.info (#1558)

Co-authored-by: SI YI <18893465250@163.com>
xiao mu 3 years ago
parent
commit
e1c6af4474
1 changed files with 4 additions and 4 deletions
  1. 4 4
      paddlex/utils/utils.py

+ 4 - 4
paddlex/utils/utils.py

@@ -182,8 +182,8 @@ class Timer(Times):
         ) * self.img_num + self.inference_time_s.value(
         ) + self.postprocess_time_s.value() * self.img_num
         total_time = round(total_time, 4)
-        print("------------------ Inference Time Info ----------------------")
-        print("total_time(ms): {}, img_num: {}, batch_size: {}".format(
+        logging.info("------------------ Inference Time Info ----------------------")
+        logging.info("total_time(ms): {}, img_num: {}, batch_size: {}".format(
             total_time * 1000, self.img_num, self.img_num))
         preprocess_time = round(
             self.preprocess_time_s.value() / self.repeats,
@@ -195,9 +195,9 @@ class Timer(Times):
                                4) if average else self.inference_time_s.value()
 
         average_latency = total_time / self.repeats
-        print("average latency time(ms): {:.2f}, QPS: {:2f}".format(
+        logging.info("average latency time(ms): {:.2f}, QPS: {:2f}".format(
             average_latency * 1000, 1 / average_latency))
-        print("preprocess_time_per_im(ms): {:.2f}, "
+        logging.info("preprocess_time_per_im(ms): {:.2f}, "
               "inference_time_per_batch(ms): {:.2f}, "
               "postprocess_time_per_im(ms): {:.2f}".format(
                   preprocess_time * 1000, inference_time * 1000,