-
-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
94 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#include "mediapipe_api/common.h" | ||
|
||
#ifndef _WIN32 | ||
thread_local struct sigaction mp_api::orig_act; | ||
thread_local sigjmp_buf mp_api::abrt_jbuf; | ||
|
||
void mp_api::sigabrt_handler(int sig) { | ||
siglongjmp(abrt_jbuf, 1); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
diff --git a/mediapipe/calculators/tflite/tflite_inference_calculator.cc b/mediapipe/calculators/tflite/tflite_inference_calculator.cc | ||
index 2c956d6..df8b3c7 100644 | ||
--- a/mediapipe/calculators/tflite/tflite_inference_calculator.cc | ||
+++ b/mediapipe/calculators/tflite/tflite_inference_calculator.cc | ||
@@ -431,12 +431,14 @@ mediapipe::Status TfLiteInferenceCalculator::Process(CalculatorContext* cc) { | ||
|
||
// 1. Receive pre-processed tensor inputs. | ||
if (gpu_input_) { | ||
- MP_RETURN_IF_ERROR(ProcessInputsGpu(cc, | ||
#if MEDIAPIPE_TFLITE_METAL_INFERENCE | ||
+ MP_RETURN_IF_ERROR(ProcessInputsGpu(cc, | ||
compute_encoder, | ||
-#endif // MEDIAPIPE_TFLITE_METAL_INFERENCE | ||
- | ||
output_tensors_gpu.get())); | ||
+#else | ||
+ MP_RETURN_IF_ERROR(ProcessInputsGpu(cc, | ||
+ output_tensors_gpu.get())); | ||
+#endif // MEDIAPIPE_TFLITE_METAL_INFERENCE | ||
} else { | ||
MP_RETURN_IF_ERROR(ProcessInputsCpu(cc, output_tensors_cpu.get())); | ||
} | ||
@@ -462,11 +464,13 @@ mediapipe::Status TfLiteInferenceCalculator::Process(CalculatorContext* cc) { | ||
|
||
// 3. Output processed tensors. | ||
if (gpu_output_ || use_advanced_gpu_api_) { | ||
- MP_RETURN_IF_ERROR(ProcessOutputsGpu(cc, std::move(output_tensors_cpu), | ||
#if MEDIAPIPE_TFLITE_METAL_INFERENCE | ||
- compute_encoder, | ||
-#endif // MEDIAPIPE_TFLITE_METAL_INFERENCE | ||
+ MP_RETURN_IF_ERROR(ProcessOutputsGpu(cc, std::move(output_tensors_cpu), | ||
+ compute_encoder, std::move(output_tensors_gpu))); | ||
+#else | ||
+ MP_RETURN_IF_ERROR(ProcessOutputsGpu(cc, std::move(output_tensors_cpu), | ||
std::move(output_tensors_gpu))); | ||
+#endif // MEDIAPIPE_TFLITE_METAL_INFERENCE | ||
} else { | ||
MP_RETURN_IF_ERROR(ProcessOutputsCpu(cc, std::move(output_tensors_cpu))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters