Speed up Python build by only building binary graph
PiperOrigin-RevId: 576260883
This commit is contained in:
parent
c698414c71
commit
5f2b9fd765
17
setup.py
17
setup.py
|
@ -272,13 +272,14 @@ class BuildModules(build_ext.build_ext):
|
|||
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)
|
||||
|
@ -312,7 +313,7 @@ class BuildModules(build_ext.build_ext):
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user