Repository: opencv
Issue: Disable Tests for Unsupported ONNX Models in Caffe removal 
Labels: category: dnn,category: dnn (onnx),cleanup,OpenCV5

This issue is used to identify which onnx models can't be inferenced or need to be converted manually for [Caffe removal](https://github.com/opencv/opencv/pull/25323). The related tests will be disabled temporarily until the following models can be supported.

### SSD (opset 10, 12)
- [ ] resolved
- Source: https://github.com/onnx/models/tree/main/validated/vision/object_detection_segmentation/ssd/model
- Failure:
  **opset-10**
  ```shell
  [ INFO:0@0.530] global onnx_importer.cpp:3297 parseCustomLayer DNN/ONNX: unknown node type, try using custom handler for node with 5 inputs and 1 outputs: [NonMaxSuppression]:(onnx_node!NonMaxSuppression_683)
  [ INFO:0@0.530] global onnx_importer.cpp:1036 handleNode     Input[0] = 'Concat_659'
  [ INFO:0@0.530] global onnx_importer.cpp:1036 handleNode     Input[1] = 'Slice_676'
  [ INFO:0@0.530] global onnx_importer.cpp:1036 handleNode     Input[2] = 'ConstantOfShape_678'
  [ INFO:0@0.530] global onnx_importer.cpp:1036 handleNode     Input[3] = 'ConstantOfShape_680'
  [ INFO:0@0.530] global onnx_importer.cpp:1036 handleNode     Input[4] = 'ConstantOfShape_682'
  [ INFO:0@0.530] global onnx_importer.cpp:1040 handleNode     Output[0] = 'NonMaxSuppression_683'
  OpenCV(5.0.0-pre) Error: Unspecified error (Can't create layer "onnx_node!NonMaxSuppression_683" of type "NonMaxSuppression") in getLayerInstance, file /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/net_impl.hpp, line 106
  [ERROR:0@0.530] global onnx_importer.cpp:1032 handleNode DNN/ONNX: ERROR during processing node with 5 inputs and 1 outputs: [NonMaxSuppression]:(onnx_node!NonMaxSuppression_683) from domain='ai.onnx'
  OpenCV(5.0.0-pre) Error: Unspecified error (> Node [NonMaxSuppression@ai.onnx]:(onnx_node!NonMaxSuppression_683) parse error: OpenCV(5.0.0-pre) /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/net_impl.hpp:106: error: (-2:Unspecified error) Can't create layer "onnx_node!NonMaxSuppression_683" of type "NonMaxSuppression" in function 'getLayerInstance'
  > ) in handleNode, file /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/onnx/onnx_importer.cpp, line 1051
  ```
- **opset-12**
  ```shell
  OpenCV(5.0.0-pre) Error: Unspecified error (Can't create layer "onnx_node!NonMaxSuppression_683" of type "NonMaxSuppression") in getLayerInstance, file /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/net_impl.hpp, line 106
  [ERROR:0@0.233] global onnx_importer.cpp:1032 handleNode DNN/ONNX: ERROR during processing node with 5 inputs and 1 outputs: [NonMaxSuppression]:(onnx_node!NonMaxSuppression_683) from domain='ai.onnx'
  [ INFO:0@0.233] global onnx_importer.cpp:1036 handleNode     Input[0] = 'Concat_659'
  OpenCV(5.0.0-pre) Error: Unspecified error (> Node [NonMaxSuppression@ai.onnx]:(onnx_node!NonMaxSuppression_683) parse error: OpenCV(5.0.0-pre) /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/net_impl.hpp:106: error: (-2:Unspecified error) Can't create layer "onnx_node!NonMaxSuppression_683" of type "NonMaxSuppression" in function 'getLayerInstance'
  [ INFO:0@0.233] global onnx_importer.cpp:1036 handleNode     Input[1] = 'Slice_676'
  > ) in handleNode, file /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/onnx/onnx_importer.cpp, line 1051
  [ INFO:0@0.233] global onnx_importer.cpp:1036 handleNode     Input[2] = 'ConstantOfShape_678'
  [ INFO:0@0.233] global onnx_importer.cpp:1036 handleNode     Input[3] = 'ConstantOfShape_680'
  [ INFO:0@0.233] global onnx_importer.cpp:1036 handleNode     Input[4] = 'ConstantOfShape_682'
  [ INFO:0@0.233] global onnx_importer.cpp:1040 handleNode     Output[0] = 'NonMaxSuppression_683'
  ```

- Test:  `perf_net.cpp -> DNNTestNetwork, SSD`

### MobileNet_SSD (opset 10, 12)
- [ ] resolved
- Source: https://github.com/onnx/models/tree/main/validated/vision/object_detection_segmentation/ssd-mobilenetv1/model

- Failure:

  **opset-10**

  ```shell
  [ INFO:0@0.126] global onnx_importer.cpp:803 populateNet DNN/ONNX: loading ONNX v5 model produced by 'tf2onnx':1.7.0. Number of nodes = 350, initializers = 340, inputs = 1, outputs = 4
  [ INFO:0@0.126] global onnx_importer.cpp:696 parseOperatorSet DNN/ONNX: ONNX opset version = 10
  OpenCV(5.0.0-pre) Error: Unsupported format or combination of formats (Unsupported data type: BOOL) in getMatFromTensor, file /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/onnx/onnx_graph_simplifier.cpp, line 1754
  /Users/wanli/Desktop/OpenCV_China/opencv/modules/ts/src/ts_perf.cpp:1974: Failure
  ```

  **opset-12**

  ```shell
  [ INFO:0@0.159] global onnx_importer.cpp:803 populateNet DNN/ONNX: loading ONNX v7 model produced by 'tf2onnx':1.9.1. Number of nodes = 361, initializers = 346, inputs = 1, outputs = 4
  [ INFO:0@0.159] global onnx_importer.cpp:696 parseOperatorSet DNN/ONNX: ONNX opset version = 12
  [ INFO:0@0.268] global onnx_importer.cpp:974 handleNode DNN/ONNX: processing node with 1 inputs and 1 outputs: [Cast]:(onnx_node!ToFloat) from domain='ai.onnx'
  [ INFO:0@0.269] global onnx_importer.cpp:974 handleNode DNN/ONNX: processing node with 1 inputs and 1 outputs: [Shape]:(onnx_node!Preprocessor/map/Shape) from domain='ai.onnx'
  [ INFO:0@0.270] global onnx_importer.cpp:1036 handleNode     Input[0] = 'ToFloat:0'
  [ INFO:0@0.270] global onnx_importer.cpp:1040 handleNode     Output[0] = 'Preprocessor/map/Shape:0'
  [ERROR:0@0.269] global onnx_importer.cpp:2426 parseShape DNN/ONNX(Shape): dynamic 'zero' shapes are not supported, input ToFloat:0 [ 0 0 0 3 ]
  OpenCV(5.0.0-pre) Error: Assertion failed (!isDynamicShape) in parseShape, file /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/onnx/onnx_importer.cpp, line 2427
  [ERROR:0@0.270] global onnx_importer.cpp:1032 handleNode DNN/ONNX: ERROR during processing node with 1 inputs and 1 outputs: [Shape]:(onnx_node!Preprocessor/map/Shape) from domain='ai.onnx'
  OpenCV(5.0.0-pre) Error: Unspecified error (> Node [Shape@ai.onnx]:(onnx_node!Preprocessor/map/Shape) parse error: OpenCV(5.0.0-pre) /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/onnx/onnx_importer.cpp:2427: error: (-215:Assertion failed) !isDynamicShape in function 'parseShape'
  > ) in handleNode, file /Users/wanli/Desktop/OpenCV_China/opencv/modules/dnn/src/onnx/onnx_importer.cpp, line 1051
  ```

- Test: `perf_net.cpp -> DNNTestNetwork, MobileNet_SSD_v1_ONNX`

### ~~OpenCV Face Detector~~
- [x] resolved
- Use [YuNet](https://github.com/opencv/opencv_zoo/blob/main/models/face_detection_yunet) instead.
- related PR: 
    - https://github.com/opencv/opencv/pull/25430
    - https://github.com/opencv/opencv/pull/25463
    - https://github.com/opencv/opencv/pull/25468

### ~~GOTURN~~
- [x] resolved
- The GOTURN model will take 388 MB of traffic for each download if converted to onnx. If the user wants to use the tracking method, we can recommend they use Vit or dasimRPN, which have better performance.
- use [VIT Tracker](https://github.com/opencv/opencv_zoo/blob/main/models/object_tracking_vittrack) instead
- related PR:
    - https://github.com/opencv/opencv/pull/25503

### OpenPose (mpi, coco)
- [ ] resolved
- Source: **Not Found**

- Test: `perf_net.cpp -> DNNTestNetwork, OpenPose_pose_mpi_faster_4_stages`
- Related PR: https://github.com/opencv/opencv/pull/25593

### fcn8s-heavy-pascal
- [x] resolved
- use [fcn-resnet50-12.onnx](https://github.com/onnx/models/raw/491ce05590abb7551d7fae43c067c060eeb575a6/validated/vision/object_detection_segmentation/fcn/model/fcn-resnet50-12.onnx) replace

- need to modify postprocess of the `SegmentationModel` class

- Test: `test_model.cpp -> Test_Model, Segmentation`
- Related PR: https://github.com/opencv/opencv/pull/25435

### faster_rcnn (zf, vgg16)
- [x] ignored
- use [FasterRCNN-12.onnx](https://github.com/onnx/models/raw/491ce05590abb7551d7fae43c067c060eeb575a6/validated/vision/object_detection_segmentation/faster-rcnn/model/FasterRCNN-12.onnx) replace
- May be removed the tests in `test_int8_layer.cpp`

### R-FCN
- [ ] resolved
- Source: Not Found
- Test: `test_model.cpp -> Test_Model, DetectionOutput`
- Propose using TensorFlow model. Model link: http://download.tensorflow.org/models/object_detection/rfcn_resnet101_coco_2018_01_28.tar.gz
- Failure
    1. The input name of some layers will be `^name`, then cause error in line 267 in `graph_simplifier.cpp`
    2. `Assert` layer doesn't support. Because Mat doesn't support String data type.    
    ![Screenshot 2024-04-24 at 13 59 04](https://github.com/opencv/opencv/assets/49567307/46cad10e-053d-49f8-b61a-0dcc4263b35f)

### Classic models
- [ ] resolved
- `alexnet`, `densenet`, `googlenet`, `squeezenet`, `resnet-50` 
- all can be found and infered from onnx model zoo
- Related PR: https://github.com/opencv/opencv/pull/25548

### layer_convolution and other many single layer tests
- [ ] resolved
- need to be converted manually
- Test: `test_layer.cpp -> Layer_Test_Convolution_DLDT, Accuracy`......
- Related PR: https://github.com/opencv/opencv/pull/25581


### hed_pretrained_bsds
- [ ] resolved
- https://github.com/s9xie/hed
- `sample/dnn/edge_detection.py`
- Solutions:
  1. Can be converted to onnx with fp16 (not the best choice, model about 56MB).
  4. I propose to replace with [dexined](https://github.com/xavysp/DexiNed) which is the top accuracy in https://paperswithcode.com/sota/edge-detection-on-mdbd , since hed model was released about 10 years ago.
      - Model can be from https://github.com/axinc-ai/ailia-models/tree/master/line_segment_detection/dexined which is MIT License
      - Model link: https://storage.googleapis.com/ailia-models/dexined/model.onnx
- Related PR: https://github.com/opencv/opencv/pull/25515

### digit_lenet
- [ ] resolved
- Can be replaced with https://github.com/ONNC/onnc-tutorial/blob/master/models/lenet/lenet.onnx
- `samples/dnn/digitals_lenet.cpp`

### Colorization
- [x] resolved
- https://github.com/richzhang/colorization
- use model from [axinc-ai/ailia-models](https://github.com/axinc-ai/ailia-models/tree/master/image_manipulation/colorization)?
- Source: https://storage.googleapis.com/ailia-models/colorization/colorizer.onnx
- `samples/dnn/colorization.py`
- Related PR: https://github.com/opencv/opencv/pull/25433

### FlowNet
- [ ] resolved
- replace with [RAFT in OpenCV Zoo](https://github.com/opencv/opencv_zoo/tree/main/models/optical_flow_estimation_raft)
- `samples/dnn/optical_flow.py`

### wechat QR code
- [ ] resolved
- will be updated by WeChat qBar team

### wechat super resolution 
- [ ] resolved
- will be removed or updated by WeChat qBar team

### TextBox & dictnet_vgg
- [ ] resolved
- remove / convert to onnx / use other model?
- `opencv_contrib/modules/text`

### ~~3D triplet~~
- [x] Ignored
- ~~convert to onnx / use other model?~~
- seems this module don't use OpenCV Caffe importer. Only use official Caffe libary.
- `opencv_contrib/modules/cnn_3dobj`