instruction
stringclasses
9 values
input
stringlengths
279
5.47k
output
stringlengths
6
9.58k
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
`exp` call is not needed, if x == 0.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
The same for the constant. It's used several times. I propose to introduce named constant with description and use it.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
Added source.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
Guarded the constant with an anonymous namespace.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
Looks like the extra conditions are redundant. You can replace for loop with: ``` for (; i < len - vlanes; i += vlanes) ``` It's applicable for all cases in the PR.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
The idea is to also apply intrinsics on the tail by fetching the last vlanes elements, although it may introduce duplicated computation. This trick is borrowed from Halide. Below is an example. Assume vlanes=4 and we have 7 elements. Without this trick, the last 3 elements have to be processed by a extra for loop. With...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
I got the point. The problem is that you introduce several extra conditions in the loop. I propose to extract the condition and add vectorized tail computation with overlap after the loop.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25881: dnn: optimize activations with v_exp **Code Changes:** ```diff @@ -859,12 +859,6 @@ struct GeluFunctor : public BaseFunctor { one = vx_setall_f32(1.0f), reciprocal_sqr...
> Problem is spreading over codebase. I volunteer to take care of this if there is a list of this problem.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #25936: HAL for dot product added **Review Line:** 916 **Code Changes:** ```diff + * @param type Data type of both images, for example CV_8U or CV_32F + * @param dot_val Pointer to resulting dot product value + * @return int + */ ...
can we return int64_t instead of double?
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/src/hal_replacement.hpp **Change Type:** modified **Context:** PR #25936: HAL for dot product added **Review Line:** 916 **Code Changes:** ```diff + * @param type Data type of both images, for example CV_8U or CV_32F + * @param dot_val Pointer to resulting dot product value + * @return int + */ ...
Public interface: `double Mat::dot(InputArray _mat) const`. `int64_t` looks strange. Also the `::dot()` may handle floats and doubles.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/src/matmul.dispatch.cpp **Change Type:** modified **Context:** PR #25936: HAL for dot product added **Review Line:** 998 **Code Changes:** ```diff @@ -995,9 +995,18 @@ double Mat::dot(InputArray _mat) const CV_INSTRUMENT_REGION(); Mat mat = _mat.getMat(); + CV_Assert_N( mat.type()...
`CV_Assert_N` is deprecated due to malformed or useless error messages. Use `CV_Check*` instead.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_arithm.cpp **Change Type:** modified **Context:** PR #25902: Mask support with CV_Bool in ts and core **Code Changes:** ```diff @@ -2462,23 +2462,22 @@ TEST(Compare, regression_16F_do_not_crash) EXPECT_NO_THROW(cv::compare(mat1, mat2, dst, cv::CMP_EQ)); } - TEST(Core_minMaxIdx...
We should not modify existed tests. We should add new tests for new types support.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_arithm.cpp **Change Type:** modified **Context:** PR #25902: Mask support with CV_Bool in ts and core **Code Changes:** ```diff @@ -2462,23 +2462,22 @@ TEST(Compare, regression_16F_do_not_crash) EXPECT_NO_THROW(cv::compare(mat1, mat2, dst, cv::CMP_EQ)); } - TEST(Core_minMaxIdx...
I would make it random, 8U or bool
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core.hpp **Change Type:** modified **Context:** PR #25902: Mask support with CV_Bool in ts and core **Code Changes:** ```diff @@ -352,8 +352,8 @@ result of an incorrect sign in the case of overflow. @param src2 second input array or a scalar. @param dst output array that has th...
why not add CV_8S as yet another option, since we are doing changes anyway
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_arithm.cpp **Change Type:** modified **Context:** PR #25902: Mask support with CV_Bool in ts and core **Code Changes:** ```diff @@ -2462,23 +2462,22 @@ TEST(Compare, regression_16F_do_not_crash) EXPECT_NO_THROW(cv::compare(mat1, mat2, dst, cv::CMP_EQ)); } - TEST(Core_minMaxIdx...
Added couple of more tests.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/loadsave.cpp **Change Type:** modified **Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder **Code Changes:** ```diff @@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) { m_decoder->setSource(filename); CV_Asse...
It should be removed then, right? As soon as following `m_size = count;`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/loadsave.cpp **Change Type:** modified **Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder **Code Changes:** ```diff @@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) { m_decoder->setSource(filename); CV_Asse...
Also there is GDAL branch bellow.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/loadsave.cpp **Change Type:** modified **Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder **Code Changes:** ```diff @@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) { m_decoder->setSource(filename); CV_Asse...
``` m_size = m_decoder->getFrameCount(); if (m_size > 0) { m_pages.resize(m_size); return; } ``` if `m_frame_count` set by `m_decoder->readHeader()` set m_size and return.. otherways the following code needed. To remove the code below, we need to make sure that all decoders set the `m_frame_count` variable.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/loadsave.cpp **Change Type:** modified **Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder **Code Changes:** ```diff @@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) { m_decoder->setSource(filename); CV_Asse...
`m_frame_count = 1;` default for all decoders except AvifDecoder and TiffDecoder.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/loadsave.cpp **Change Type:** modified **Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder **Review Line:** 1272 **Code Changes:** ```diff @@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) { m_decoder->setSource(f...
You now need a GDAL implementation right?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/src/loadsave.cpp **Change Type:** modified **Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder **Review Line:** 1272 **Code Changes:** ```diff @@ -1263,26 +1263,8 @@ void ImageCollection::Impl::init(String const& filename, int flags) { m_decoder->setSource(f...
current GDAL decoder reads only one image. deleted lines changes nothing for actual GDAL decoder. imho adding overridden `nextPage()` to GDAL decoder should be in scope of other PR
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgcodecs/include/opencv2/imgcodecs.hpp **Change Type:** modified **Context:** PR #25814: add getFrameCount() member function to BaseImageDecoder **Code Changes:** ```diff @@ -305,11 +305,13 @@ The function imreadmulti loads a specified range from a multi-page image from th */ CV_EXPORTS_W bool imr...
This comment used the future tense, let's make it simpler: The function imcount returns the number of pages in a multi-page image (e.g. TIFF), the number of frames in an animation (e.g. AVIF), and 1 otherwise. If the image cannot be decoded, 0 is returned.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_obsensor_capture.cpp **Change Type:** modified **Context:** PR #23237: videoio: add support for Orbbec Femto Mega RGB-D camera **Review Line:** 39 **Code Changes:** ```diff static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16}; - static...
Why Motion JPEG? I propose to preserve the best quality by default, if possible.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_obsensor_capture.cpp **Change Type:** modified **Context:** PR #23237: videoio: add support for Orbbec Femto Mega RGB-D camera **Review Line:** 39 **Code Changes:** ```diff static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16}; - static...
For platform compatibility reasons, the YUYV format does not pass on some of the lower performance platforms we tested.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_obsensor_capture.cpp **Change Type:** modified **Context:** PR #23237: videoio: add support for Orbbec Femto Mega RGB-D camera **Review Line:** 39 **Code Changes:** ```diff static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16}; - static...
I propose to make MJPEG optional. (M)JPEG makes frames a bit blury. It affects feature detectors.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/src/cap_obsensor_capture.cpp **Change Type:** modified **Context:** PR #23237: videoio: add support for Orbbec Femto Mega RGB-D camera **Review Line:** 39 **Code Changes:** ```diff static const obsensor::StreamProfile depthProfile = {640, 480, 30, obsensor::FRAME_FORMAT_Y16}; - static...
MJPEG helps to save bandwidth (and connect multiple cameras). On other cameras some formats+fps are not available without compression (especially FHD+) - MJPEG or H264. BTW, MJPG is already used before this patch, see `colorProfile` on the line 35.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #25874: `videoio`: fix `cv::VideoWriter` with FFmpeg encapsulation timestamps **Code Changes:** ```diff @@ -211,6 +211,8 @@ enum VideoCaptureProperties { CAP_PROP_CODEC_EXTRADATA_INDEX = 68, //!< Positive index indi...
It'll be great to add some references to `cv::VideoCapture` properties. It's not obvious, if the properties are needed and how to extract them from the encoded stream.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #25874: `videoio`: fix `cv::VideoWriter` with FFmpeg encapsulation timestamps **Code Changes:** ```diff @@ -211,6 +211,8 @@ enum VideoCaptureProperties { CAP_PROP_CODEC_EXTRADATA_INDEX = 68, //!< Positive index indi...
The properties should be provided by or calculated from the parameters provided to the external encoder. Is this clearer in the below? ``` VIDEOWRITER_PROP_PTS_INDEX = 12, //!< Specifies the frame presentation index for each frame when encapsulating raw video (\ref VIDEOWRITER_PROP_RAW_VIDEO != 0). This property is **o...
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #25874: `videoio`: fix `cv::VideoWriter` with FFmpeg encapsulation timestamps **Code Changes:** ```diff @@ -211,6 +211,8 @@ enum VideoCaptureProperties { CAP_PROP_CODEC_EXTRADATA_INDEX = 68, //!< Positive index indi...
I mean slightly different thing. The VideoWriter user should get values for the new properties somehow. I see 2 sources: - get something for cv::VideoCapture and promote it to writer (good case). For the case we need a reference to VideoCapture props. - dig in IP camera settings or encoder settings manually (bad case)....
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/videoio/include/opencv2/videoio.hpp **Change Type:** modified **Context:** PR #25874: `videoio`: fix `cv::VideoWriter` with FFmpeg encapsulation timestamps **Code Changes:** ```diff @@ -211,6 +211,8 @@ enum VideoCaptureProperties { CAP_PROP_CODEC_EXTRADATA_INDEX = 68, //!< Positive index indi...
Right I was thinking of streams provided by external encoders (`cudacodec::VideoWriter`) not of the encapsulation of RTSP streams. For the first parameter (`VIDEOWRITER_PROP_PTS_INDEX`), if the frame rate is provided in the rtsp stream it is equivalent to dividing the current position of the video file (`CAP_PROP_POS_M...
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 81 **Code Changes:** ```diff + # Do top-k sampling of 50 + topk_indices = np.argpartition(probs, -50, axis=-1)[:, -50:] + topk_probs = np.take_along_axis(probs, top...
Do we really need softmax and normalization to just get top-k predictions? I think their order is not changed from raw logits.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Code Changes:** ```diff @@ -0,0 +1,125 @@ +''' +This is a sample script to run GPT-2 inference in OpenCV using ONNX model. +The script loads the GPT-2 model and runs inference on a given prompt. +Curr...
`import cv2 as cv`
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Code Changes:** ```diff @@ -0,0 +1,125 @@ +''' +This is a sample script to run GPT-2 inference in OpenCV using ONNX model. +The script loads the GPT-2 model and runs inference on a given prompt. +Curr...
maybe just `readNet`?
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 38 **Code Changes:** ```diff + + + +from copy import deepcopy +import numpy as np +import tiktoken +import argparse +import cv2 as cv + +def parse_args(): + parser = argparse.Argumen...
External dependency. Add instruction of how to install and which version.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 31 **Code Changes:** ```diff + + pip install tiktoken==0.7.0 + +2. Run the script: + + python gpt2_inference.py --model=<path-to-onnx-model> --max_seq_len=<max-output-lenght> --ba...
``` --prompt=<use-promt-of-the-same-length-used-while-exporting> ``` Can sample support simple padding in case of shorter prompt? Otherwise user cannot understand how to fill the same length.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 31 **Code Changes:** ```diff + + pip install tiktoken==0.7.0 + +2. Run the script: + + python gpt2_inference.py --model=<path-to-onnx-model> --max_seq_len=<max-output-lenght> --ba...
how to know head of time which prompt legth user used?
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 31 **Code Changes:** ```diff + + pip install tiktoken==0.7.0 + +2. Run the script: + + python gpt2_inference.py --model=<path-to-onnx-model> --max_seq_len=<max-output-lenght> --ba...
If model exported with some input shape we can accept prompt with less or equal length and pad in case of shorter prompt. There is an option to obtain input shape in OpenCV like this: https://github.com/opencv/opencv/blob/6a11847d579e95bc5cca64d951684d4b578870ae/modules/dnn/src/model.cpp#L51
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 81 **Code Changes:** ```diff + # Do top-k sampling of 50 + topk_indices = np.argpartition(probs, -50, axis=-1)[:, -50:] + topk_probs = np.take_along_axis(probs, top...
`np.random.choice` expect probabilities (sum to 1). otherwise you are correct
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 31 **Code Changes:** ```diff + + pip install tiktoken==0.7.0 + +2. Run the script: + + python gpt2_inference.py --model=<path-to-onnx-model> --max_seq_len=<max-output-lenght> --ba...
Let's use `max_input_length` as an additional parameter: https://github.com/search?q=repo%3Ahuggingface%2Ftransformers%20max_input_length&type=code
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Code Changes:** ```diff @@ -0,0 +1,125 @@ +''' +This is a sample script to run GPT-2 inference in OpenCV using ONNX model. +The script loads the GPT-2 model and runs inference on a given prompt. +Curr...
You can remove numpy from the list. It's already there as OpenCV dependency.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Code Changes:** ```diff @@ -0,0 +1,125 @@ +''' +This is a sample script to run GPT-2 inference in OpenCV using ONNX model. +The script loads the GPT-2 model and runs inference on a given prompt. +Curr...
It makes sense to use command line parameter for seed. Zero is good default value.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** samples/dnn/gpt2_inference.py **Change Type:** added **Context:** PR #25868: Add sample for GPT2 inference **Review Line:** 117 **Code Changes:** ```diff + if len(tokens) > input_token_size: + tokens = tokens[:input_token_size] + elif len(tokens) < input_token_size: + tokens2pad = input_t...
EOS I tried this. Your prompt followed by EOS make model output sentences that are not related to your prompt (as you indicatited end of context by EOS)
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
Please add table with author and compatibility notes like here: https://github.com/opencv/opencv/blob/4.x/doc/tutorials/calib3d/camera_calibration/camera_calibration.markdown
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
Please remove extra empty lines here and below in the document.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
the older Orbbec 3D which --> the older Orbbec 3D cameras which
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
If you can put your real name here?
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
It's not necessary in my opinion.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
You can remove the 4th item now.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
Can you add toggle to show the two pictures, same as the switch to show the two code version?
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
Can be removed too in my opinion.
You are an expert OpenCV code reviewer specializing in code quality and best practices. Review the provided code changes and provide specific, actionable feedback.
**File:** doc/tutorials/app/orbbec_uvc.markdown **Change Type:** added **Context:** PR #25907: Add tutorial on using Orbbec 3D cameras (UVC) **Code Changes:** ```diff @@ -0,0 +1,126 @@ +Using Orbbec 3D cameras (UVC) {#tutorial_orbbec_uvc} +==================================================== + +@tableofcontents + +@pr...
measurement limits --> depth range; potentially enhancing the visualization's relevance to a specific depth range --> removing invalid pixels on the depth map.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/checks/cpu_rvv.cpp **Change Type:** modified **Context:** PR #25883: Upgrade RISC-V Vector intrinsic and cleanup the obsolete RVV backend. **Code Changes:** ```diff @@ -1,17 +1,16 @@ #include <stdio.h> -#if defined(__riscv) -# include <riscv_vector.h> -# define CV_RVV 1 +#if !defined(__riscv) || !...
Let's make this file compatible with T-Head toolchain too. It uses old intrinsics, doesn't define `__riscv_v_intrinsics`, but have `__riscv_v` and `__THEAD_VERSION__` macros. Perhaps even simple `#include <riscv_vector.h>` would be enough to check that it works. Otherwise our CPU detection mechanism will not find RVV a...
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/checks/cpu_rvv.cpp **Change Type:** modified **Context:** PR #25883: Upgrade RISC-V Vector intrinsic and cleanup the obsolete RVV backend. **Code Changes:** ```diff @@ -1,17 +1,16 @@ #include <stdio.h> -#if defined(__riscv) -# include <riscv_vector.h> -# define CV_RVV 1 +#if !defined(__riscv) || !...
Ok, do you mean ... ```cpp #include <stdio.h> #if defined(__riscv) # include <riscv_vector.h> # define CV_RVV 1 #endif #if defined CV_RVV && !defined __THEAD_VERSION__ #if !defined(__riscv_v_intrinsic) || (__riscv_v_intrinsic < 12000) #error "RISC-V Vector Intrinsic v0.12 or higher is required." #endif int test() { con...
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** cmake/checks/cpu_rvv.cpp **Change Type:** modified **Context:** PR #25883: Upgrade RISC-V Vector intrinsic and cleanup the obsolete RVV backend. **Code Changes:** ```diff @@ -1,17 +1,16 @@ #include <stdio.h> -#if defined(__riscv) -# include <riscv_vector.h> -# define CV_RVV 1 +#if !defined(__riscv) || !...
Yes, it should work. Perhaps we could also simplify the file a bit to reduce macros depth: ```.cpp #if !defined(__riscv) || !defined(__riscv_v) #error "Not RISC-V or no RVV ..." #endif #if !defined(__THEAD_VERSION__) && defined(__riscv_v_intrinsic) && __riscv_v_intrinsic < 12000 #error "Wrong intrinsics ..." #endif #in...
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
Why not as a part of the previous loop?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
I recommend use shapes directly. Including 1D vector with multiple values.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
Could you define reduction operation on 0d / 1d tensor? Any reference?
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
formally there is not any. This test is to check if layer fails on singleton matrices
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
There are some in onnxruntime: https://github.com/microsoft/onnxruntime/blob/4a196d15940b0f328735c888e2e861d67602ffcf/onnxruntime/test/providers/cpu/reduction/reduction_ops_test.cc#L326 (Search for 0D).
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
incorrect comment
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
```suggestion cv::Mat output_ref = cv::Mat(std::vector<int>(input_shape.size(), 1), CV_32F, out_value); ```
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
Why do still we have ONE output value for matrix? Don't write WEAK tests.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
Sorry, I do not understand you. What could be output for 1D(or 0D) matrix under reduction operation other than one output value? What do you mean by output value?
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
Done! (did not see the comment, sorry)
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
in case of `[4, 4]` input and `axis=1` output is `[4, 1]`, so it also can be tested
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Review Line:** 490 **Code Changes:** ```diff +{ + auto reduceOperation = [](const cv::Mat& input, const std::string& operation, int axis) -> cv::Mat { + // Initialize result matrix + ...
Might be incorrect for `std::vector<int>({4})` test case (not represented). Number of input dimensions is 1 however output shape is not equal to input shape.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Review Line:** 502 **Code Changes:** ```diff + if (axis == 0) { + result = cv::Mat::zeros(1, input.cols, CV_32F); + } else { + result = cv::Mat:...
Can we simplify to something like this? ```cpp MatShape shape(input). if (!shape.empty()) shape[axis] = 1; result = cv::Mat::zeros(shape.size(), &shape[0], CV_32F); ```
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
Please clarify this condition. For example, `{1, 4}` input, axis=1 should be reduced to `{1x1}`: `[[a, b, c, d]]` -> `[[a*a + b*b + c*c + d*d]]`
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Review Line:** 592 **Code Changes:** ```diff + ASSERT_EQ(shape(output_ref), shape(outputs[0])); + normAssert(output_ref, outputs[0]); +} +INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Reduce_Te...
nit: use without parenthesis for simplificity, e.g. `std::vector<int>{}`.
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_layers_1d.cpp **Change Type:** modified **Context:** PR #25101: 1D test for Reduce layer **Code Changes:** ```diff @@ -480,6 +480,128 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/, Layer_Scatter_Test, Combine( +typedef testing::TestWithParam<tuple<std::vector<int>, std::string, int>> Lay...
Please drop debug printing.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core.hpp **Change Type:** modified **Context:** PR #25914: throw() -> noexcept **Code Changes:** ```diff @@ -123,12 +123,12 @@ class CV_EXPORTS Exception : public std::exception Instead, the macros CV_Error(), CV_Error_() and CV_Assert() are used. */ Exception(int...
Use `CV_NOEXCEPT` according to existed codebase,
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/ie_ngraph.hpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -17,7 +17,8 @@ #pragma warning(disable : 4245) #pragma warning(disable : 4268) #endif -#include <ngraph/ngraph.hpp> +#include ...
Should be valid even for earlier release: https://github.com/opencv/opencv/blob/0fabe2b9e9fac96957b553b6a83483bddfe129bb/modules/dnn/src/op_inf_engine.hpp#L49. Not sure about `ov::` namespace
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/ie_ngraph.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -14,7 +14,7 @@ #include <opencv2/dnn/shape_utils.hpp> #ifdef HAVE_DNN_NGRAPH -#include <ie_extension.h> +#include <openvino/c...
Is `ov::` available for `< 2020.3`?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -490,13 +490,13 @@ struct ReLUFunctor : public BaseFunctor #endif #ifdef HAVE_DNN_NGRAPH - std::shared_ptr...
```cpp #include <openvino/op/ops.hpp> ```
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -490,13 +490,13 @@ struct ReLUFunctor : public BaseFunctor #endif #ifdef HAVE_DNN_NGRAPH - std::shared_ptr...
And I think better to include it to `op_inf_engine.hpp`
You are an expert OpenCV code reviewer specializing in performance optimization. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/elementwise_layers.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -490,13 +490,13 @@ struct ReLUFunctor : public BaseFunctor #endif #ifdef HAVE_DNN_NGRAPH - std::shared_ptr...
Includes of separated ops speed up build. But I cannot use this approach with 2021 OpenVINO release :(
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/ie_ngraph.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -14,7 +14,7 @@ #include <opencv2/dnn/shape_utils.hpp> #ifdef HAVE_DNN_NGRAPH -#include <ie_extension.h> +#include <openvino/c...
do you need to support 4 years old OpenVINO? Can we say only 2022.1 and newer are supported? It will significantly simplify conditions in code where OpenVINO is used and also will allow to drop legacy cmake code and rely only on `find_package(OpenVINO)` 2 year since 2022.1 is a good release history
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/ie_ngraph.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -14,7 +14,7 @@ #include <opencv2/dnn/shape_utils.hpp> #ifdef HAVE_DNN_NGRAPH -#include <ie_extension.h> +#include <openvino/c...
Agree. For now CI works on 2021.4 so we can keep it to test it against OpenVINO API 2.0 (2022.x). I just mean that this lane changed under `#ifdef` and we don't test it. So specifically for this line, I recommend revert. Let's drop OpenVINO support for 2020.x in a separate PR.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/ie_ngraph.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -14,7 +14,7 @@ #include <opencv2/dnn/shape_utils.hpp> #ifdef HAVE_DNN_NGRAPH -#include <ie_extension.h> +#include <openvino/c...
> 2021.4 API 2.0 since 2022.1 If we want to drop IE:: and API 1.0, we need to test since 2022.1
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/ie_ngraph.hpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -17,7 +17,8 @@ #pragma warning(disable : 4245) #pragma warning(disable : 4268) #endif -#include <ngraph/ngraph.hpp> +#include ...
Conflicts with existing namespace https://github.com/opencv/opencv/actions/runs/8256827567/job/22596488054?pr=25199
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/ie_ngraph.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -14,7 +14,7 @@ #include <opencv2/dnn/shape_utils.hpp> #ifdef HAVE_DNN_NGRAPH -#include <ie_extension.h> +#include <openvino/c...
> I only recommend to do this in a separate PR But in this case we need to do double job: - Current PR supports both Pre and Post API 1.0 changes - Next PR removes Pre API 1.0 code path. I suppose we need to do it in one shot and just drop API 1.0 here
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/detection_output_layer.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Review Line:** 56 **Code Changes:** ```diff @@ -55,11 +55,7 @@ #ifdef HAVE_DNN_NGRAPH #include "../ie_ngraph.hpp" -#if INF_ENGINE_VE...
HAVE_DNN_NGRAPH => HAVE_DNN_OPENVINO ?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/net_openvino.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Review Line:** 14 **Code Changes:** ```diff #include <opencv2/core/utils/configuration.private.hpp> #include <opencv2/core/utils/logger.hpp> +#includ...
```suggestion #ifdef HAVE_OPENVINO ```
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/net_openvino.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -9,6 +9,12 @@ #include <opencv2/core/utils/configuration.private.hpp> #include <opencv2/core/utils/logger.hpp> +#include "...
it's removed in API 2.0
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/op_inf_engine.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Review Line:** 12 **Code Changes:** ```diff @@ -10,7 +10,7 @@ #include <opencv2/dnn/shape_utils.hpp> #ifdef HAVE_INF_ENGINE -#include <ie_extension....
```suggestion #ifdef HAVE_OPENVINO ```
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/op_inf_engine.hpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Review Line:** 24 **Code Changes:** ```diff -#define INF_ENGINE_RELEASE_2021_2 2021020000 -#define INF_ENGINE_RELEASE_2021_3 2021030000 -#define INF_ENG...
```suggestion #define OPENVINO_RELEASE_2024_0 2024000000 ``` and can we remove old ones?
You are an expert OpenCV code reviewer specializing in implementation quality. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/layers/detection_output_layer.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Review Line:** 56 **Code Changes:** ```diff @@ -55,11 +55,7 @@ #ifdef HAVE_DNN_NGRAPH #include "../ie_ngraph.hpp" -#if INF_ENGINE_VE...
Will cost a lot of changes as well as DNN_BACKEND_INFERENCE_ENGINE -> DNN_BACKEND_OPENVINO.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/op_inf_engine.hpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Review Line:** 24 **Code Changes:** ```diff -#define INF_ENGINE_RELEASE_2021_2 2021020000 -#define INF_ENGINE_RELEASE_2021_3 2021030000 -#define INF_ENG...
Let’s remove old ones, but keep IE notation to reduce changes.
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/op_inf_engine.hpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -19,19 +19,13 @@ #ifdef HAVE_INF_ENGINE -#define INF_ENGINE_RELEASE_2020_2 2020020000 -#define INF_ENGINE_RELEASE_2020_3...
Please remove this workaround with `CNNNetwork` alias
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/test/test_ie_models.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Review Line:** 269 **Code Changes:** ```diff - // Fill output blobs. + // Fill output tensors. outputsMap.clear(); - BlobMap outputBlobs...
Single failed test: ``` [ RUN ] DNNTestOpenVINO.models/0, where GetParam() = (NGRAPH/CPU, "age-gender-recognition-retail-0013") Exception message: OpenCV(4.9.0-dev) /home/openvino/opencv/modules/dnn/src/net_impl.cpp:570: error: (-215:Assertion failed) inp.total() in function 'allocateLayers' /home/openvino/opencv/modul...
You are an expert OpenCV code reviewer specializing in API design and compatibility. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/dnn/src/net_openvino.cpp **Change Type:** modified **Context:** PR #25199: Fix for OpenVINO 2024.0. OpenVINO 2022.1 as minimal supported version. **Code Changes:** ```diff @@ -9,6 +9,12 @@ #include <opencv2/core/utils/configuration.private.hpp> #include <opencv2/core/utils/logger.hpp> +#include "...
This is a workaround to wrap `ov::Model` from API 2.0: https://github.com/opencv/opencv/pull/25199/files#r1524623439
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/imgproc/test/test_smooth_bitexact.cpp **Change Type:** modified **Context:** PR #25911: Post-merge fixes for algorithm hint API **Review Line:** 296 **Code Changes:** ```diff - EXPECT_LE(nz, 0.06*src.total()); // Less 6% of different pixels - - double min_val, max_val; - minMaxLoc(flatten_di...
`EXPECT_LE(cvtest::norm(dst, gt, NORM_L1 | NORM_RELATIVE), 0.06); // Less 6% of different pixels`
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Code Changes:** ```diff @@ -1239,6 +1239,7 @@ namespace CV__SIMD_NAMESPACE { #define CV_SIMD 0 #endif +#include "intrin_math.hpp" #include "simd_utils.impl.hpp" #if...
Please add reference to the algorithm with name. Information about application range and quality will be very useful too.
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_intrin_utils.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Review Line:** 1702 **Code Changes:** ```diff @@ -1698,6 +1698,103 @@ template<typename R> struct TheTest return *this; } + void __test_exp(LaneType dataMax, Lane...
The test is very weak. v_exp() is critical function. We must test it properly. 1. We must test all the corner and popular cases ``` exp(nan)=nan, exp(0)=1, exp(1)~e, exp(inf)=inf, exp(-inf)=0, exp(88) < inf, exp(89..100)=inf (overflow), // check every number with step 0.1 or even 0.01 0<=exp(-100..-88)<FLT_MIN (underfl...
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Code Changes:** ```diff @@ -1239,6 +1239,7 @@ namespace CV__SIMD_NAMESPACE { #define CV_SIMD 0 #endif +#include "intrin_math.hpp" #include "simd_utils.impl.hpp" #if...
sure, I will do it
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Code Changes:** ```diff @@ -1239,6 +1239,7 @@ namespace CV__SIMD_NAMESPACE { #define CV_SIMD 0 #endif +#include "intrin_math.hpp" #include "simd_utils.impl.hpp" #if...
Almost all documentation in this file is ignored. This file contains too much conditional compilations through `#if` and template-based logic. Doxygen doesn't work properly with that. Documentation is stored and well structured in intrin_cpp.hpp
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Code Changes:** ```diff @@ -1239,6 +1239,7 @@ namespace CV__SIMD_NAMESPACE { #define CV_SIMD 0 #endif +#include "intrin_math.hpp" #include "simd_utils.impl.hpp" #if...
1. My suggestion is to move this and similar implementations into a separate file. There is already `simd_utils.impl.hpp`. It could be reused or created a new one like `simd_math.impl.hpp` 2. Also all functions should be guarded if some ISA has better support for these functions. At least intrin_cpp.hpp could use `std:...
You are an expert OpenCV code reviewer specializing in testing and validation. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/test/test_intrin_utils.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Review Line:** 1702 **Code Changes:** ```diff @@ -1698,6 +1698,103 @@ template<typename R> struct TheTest return *this; } + void __test_exp(LaneType dataMax, Lane...
Since `v_max(nan, x)` and `v_min(nan, x)` will not return `nan` except neon, I disabled this test. Are there some way to handle this case?
You are an expert OpenCV code reviewer specializing in documentation and code clarity. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Code Changes:** ```diff @@ -1239,6 +1239,7 @@ namespace CV__SIMD_NAMESPACE { #define CV_SIMD 0 #endif +#include "intrin_math.hpp" #include "simd_utils.impl.hpp" #if...
OK, I added a line in `intrin_cpp.hpp` for document ``` | Operations\\Types | float 32 | float 64 | |-------------------|:-:|:-:| ...... |exp | x | x | ```
You are an expert OpenCV code reviewer specializing in header file design and interface. Review the provided code changes and provide specific, actionable feedback.
**File:** modules/core/include/opencv2/core/hal/intrin.hpp **Change Type:** modified **Context:** PR #24941: Add support for v_exp (exponential) **Code Changes:** ```diff @@ -1239,6 +1239,7 @@ namespace CV__SIMD_NAMESPACE { #define CV_SIMD 0 #endif +#include "intrin_math.hpp" #include "simd_utils.impl.hpp" #if...
Let's implement item 2 too. I want to benchmark both options before merge.