opencv/modules/dnn/test
alexlyulkov 9238eb2ab2
Merge pull request #25555 from alexlyulkov:al/int8-uint8-dnn-input
Disabled conversion to float of model's input #25555

In dnn 4.x usually any model's input is converted to float32 or float16 (except quantized models). Also mean and scale can be applied. In current dnn 5.x there is the same conversion except int32 and int64 types. I removed this conversion.

Here is how the pipeline works now:
- if input Mat type is float32, the pipeline applies mean and scale and may convert it to float16.
- if input Mat type is not float32, the pipeline preserves the input type and doesn't apply mean and scale

There was a conflict in protobuf parser between ONNX importer and tests. In ONNX importer any uint8 weight was handled as quantized weight and x = int8(x_uint8 - 128) conversion was used inside the protobuf parser. ONNX conformance tests used the same protobuf reader, so tests with uint8 inputs couldn't read the input values properly. I've made this conversion optional.

These ONNX conformance tests are enabled:
- test_add_uint8
- test_div_uint8
- test_mul_uint8
- test_sub_uint8
- test_max_int8
- test_max_uint8
- test_min_int8
- test_min_uint8
- test_mod_mixed_sign_int8
- test_mod_uint8

These tests were removed:
- Test_two_inputs.basic (when input is uint8)
- setInput.normalization (when input is uint8)

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2024-05-16 15:54:00 +03:00
..
imagenet_cls_test_alexnet.py python: better Python 3 support 2018-05-11 17:32:04 +03:00
imagenet_cls_test_googlenet.py Misc. modules/ typos 2018-02-12 07:09:43 -05:00
imagenet_cls_test_inception.py Merge branch 4.x 2021-12-30 21:43:45 +00:00
npy_blob.cpp Merge pull request #24411 from alexlyulkov:al/dnn-type-inference 2024-03-01 17:07:38 +03:00
npy_blob.hpp dnn: fix precomp.hpp usage 2018-02-28 17:06:26 +03:00
pascal_semsegm_test_fcn.py Merge branch 4.x 2023-01-09 11:08:02 +00:00
test_backends.cpp Merge pull request #25463 from WanliZhong:ocvface2YuNet 2024-05-08 15:49:10 +03:00
test_caffe_importer.cpp Merge pull request #24411 from alexlyulkov:al/dnn-type-inference 2024-03-01 17:07:38 +03:00
test_common.cpp Merge pull request #25487 from Abdurrahheem:ash/01D-additional-fixes 2024-05-15 10:50:03 +03:00
test_common.hpp Merge branch 4.x 2024-04-02 16:39:54 +03:00
test_common.impl.hpp Merge branch 4.x 2024-04-02 16:39:54 +03:00
test_darknet_importer.cpp dnn(test): skip very long debug tests, reduce test time 2023-12-25 08:44:06 +00:00
test_googlenet.cpp Merge pull request #22275 from zihaomu:fp16_support_conv 2023-05-17 09:38:33 +03:00
test_graph_simplifier.cpp Merge pull request #25271 from fengyuentau:matmul_bias 2024-03-29 17:35:23 +03:00
test_ie_models.cpp Fix for OpenVINO 2024.0 2024-03-18 15:05:50 +04:00
test_int8_layers.cpp Merge pull request #24980 from fengyuentau:on-fly-quantization-removal 2024-02-16 18:21:45 +03:00
test_int.cpp Merge pull request #25458 from alexlyulkov:al/dnn-openvino-int-support 2024-05-15 11:51:59 +03:00
test_layers_1d.cpp Merge pull request #25487 from Abdurrahheem:ash/01D-additional-fixes 2024-05-15 10:50:03 +03:00
test_layers.cpp Merge pull request #25555 from alexlyulkov:al/int8-uint8-dnn-input 2024-05-16 15:54:00 +03:00
test_main.cpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
test_misc.cpp Merge pull request #25555 from alexlyulkov:al/int8-uint8-dnn-input 2024-05-16 15:54:00 +03:00
test_model.cpp Merge branch 4.x 2024-01-19 17:32:22 +03:00
test_nms.cpp batched nms impl 2022-11-29 15:32:34 +08:00
test_onnx_conformance_layer_filter__cuda_denylist.inl.hpp Merge pull request #25465 from Abdurrahheem:ash/parser-conf-denylist-reduce 2024-04-22 16:31:15 +03:00
test_onnx_conformance_layer_filter__openvino.inl.hpp Merge pull request #25555 from alexlyulkov:al/int8-uint8-dnn-input 2024-05-16 15:54:00 +03:00
test_onnx_conformance_layer_filter__vulkan_denylist.inl.hpp Merge pull request #24092 from Aser-Abdelfatah:GSoC_Support_GatherElements_ONNX 2023-10-18 10:41:47 +03:00
test_onnx_conformance_layer_filter_opencv_all_denylist.inl.hpp Merge pull request #25555 from alexlyulkov:al/int8-uint8-dnn-input 2024-05-16 15:54:00 +03:00
test_onnx_conformance_layer_filter_opencv_cpu_denylist.inl.hpp Merge pull request #21865 from rogday:nary_eltwise_layers 2022-07-19 06:14:05 +03:00
test_onnx_conformance_layer_filter_opencv_denylist.inl.hpp move global skip out of if loop, and add opencv_deny_list 2023-03-13 22:16:51 +08:00
test_onnx_conformance_layer_filter_opencv_ocl_fp16_denylist.inl.hpp implementation of scatter and scatternd with conformance tests enabled 2022-10-17 11:30:32 +08:00
test_onnx_conformance_layer_filter_opencv_ocl_fp32_denylist.inl.hpp implementation of scatter and scatternd with conformance tests enabled 2022-10-17 11:30:32 +08:00
test_onnx_conformance_layer_parser_denylist.inl.hpp Merge pull request #25555 from alexlyulkov:al/int8-uint8-dnn-input 2024-05-16 15:54:00 +03:00
test_onnx_conformance.cpp Merge branch 4.x 2024-01-23 17:06:52 +03:00
test_onnx_importer.cpp Merge pull request #25458 from alexlyulkov:al/dnn-openvino-int-support 2024-05-15 11:51:59 +03:00
test_precomp.hpp dnn: reduce set of ignored warnings 2018-11-15 13:15:59 +03:00
test_tf_importer.cpp dnn(test): skip very long debug tests, reduce test time 2023-12-25 08:44:06 +00:00
test_tflite_importer.cpp Merge pull request #25458 from alexlyulkov:al/dnn-openvino-int-support 2024-05-15 11:51:59 +03:00