I was doing similar things today, and had the same results on my Jetson NX running in the NVP model 2 mode (15W, 6 core).

Using the CPU to resize an image 10,000 times was faster than resizing the same image 10,000 times with the GPU.

This was my code for the CPU:

cv::Mat cpu_original_image = cv::imread("test.png"); // 1400x690 RGB image
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::Mat cpu_resized_image;
    cv::resize(cpu_original_image, cpu_resized_image, desired_image_size);
}

This was my code for the GPU:

cv::cuda::GpuMat gpu_original_image;
gpu_original_image.upload(cpu_original_image);
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::cuda::GpuMat gpu_resized_image;
    cv::cuda::resize(gpu_original_image, gpu_resized_image, desired_image_size);
}

My timing code (not shown above) was only for the for() loops, it didn't include imread() nor upload().

When called in a loop 10K times, my results were:

  • CPU: 5786.930 milliseconds
  • GPU: 9678.054 milliseconds (plus an additional 170.587 milliseconds for the upload())

Then I made 1 change to each loop. I moved the "resized" mat outside of the loop to prevent it from being created and destroyed at each iteration. My code then looked like this:

cv::Mat cpu_original_image = cv::imread("test.png"); // 1400x690 RGB image
cv::Mat cpu_resized_image;
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::resize(cpu_original_image, cpu_resized_image, desired_image_size);
}

...and for the GPU:

cv::cuda::GpuMat gpu_original_image;
gpu_original_image.upload(cpu_original_image);
cv::cuda::GpuMat gpu_resized_image;
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::cuda::resize(gpu_original_image, gpu_resized_image, desired_image_size);
}

The for() loop timing results are now:

  • CPU: 5768.181 milliseconds (basically unchanged)
  • GPU: 2827.898 milliseconds (from 9.7 seconds to 2.8 seconds)

This looks much better! GPU resize is now faster than CPU resize...as long as you're doing lots of work with the GPU and not a single resize. And as long as you don't continuously re-allocate temporary GPU mats, as that seems to be quite expensive.


But after all this, to go back to your original question: if all you are doing is resizing a single image once, or resizing many images once each, the GPU resize won't help you since uploading each image to the GPU mat will take longer than the original resize! Here are my results when trying that on a Jetson NX:

  • single image resize on CPU: 3.565 milliseconds
  • upload mat to GPU: 186.966 milliseconds
  • allocation of 2nd GPU mat and gpu resize: 225.925 milliseconds

So on the CPU the NX can do it in < 4 milliseconds, while on the GPU it takes over 400 milliseconds.

Answer from Stéphane on Stack Overflow
🌐
Aescripts
aescripts.com › gpuresize
GPUResize - aescripts.com
GPUResize is a GPU accelerated plugin for Adobe After Effects and Adobe Premiere with realtime performance and advanced image interpolation abilities that are missing natively.
Premiere Pro
The best plugins and scripts for 3D, VFX and motion graphics software including Adobe After Effects, Cinema 4D and Premiere Pro. Lots of video tutorials showing how to use the tools provided.
After Effects
The best plugins and scripts for 3D, VFX and motion graphics software including Adobe After Effects, Cinema 4D and Premiere Pro. Lots of video tutorials showing how to use the tools provided.
Create an Account
The best plugins and scripts for 3D, VFX and motion graphics software including Adobe After Effects, Cinema 4D and Premiere Pro. Lots of video tutorials showing how to use the tools provided.
ZXP Installer
Now also installs UXP extensions! Download our free ZXP/UXP extension installer. It is designed to work when other installers fail.
🌐
YouTube
youtube.com › aescripts + aeplugins
GPU Resize Demo - YouTube
http://aescripts.com/gpuresizeFast and advanced gpu-based image interpolation
Published   October 9, 2014
Views   11K
Top answer
1 of 1
7

I was doing similar things today, and had the same results on my Jetson NX running in the NVP model 2 mode (15W, 6 core).

Using the CPU to resize an image 10,000 times was faster than resizing the same image 10,000 times with the GPU.

This was my code for the CPU:

cv::Mat cpu_original_image = cv::imread("test.png"); // 1400x690 RGB image
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::Mat cpu_resized_image;
    cv::resize(cpu_original_image, cpu_resized_image, desired_image_size);
}

This was my code for the GPU:

cv::cuda::GpuMat gpu_original_image;
gpu_original_image.upload(cpu_original_image);
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::cuda::GpuMat gpu_resized_image;
    cv::cuda::resize(gpu_original_image, gpu_resized_image, desired_image_size);
}

My timing code (not shown above) was only for the for() loops, it didn't include imread() nor upload().

When called in a loop 10K times, my results were:

  • CPU: 5786.930 milliseconds
  • GPU: 9678.054 milliseconds (plus an additional 170.587 milliseconds for the upload())

Then I made 1 change to each loop. I moved the "resized" mat outside of the loop to prevent it from being created and destroyed at each iteration. My code then looked like this:

cv::Mat cpu_original_image = cv::imread("test.png"); // 1400x690 RGB image
cv::Mat cpu_resized_image;
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::resize(cpu_original_image, cpu_resized_image, desired_image_size);
}

...and for the GPU:

cv::cuda::GpuMat gpu_original_image;
gpu_original_image.upload(cpu_original_image);
cv::cuda::GpuMat gpu_resized_image;
for (size_t count = 0; count < number_of_times_to_iterate; count ++)
{
    cv::cuda::resize(gpu_original_image, gpu_resized_image, desired_image_size);
}

The for() loop timing results are now:

  • CPU: 5768.181 milliseconds (basically unchanged)
  • GPU: 2827.898 milliseconds (from 9.7 seconds to 2.8 seconds)

This looks much better! GPU resize is now faster than CPU resize...as long as you're doing lots of work with the GPU and not a single resize. And as long as you don't continuously re-allocate temporary GPU mats, as that seems to be quite expensive.


But after all this, to go back to your original question: if all you are doing is resizing a single image once, or resizing many images once each, the GPU resize won't help you since uploading each image to the GPU mat will take longer than the original resize! Here are my results when trying that on a Jetson NX:

  • single image resize on CPU: 3.565 milliseconds
  • upload mat to GPU: 186.966 milliseconds
  • allocation of 2nd GPU mat and gpu resize: 225.925 milliseconds

So on the CPU the NX can do it in < 4 milliseconds, while on the GPU it takes over 400 milliseconds.

🌐
Gfxplugin
gfxplugin.com › product › 170 › download-gpuresize.html
Download GPUResize v1.2 Cracked + Activation Serial
August 15, 2020 - GPUResize is a GPU rapid plugin for Adobe After Effects And Adobe Premiere using realtime functionality and innovative image interpolation skills that are missing.
Rating: 4.2 ​ - ​ 519 votes
🌐
OpenCV Q&A Forum
answers.opencv.org › question › 221223 › how-to-resize-image-with-nvidia-gpu
How to resize image with nvidia GPU? - OpenCV Q&A Forum
#include <opencv2/opencv.hpp> #include "opencv2/cudaimgproc.hpp" #include "opencv2/cudawarping.hpp" using namespace std; using namespace cv; using namespace cv::cuda; static void gpuResize(Mat in, Mat out){ double k = in.cols/416.; cuda::GpuMat gpuInImage; cuda::GpuMat gpuOutImage; gpuInImage.upload(in); const Size2i &newSize = Size(416, in.rows / k); cout << "newSize " << newSize<< endl; cuda::resize(gpuInImage, gpuOutImage, newSize); gpuOutImage.download(out); } int main(){ Mat im = Mat::zeros(Size(832,832),CV_8UC3); Mat out; if (getCudaEnabledDeviceCount() == 0){ return cerr << "No GPU found or the library is compiled without CUDA support" << endl, -1; } cv::cuda::printShortCudaDeviceInfo(cv::cuda::getDevice()); gpuResize(im,out); cout << "real size="<<out.size() <<endl; }
🌐
Aescripts
aescripts.com › forums › discussion › 721 › gpuresize
GPUResize - aescripts + aeplugins
GPUResize https://aescripts.com/gpuresize/ Fast and advanced gpu-based image interpolation
🌐
ToolFarm
toolfarm.com › home › products › gpuresize
GPUResize -
December 27, 2022 - GPUResize is a GPU accelerated plugin for Adobe After Effects and Adobe Premiere with realtime performance and advanced image interpolation abilities that are missing natively.
Find elsewhere
🌐
Prmuban
prmuban.com › 5377.html
PR插件 GPU加速插件提高画质量清晰度插件 GPUResize v1.2 Win/Mac-PR模板网
June 10, 2019 - GPUResize是Adobe After Effects和Adobe Premiere的GPU加速插件,具有本机丢失的实时性能和高级图像插值功能。
🌐
visualstorms
visualstorms.com › home › shop › gpuresize v1.2 plugin for after effect
GPUResize v1.2 Plugin For After Effect | visualstorms
GPUResize v1.2 Plugin For After Effect
GPUResize v1.2 Plugin For After Effect GPUResize v1.2 plugin to enhance the image quality in After Effects   This section includes the GPUResize plugin version 1.2 for Aftereffect software, which is available for download on the site. With the help of this plugin, you can increase the quality of the photo when you enlarge it. GPUResize v1.2 Plugin For After Effect Fast and advanced gpu-based image interpolation. https://youtu.be/S3jIpdC808A   GPUResize is a GPU accelerated plugin for Adobe After Effects and Adobe Premiere with realtime performance and advanced image int
Price   $12.99
🌐
Personal View
personal-view.com › talks › discussion › 16160 › gh2-720p-upscaling-great-high-quality-affordable-plugin › p1
GH2 720p upscaling: great high quality affordable plugin - Personal View Talks
GPUresize is a plugin for Premiere and After Effects. It has a new feature called stairstep upscaling. This feature combined with the built in Kaiser upscaling algorithm deliver amazing results for upscaling 720p to 1080p.
🌐
Adobe Download
adobedownload.org › home › asset sources › aescripts › gpuresize v1.2 – aescripts
GPUResize v1.2 - Aescripts » Adobe Download
June 7, 2019 - Aescripts | GPUResize v1.2 Full Crack | Free Download!!! Fast and advanced gpu-based image interpolation. Use cases of GPUResize aren’t only limited to
🌐
battleever
battleever.weebly.com › gpuresize-12-for-after-effects.html
GPUResize 1.2 For After Effects - battleever
GPUResize 1.2 For After Effects · Pixelmator 3.8.4.90521 · Stardew Valley · GraphicRiver Low Poly Generator · Videohive Liquid Slideshow 17796083 · AnyTrans For Android 7.1.0 (20190321) Neat Video Pro For FCPX Motion 5 Mac · Algoriddim Djay Pro 2.1.1 + Complete FX ·
🌐
Stack Overflow
stackoverflow.com › questions › 31105204 › issues-with-gpuresize
c++ - Issues with gpu::resize - Stack Overflow
I am trying to calculate HOG features on GPU for different levels and then I am saving features of each level to a yml file. Below is the function that I am using. void App::run() { unsigned ...
🌐
Twitter
twitter.com › taranvh › status › 1112874478952800256
Twitter
April 1, 2019 - JavaScript is not available · We’ve detected that JavaScript is disabled in this browser. Please enable JavaScript or switch to a supported browser to continue using twitter.com. You can see a list of supported browsers in our Help Center · Help Center · Terms of Service Privacy Policy ...
🌐
GitHub
github.com › CMU-Perceptual-Computing-Lab › openpose › issues › 1347
Ubuntu: CvMatToOpInput with gpuResize=true leads to crash · Issue #1347 · CMU-Perceptual-Computing-Lab/openpose
September 3, 2019 - At an earlier point I create two member variables. When calling mPoseExtractorCaffe.forwardPass() the application crashes if and only if mGpuResize equals true · The following code works when mGpuResize is set to false. And crashes otherwise
🌐
Pinterest
pinterest.com › explore
Fast and advanced gpu-based image interpolation.
Skip to content · When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures · Log in · Sign up
Published   May 17, 2020