Files
opencv-MIRROR/modules/dnn/src
Ishita Singh 81cf43c1d8 dnn: handle min > max in Clip layer and enable ONNX conformance test (#30891)
* dnn: handle min > max in Clip layer and enable ONNX conformance test

Under the ONNX specification, the Clip operator is defined mathematically as
y = min(max(x, min), max). When min > max, the operation clamps identically
to max for all input values.

Previously, ClipLayerImpl asserted minValue <= maxValue in its constructor
and actualMin <= actualMax in forward, causing assertion failures on valid
ONNX models with min > max. Additionally, the adjacency graph fusion interpreter
checked a < min first, returning min instead of max.

This commit:
1. Removes the min <= max assertions in ClipLayerImpl constructor and forward,
   allowing ONNX-conforming evaluation where min > max clamps to max.
2. Updates FusionEltwiseOp::CLAMP in AdjacencyGraph interpreter to use
   std::min(std::max(a, n.scalar), n.scalar2), matching the ONNX evaluation order.
3. Removes test_clip_min_greater_than_max from the layer parser denylist.
4. Adds unit tests covering static and dynamic min > max clipping.

* dnn: filter test_clip_min_greater_than_max for OpenVINO backend

* dnn(test): address review comments on Clip min > max tests and fusion coverage
2026-11-20 08:22:26 +05:30
..
2026-02-20 22:05:35 +03:00
2022-10-07 16:57:31 +00:00
2022-10-07 16:57:31 +00:00
2022-01-18 01:22:22 +03:00
2022-03-19 06:54:07 +00:00
2022-10-07 16:57:31 +00:00
2026-07-29 20:19:40 +05:30
2025-06-10 10:16:50 +03:00
2021-03-10 15:59:26 +00:00
2026-03-19 11:29:57 +03:00
2026-01-06 22:57:02 +08:00
2022-03-08 19:22:46 +00:00
2024-03-18 15:05:50 +04:00
2024-07-17 10:08:16 +03:00