You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#PoseLandmarkerRunner.cs
_textureFramePool = new Experimental.TextureFramePool(imageSource.textureWidth, imageSource.textureHeight, TextureFormat.RGBA32, 10);
// NOTE: we can share the GL context of the render thread with MediaPipe (for now, only on Android)
var canUseGpuImage = options.baseOptions.delegateCase == Tasks.Core.BaseOptions.Delegate.GPU &&
SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3 &&
GpuManager.GpuResources != null;
using var glContext = canUseGpuImage ? GpuManager.GetGlContext() : null;
while (true)
{
if (isPaused)
{
yield return new WaitWhile(() => isPaused);
}
if (!_textureFramePool.TryGetTextureFrame(out var textureFrame))
{
yield return new WaitForEndOfFrame();
continue;
}
// Build the input Image
Image image;
if (canUseGpuImage)
{
yield return new WaitForEndOfFrame();
textureFrame.ReadTextureOnGPU(imageSource.GetCurrentTexture(), flipHorizontally, flipVertically);
image = textureFrame.BuildGpuImage(glContext);
}
else
{
req = textureFrame.ReadTextureAsync(imageSource.GetCurrentTexture(), flipHorizontally, flipVertically);
yield return waitUntilReqDone;
if (req.hasError)
{
Debug.LogError($"Failed to read texture from the image source, exiting...");
break;
}
image = textureFrame.BuildCPUImage();
textureFrame.Release();
}
When I get the "Image image" data, how can I resize the image to reduce computational time consumption while keeping the input image at a high resolution.
thank you very much.
The text was updated successfully, but these errors were encountered:
I think generating an Image instance based on downscaled pixel data (= downscale it by yourself) would be a straightforward approach, but if you can modify the MediaPipe CalculatorGraph, it should be also possible to downscale the image using the ImageTransformationCalculator or GlScalerCalculator.
Description
#PoseLandmarkerRunner.cs
_textureFramePool = new Experimental.TextureFramePool(imageSource.textureWidth, imageSource.textureHeight, TextureFormat.RGBA32, 10);
// NOTE: we can share the GL context of the render thread with MediaPipe (for now, only on Android)
var canUseGpuImage = options.baseOptions.delegateCase == Tasks.Core.BaseOptions.Delegate.GPU &&
SystemInfo.graphicsDeviceType == GraphicsDeviceType.OpenGLES3 &&
GpuManager.GpuResources != null;
using var glContext = canUseGpuImage ? GpuManager.GetGlContext() : null;
When I get the "Image image" data, how can I resize the image to reduce computational time consumption while keeping the input image at a high resolution.
thank you very much.
The text was updated successfully, but these errors were encountered: