Skip to content

Commit

Permalink
Speed up Python build by only building binary graph
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 576260883
  • Loading branch information
schmidt-sebastian authored and copybara-github committed Oct 24, 2023
1 parent c698414 commit 5f2b9fd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,14 @@ def run(self):
self._download_external_file(external_file)

binary_graphs = [
'face_detection/face_detection_short_range_cpu',
'face_detection/face_detection_full_range_cpu',
'face_landmark/face_landmark_front_cpu',
'hand_landmark/hand_landmark_tracking_cpu',
'holistic_landmark/holistic_landmark_cpu', 'objectron/objectron_cpu',
'pose_landmark/pose_landmark_cpu',
'selfie_segmentation/selfie_segmentation_cpu'
'face_detection/face_detection_short_range_cpu.binarypb',
'face_detection/face_detection_full_range_cpu.binarypb',
'face_landmark/face_landmark_front_cpu.binarypb',
'hand_landmark/hand_landmark_tracking_cpu.binarypb',
'holistic_landmark/holistic_landmark_cpu.binarypb',
'objectron/objectron_cpu.binarypb',
'pose_landmark/pose_landmark_cpu.binarypb',
'selfie_segmentation/selfie_segmentation_cpu.binarypb'
]
for elem in binary_graphs:
binary_graph = os.path.join('mediapipe/modules/', elem)
Expand Down Expand Up @@ -312,7 +313,7 @@ def _generate_binary_graph(self, binary_graph_target):
bazel_command.append('--define=OPENCV=source')

_invoke_shell_command(bazel_command)
_copy_to_build_lib_dir(self.build_lib, binary_graph_target + '.binarypb')
_copy_to_build_lib_dir(self.build_lib, binary_graph_target)


class GenerateMetadataSchema(build_ext.build_ext):
Expand Down

0 comments on commit 5f2b9fd

Please sign in to comment.