diff --git a/modules/image/keypoint_detection/pp-tinypose/infer.py b/modules/image/keypoint_detection/pp-tinypose/infer.py index 8e5fe3f7f8a2a5ac644d37f6076c746314993fdb..d9b838ba5ae0ee46bd5c009c65c8a945ce1ce0af 100644 --- a/modules/image/keypoint_detection/pp-tinypose/infer.py +++ b/modules/image/keypoint_detection/pp-tinypose/infer.py @@ -219,20 +219,14 @@ class Detector(object): end_index = min((i + 1) * self.batch_size, len(image_list)) batch_image_list = image_list[start_index:end_index] # preprocess - self.det_times.preprocess_time_s.start() inputs = self.preprocess(batch_image_list) - self.det_times.preprocess_time_s.end() # model prediction - self.det_times.inference_time_s.start() result = self.predict() - self.det_times.inference_time_s.end() # postprocess - self.det_times.postprocess_time_s.start() + result = self.postprocess(inputs, result) - self.det_times.postprocess_time_s.end() - self.det_times.img_num += len(batch_image_list) if visual: visualize(batch_image_list, diff --git a/modules/image/keypoint_detection/pp-tinypose/keypoint_infer.py b/modules/image/keypoint_detection/pp-tinypose/keypoint_infer.py index 5b1206cfd4fc080fe7b5ea0a2f4f168b0d1ce053..7ce8fb2abc51e8dc3b585a55220c86bb42e32d66 100644 --- a/modules/image/keypoint_detection/pp-tinypose/keypoint_infer.py +++ b/modules/image/keypoint_detection/pp-tinypose/keypoint_infer.py @@ -91,7 +91,6 @@ class KeyPointDetector(Detector): def get_person_from_rect(self, image, results): # crop the person result from image - self.det_times.preprocess_time_s.start() valid_rects = results['boxes'] rect_images = [] new_rects = [] @@ -103,7 +102,6 @@ class KeyPointDetector(Detector): rect_images.append(rect_image) new_rects.append(new_rect) org_rects.append(org_rect) - self.det_times.preprocess_time_s.end() return rect_images, new_rects, org_rects def postprocess(self, inputs, result): @@ -168,20 +166,12 @@ class KeyPointDetector(Detector): end_index = min((i + 1) * self.batch_size, len(image_list)) batch_image_list = image_list[start_index:end_index] # preprocess - self.det_times.preprocess_time_s.start() inputs = self.preprocess(batch_image_list) - self.det_times.preprocess_time_s.end() # model prediction - self.det_times.inference_time_s.start() result = self.predict() - self.det_times.inference_time_s.end() - # postprocess - self.det_times.postprocess_time_s.start() result = self.postprocess(inputs, result) - self.det_times.postprocess_time_s.end() - self.det_times.img_num += len(batch_image_list) if visual: if not os.path.exists(self.output_dir):