nareshmlx/opencv-pr huggingface dataset:
**File:** samples/android/tutorial-4-opencl/jni/CMakeLists.txt
**Change Type:** modified
**Context:** PR #24473: Updated Android samples for modern Android studio. Added OpenCV from Maven support. - Updated samples for recent Android studio: - added na...
**Review Line:** 3

**Code Changes:**
```diff
@@ -1,9 +1,14 @@
 cmake_minimum_required(VERSION 3.6)
 
-set(target mixed_sample)
+set(target JNIpart)
 project(${target} CXX)
 
-set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
+if (OPENCV_FROM_SDK)
+  set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
```

Review comment:
It's not relevant.
**File:** samples/android/15-puzzle/build.gradle.in
**Change Type:** modified
**Context:** PR #24473: Updated Android samples for modern Android studio. Added OpenCV from Maven support. - Updated samples for recent Android studio: - added na...

**Code Changes:**
```diff
@@ -1,6 +1,7 @@
 apply plugin: 'com.android.application'
 
 android {
+    namespace 'org.opencv.samples.puzzle15'
     compileSdkVersion @ANDROID_COMPILE_SDK_VERSION@
     defaultConfig {
         applicationId "org.opencv.samples.puzzle15"
@@ -27,5 +28,9 @@ android {
 
```

Review comment:
I propose to drop the version here and in all other samples.
**File:** samples/android/face-detection/jni/CMakeLists.txt
**Change Type:** modified
**Context:** PR #24473: Updated Android samples for modern Android studio. Added OpenCV from Maven support. - Updated samples for recent Android studio: - added na...

**Code Changes:**
```diff
@@ -3,7 +3,12 @@ cmake_minimum_required(VERSION 3.6)
 set(target detection_based_tracker)
 project(${target} CXX)
 
-set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
+if (OPENCV_FROM_SDK)
+  set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
+else()
+  set(ANDROID_OPENCV_COMPONENTS "OpenCV::opencv_java${OPENCV_VERSION_MAJOR}" CACHE STRING "")
+endif()
```

Review comment:
`log-lib` is bad name. let's use `log_lib`
**File:** samples/android/15-puzzle/build.gradle.in
**Change Type:** modified
**Context:** PR #24473: Updated Android samples for modern Android studio. Added OpenCV from Maven support. - Updated samples for recent Android studio: - added na...

**Code Changes:**
```diff
@@ -1,6 +1,7 @@
 apply plugin: 'com.android.application'
 
 android {
+    namespace 'org.opencv.samples.puzzle15'
     compileSdkVersion @ANDROID_COMPILE_SDK_VERSION@
     defaultConfig {
         applicationId "org.opencv.samples.puzzle15"
@@ -27,5 +28,9 @@ android {
 
```

Review comment:
The version is required here
**File:** samples/android/tutorial-4-opencl/jni/CMakeLists.txt
**Change Type:** modified
**Context:** PR #24473: Updated Android samples for modern Android studio. Added OpenCV from Maven support. - Updated samples for recent Android studio: - added na...
**Review Line:** 3

**Code Changes:**
```diff
@@ -1,9 +1,14 @@
 cmake_minimum_required(VERSION 3.6)
 
-set(target mixed_sample)
+set(target JNIpart)
 project(${target} CXX)
 
-set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
+if (OPENCV_FROM_SDK)
+  set(ANDROID_OPENCV_COMPONENTS "opencv_java" CACHE STRING "")
```

Review comment:
target name should be the same as in build.gradle externalNativeBuild/targets
**File:** samples/android/camera-calibration/src/org/opencv/samples/cameracalibration/CameraCalibrationActivity.java
**Change Type:** modified
**Context:** PR #24473: Updated Android samples for modern Android studio. Added OpenCV from Maven support. - Updated samples for recent Android studio: - added na...
**Review Line:** 139

**Code Changes:**
```diff
 
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()) {
-        case R.id.calibration:
+        if (item.getItemId() == R.id.calibration) {
             mOnCameraFrameRender =
                 new OnCameraFrameRender(new CalibrationFrameRender(mCalibrator));
             item.setChecked(true);
             return true;
-        case R.id.undistortion:
```

Review comment:
Related to: https://stackoverflow.com/questions/26753328/switch-case-with-r-id-xxxx-in-android-doesnt-work
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24378: dnn onnx: add instance norm layer

**Code Changes:**
```diff
@@ -1844,44 +1844,43 @@ void ONNXImporter::parseLRN(LayerParams& layerParams, const opencv_onnx::NodePro
     addLayer(layerParams, node_proto);
 }
 
-void ONNXImporter::parseInstanceNormalization(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto_)
-{
-    opencv_onnx::NodeProto node_proto = node_proto_;
-    if (node_proto.input_size() != 3)
-        CV_Error(Error::StsNotImplemented,
-                 "Expected input, scale, bias");
```

Review comment:
How layer could determine which inputs actually passed? For example, `[input, bias]` or `[input, scale]`?
**File:** modules/dnn/src/onnx/onnx_importer.cpp
**Change Type:** modified
**Context:** PR #24378: dnn onnx: add instance norm layer

**Code Changes:**
```diff
@@ -1844,44 +1844,43 @@ void ONNXImporter::parseLRN(LayerParams& layerParams, const opencv_onnx::NodePro
     addLayer(layerParams, node_proto);
 }
 
-void ONNXImporter::parseInstanceNormalization(LayerParams& layerParams, const opencv_onnx::NodeProto& node_proto_)
-{
-    opencv_onnx::NodeProto node_proto = node_proto_;
-    if (node_proto.input_size() != 3)
-        CV_Error(Error::StsNotImplemented,
-                 "Expected input, scale, bias");
```

Review comment:
None of them is optional, see https://github.com/onnx/onnx/blob/main/docs/Operators.md#inputs-65
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
Breaks coverage with other backends that initialized in MVN layer (OpenVINO, CUDA).
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
I will try to add them back.
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer

**Code Changes:**
```diff
@@ -0,0 +1,231 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "../precomp.hpp"
+#include <opencv2/dnn/shape_utils.hpp>
+#include "./cpu_kernels/fast_norm.hpp"
+
+// OpenVINO backend
```

Review comment:
Please do not use reference here. Otherwise OpenVINO overrides nodes in case of assignment (there is no one in your code but just to prevent copy-paste errors).
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
OpenVINO and CUDA backend are added.
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
Can you handle OpenCL backend as well? https://github.com/opencv/opencv/blob/ea47cb3ffeedae2da53acbaff8a108cc39a1a4b9/modules/dnn/src/layers/mvn_layer.cpp#L208
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
I can give it a shot.
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
May I ask why returning false in `forward_ocl` in `mvn_layer.cpp` if the input umat type is int16? https://github.com/opencv/opencv/blob/fa56623458e4e582f16b216448e21bb9e664a9ec/modules/dnn/src/layers/mvn_layer.cpp#L229-L230 Initially I thought it was `CV_16F`, but it is `CV_16S` indeed. So the opencl backend supports int8 quantization as well? But the weirder thing is we don't support int16 quantization right?
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
`CV_16S` is an original data type for FP16 in OpenCV (before `CV_16F` which is used in dnn for FP16 inference on CPU). However every OpenCL kernel uses `CV_16S` which actually just a short int buffer for float16. See [convertFp16](https://docs.opencv.org/5.x/d2/de8/group__core__array.html#ga9c25d9ef44a2a48ecc3774b30cb80082)
**File:** modules/dnn/src/layers/instance_norm_layer.cpp
**Change Type:** added
**Context:** PR #24378: dnn onnx: add instance norm layer
**Review Line:** 44

**Code Changes:**
```diff
+        if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+            return true;
+#endif
+        return backendId == DNN_BACKEND_OPENCV ||
+               backendId == DNN_BACKEND_CUDA;
+    }
+
+    bool getMemoryShapes(const std::vector<MatShape> &inputs,
+                         const int requiredOutputs,
+                         std::vector<MatShape> &outputs,
+                         std::vector<MatShape> &internals) const CV_OVERRIDE {
```

Review comment:
Done with adding OpenCL backend (no fp16 though).
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
Why we need so? Please just add an argument like `--postprocessing` with values "yolo", "ssd" and others
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
We add and an argument ```--postprocessing```with 4 choice ```yolo```, ```ssd```, ```faster_rcnn```, ```yolov8```. Only 'yolov8' will use ```cv.dnn.readNetFromONNX```, Other use ```cv.dnn.readNet``` run ```python object_detection.py yolov8 --postprocessing yolov8``` first yolov8 is the content of models.yml, and the second yolov8 is the value of the parameter [--postprocessing]
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
Why we need a separate method `readNetFromONNX`? Can `readNet` cover onnx models?
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
Check for args.postprocessing
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
What is special about YOLOv8 that cannot be reused in other models?
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
```readNet``` can cover onnx models， but we still needs special handling for yolov8 as it doesn't require ```args.cofig``` and ```args.framework```, we will change code to ```net = cv.dnn.readNet(args.model)```
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
In YOLOv8, predict's input frame needs to change to size(640, 640), so if frame is not resized into a square, bounding box will be deformed and the complete object will not be captured.
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
`readNet` can handle empty string for config: ``` readNet("model.onnx", "", "onnx") ```
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
There are `args.width` and `args.height` for it which are used in `blobFromImage`. There is a problem in postprocessing - frame should remain in origin shapes but you need to remap from square coordinates to frame coordinates.
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
`findFile` already called before, so let's keep just this: ```python net = cv.dnn.readNet(args.model, args.config, args.framework) ```
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
```python args.config = findFile(args.config) if args.config is not None else "" ```
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
Not representative description. What about "Detection results post-processing depends on the model topology"
**File:** samples/dnn/object_detection.py
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -2,6 +2,7 @@
 import argparse
 import numpy as np
 import sys
+import copy
 import time
 from threading import Thread
 if sys.version_info[0] == 2:
@@ -27,7 +28,7 @@
                     help='For models from TensorFlow Object Detection API, you may '
```

Review comment:
Can NMS above be used? Feel free to change the condition to something like `if len(outNames) > 1 or (lastLayer.type == 'Region' or args.postprocessing == 'yolov8') and args.backend != cv.dnn.DNN_BACKEND_OPENCV:`
**File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -33,6 +33,7 @@ yolov4:
   height: 416
   rgb: true
   classes: "object_detection_classes_yolo.txt"
+  background_label_id: 0
   sample: "object_detection"
 
 yolov4-tiny:
@@ -47,6 +48,7 @@ yolov4-tiny:
   height: 416
```

Review comment:
BTW, how model was generated (onnx file)? Is there any officially supported supported sources?
**File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -33,6 +33,7 @@ yolov4:
   height: 416
   rgb: true
   classes: "object_detection_classes_yolo.txt"
+  background_label_id: 0
   sample: "object_detection"
 
 yolov4-tiny:
@@ -47,6 +48,7 @@ yolov4-tiny:
   height: 416
```

Review comment:
here's our classes: "https://github.com/JasonLin1110/ultralytics_yolov8_onnx_model/blob/main/object_detection_classes_yolov8.txt", should we update new url to models.yml?
**File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -33,6 +33,7 @@ yolov4:
   height: 416
   rgb: true
   classes: "object_detection_classes_yolo.txt"
+  background_label_id: 0
   sample: "object_detection"
 
 yolov4-tiny:
@@ -47,6 +48,7 @@ yolov4-tiny:
   height: 416
```

Review comment:
Here's the url: "https://github.com/JasonLin1110/ultralytics_yolov8_onnx_model/blob/main/yolov8net.onnx". We download yolov8n.pt by ```model = YOLO('yolov8n.pt')``` and use ```model.export('onnx')``` to get yolov8n.onnx, yolov8net.onnx just rename yolov8n.onnx. We didn't find onnx file in official, but use export('onnx') can change pt file to onnx
**File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -33,6 +33,7 @@ yolov4:
   height: 416
   rgb: true
   classes: "object_detection_classes_yolo.txt"
+  background_label_id: 0
   sample: "object_detection"
 
 yolov4-tiny:
@@ -47,6 +48,7 @@ yolov4-tiny:
   height: 416
```

Review comment:
This is identical to https://github.com/opencv/opencv/blob/4.x/samples/data/dnn/object_detection_classes_yolov4.txt so use `object_detection_classes_yolov4.txt`
**File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -33,6 +33,7 @@ yolov4:
   height: 416
   rgb: true
   classes: "object_detection_classes_yolo.txt"
+  background_label_id: 0
   sample: "object_detection"
 
 yolov4-tiny:
@@ -47,6 +48,7 @@ yolov4-tiny:
   height: 416
```

Review comment:
ONNX link is required here.
**File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -33,6 +33,7 @@ yolov4:
   height: 416
   rgb: true
   classes: "object_detection_classes_yolo.txt"
+  background_label_id: 0
   sample: "object_detection"
 
 yolov4-tiny:
@@ -47,6 +48,7 @@ yolov4-tiny:
   height: 416
```

Review comment:
It's better to rename `model: "yolov8net.onnx"` to `model: "yolov8n.pt"`. > config for download_models.py contains link to pt, but not onnx. The file is renamed to .onnx as it's defined in yaml config. I have not seen entry for YOLOv8 in download_models.py except https://github.com/CVHub520/X-AnyLabeling/releases/download/v0.1.0/yolov8n.onnx which is not an official repo. Can we keep a link to `.pt`?
**File:** samples/dnn/models.yml
**Change Type:** modified
**Context:** PR #24396: using cv2 dnn interface to run yolov8 model

**Code Changes:**
```diff
@@ -33,6 +33,7 @@ yolov4:
   height: 416
   rgb: true
   classes: "object_detection_classes_yolo.txt"
+  background_label_id: 0
   sample: "object_detection"
 
 yolov4-tiny:
@@ -47,6 +48,7 @@ yolov4-tiny:
   height: 416
```

Review comment:
Oh, excuse me. I just missed that there is another https://github.com/opencv/opencv/blob/4.x/samples/dnn/download_models.py