ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

Why does NEScale.run() run much slower than cv::resize with any InterpolationPolicy in OpenCV?

Open duhuanxianzi opened this issue 9 years ago • 7 comments

Hi, I have some problem about NEScale.cpp. Compared between NEScale and cv::resize function, I found NEScale.run() run much slower than cv::resize with any InterpolationPolicy in OpenCV. Why?

neon_resize_test.cpp Image src, dst;

unsigned int width = 1024;
unsigned int height = 1024;

unsigned int resize_width = 1256;
unsigned int resize_height = 1256;
 
 src.allocator()->init(TensorInfo(width, height, Format::U8));
TensorInfo dst_tensor_info(resize_width, resize_height, Format::U8);

dst.allocator()->init(dst_tensor_info);


NEScale resize;
resize.configure(&src, &dst, InterpolationPolicy::BILINEAR, BorderMode::UNDEFINED);

   //Allocate all the images
    src.allocator()->allocate();
dst.allocator()->allocate();
   .
   .
  resize.run();   //Test runtime
   .
   .

duhuanxianzi avatar May 12 '17 06:05 duhuanxianzi

How did you compile the library? To get optimal performance it has to be compiled with debug=0.

mpflanzer avatar May 12 '17 06:05 mpflanzer

I am sure debug=0 when compling the library. For cv::cvtcolor. NEColorConvert runs faster than cvtcolor.

duhuanxianzi avatar May 12 '17 07:05 duhuanxianzi

Great, thanks for confirming. Which platform are you using for the comparison? Have you tried running the scale function multiple times in a loop to compute the average of the runtime?

mpflanzer avatar May 12 '17 07:05 mpflanzer

Yes, I run the scale funtion 100 times in a loop. The platform is based on Cortex-A53 with arm-v7.

duhuanxianzi avatar May 12 '17 07:05 duhuanxianzi

@duhuanxianzi Have you solve that problem? I also found that NEScale.run() run much slower than cv::resize?And other arm ComputeLibrary functions also showed bad performance than opencv function.

szavc avatar Jun 20 '17 09:06 szavc

Hi to all

I also experienced slower performance with NEScale compared to cv::resize in OpenCV.

@duhuanxianzi Could you please help me to use NEColorConvert instead of cvtColor with CV_BGR2GRAY? What flags should I use in computeLibrary?

zanazakaryaie avatar May 24 '18 13:05 zanazakaryaie

@zanazakaryaie You can find the supported color formats here and the supported conversions here. Unfortunately BGR2GRAY is not supported by ACL.

mpekatsoula avatar Sep 20 '18 11:09 mpekatsoula