Make uploading to GPU optional in Image.GetGpuBuffer().
PiperOrigin-RevId: 529066617
This commit is contained in:
committed by
Copybara-Service
parent
3789156a41
commit
baa8fc68a1
@@ -113,11 +113,11 @@ class Image {
|
||||
#endif // MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER
|
||||
#endif // !MEDIAPIPE_DISABLE_GPU
|
||||
|
||||
// Get a GPU view. Automatically uploads from CPU if needed.
|
||||
const mediapipe::GpuBuffer GetGpuBuffer() const {
|
||||
#if !MEDIAPIPE_DISABLE_GPU
|
||||
if (use_gpu_ == false) ConvertToGpu();
|
||||
#endif // !MEDIAPIPE_DISABLE_GPU
|
||||
// Provides access to the underlying GpuBuffer storage.
|
||||
// Automatically uploads from CPU to GPU if needed and requested through the
|
||||
// `upload_to_gpu` argument.
|
||||
const mediapipe::GpuBuffer GetGpuBuffer(bool upload_to_gpu = true) const {
|
||||
if (!use_gpu_ && upload_to_gpu) ConvertToGpu();
|
||||
return gpu_buffer_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user