diff --git a/demo/key_point_detection/openpose_body/predict.py b/demo/key_point_detection/openpose_body/predict.py index 094e85d7cbe378ee16fdef60981c097dfa572ea5..0834899c3a35118f9b3d27251d789827da3aa521 100644 --- a/demo/key_point_detection/openpose_body/predict.py +++ b/demo/key_point_detection/openpose_body/predict.py @@ -5,5 +5,4 @@ if __name__ == "__main__": paddle.disable_static() model = hub.Module(name='openpose_body_estimation') - model.eval() out1, out2 = model.predict("demo.jpg") diff --git a/demo/key_point_detection/openpose_hands/predict.py b/demo/key_point_detection/openpose_hands/predict.py index 8c792dbb9a9cd665c349feffc1cbfb8b0ea4c307..78a3738985cd6d601b4858989c2d4ba2121532e7 100644 --- a/demo/key_point_detection/openpose_hands/predict.py +++ b/demo/key_point_detection/openpose_hands/predict.py @@ -5,5 +5,4 @@ if __name__ == "__main__": paddle.disable_static() model = hub.Module(name='openpose_hands_estimation') - model.eval() all_hand_peaks = model.predict("demo.jpg") diff --git a/hub_module/modules/image/keypoint_detection/openpose_body_estimation/module.py b/hub_module/modules/image/keypoint_detection/openpose_body_estimation/module.py index 011506d260b9b2ca01eaa5ac5bdb717044029364..0b1f9f32c52c50efc532ea8a360ed797287a2f6b 100644 --- a/hub_module/modules/image/keypoint_detection/openpose_body_estimation/module.py +++ b/hub_module/modules/image/keypoint_detection/openpose_body_estimation/module.py @@ -180,6 +180,7 @@ class BodyPoseModel(nn.Layer): return out6_1, out6_2 def predict(self, img_path: str, save_path: str = "result"): + self.eval() orgImg = cv2.imread(img_path) data, imageToTest_padded, pad = self.transform(orgImg) Mconv7_stage6_L1, Mconv7_stage6_L2 = self.forward(paddle.to_tensor(data)) diff --git a/hub_module/modules/image/keypoint_detection/openpose_hands_estimation/module.py b/hub_module/modules/image/keypoint_detection/openpose_hands_estimation/module.py index d3fb57f0d894cd86d64b56c3a66afecedb7fd721..cc983d8bff9cc6243343d23f0280fe5cffc331fa 100644 --- a/hub_module/modules/image/keypoint_detection/openpose_hands_estimation/module.py +++ b/hub_module/modules/image/keypoint_detection/openpose_hands_estimation/module.py @@ -170,6 +170,7 @@ class HandPoseModel(nn.Layer): return np.array(all_peaks) def predict(self, img_path: str, save_path: str = 'result', scale: list = [0.5, 1.0, 1.5, 2.0]): + self.eval() self.body_model = hub.Module(name='openpose_body_estimation') self.body_model.eval() org_img = cv2.imread(img_path)