diff --git a/main.py b/main.py index f49a13f..fa58a09 100644 --- a/main.py +++ b/main.py @@ -203,19 +203,38 @@ cv2.cvtColor(stethoscope_overlay_img, cv2.COLOR_RGB2BGR), ) - row = { - "image_file_name": image_file_name, - "left_shoulder_x": left_shoulder[1], - "left_shoulder_y": left_shoulder[0], - "right_shoulder_x": right_shoulder[1], - "right_shoulder_y": right_shoulder[0], - "left_hip_x": left_hip[1], - "left_hip_y": left_hip[0], - "right_hip_x": right_hip[1], - "right_hip_y": right_hip[0], - "stethoscope_x": stethoscope_x, - "stethoscope_y": stethoscope_y, - } + if POSENET_ENABLED: + row = { + "image_file_name": image_file_name, + "left_shoulder_x": left_shoulder[1], + "left_shoulder_y": left_shoulder[0], + "right_shoulder_x": right_shoulder[1], + "right_shoulder_y": right_shoulder[0], + "left_hip_x": left_hip[1], + "left_hip_y": left_hip[0], + "right_hip_x": right_hip[1], + "right_hip_y": right_hip[0], + "stethoscope_x": stethoscope_x, + "stethoscope_y": stethoscope_y, + } + elif RTMPOSE_ENABLED: + row = { + "image_file_name": image_file_name, + "left_shoulder_x": left_shoulder[0], + "left_shoulder_y": left_shoulder[1], + "right_shoulder_x": right_shoulder[0], + "right_shoulder_y": right_shoulder[1], + "left_hip_x": left_hip[0], + "left_hip_y": left_hip[1], + "right_hip_x": right_hip[0], + "right_hip_y": right_hip[1], + "stethoscope_x": stethoscope_x, + "stethoscope_y": stethoscope_y, + } + else: + print("No pose estimation method enabled. Please enable either PoseNet or RTMPose.") + continue + rows.append(row) source_points = np.array(