Add an option to set image preprocessing backend as gpu.
PiperOrigin-RevId: 483888202
This commit is contained in:
committed by
Copybara-Service
parent
ae5b09e2b2
commit
254f786624
@@ -243,8 +243,10 @@ class ImageSegmenterGraph : public core::ModelTaskGraph {
|
||||
// stream.
|
||||
auto& preprocessing =
|
||||
graph.AddNode("mediapipe.tasks.components.ImagePreprocessingSubgraph");
|
||||
bool use_gpu = components::DetermineImagePreprocessingGpuBackend(
|
||||
task_options.base_options().acceleration());
|
||||
MP_RETURN_IF_ERROR(ConfigureImagePreprocessing(
|
||||
model_resources,
|
||||
model_resources, use_gpu,
|
||||
&preprocessing
|
||||
.GetOptions<tasks::components::ImagePreprocessingOptions>()));
|
||||
image_in >> preprocessing.In(kImageTag);
|
||||
|
||||
Reference in New Issue
Block a user