opencv/modules
Yuantao Feng accf200408
Merge pull request #25238 from fengyuentau:optimized_const
dnn: avoid const layer forwarding in layer norm layer and attention layer #25238

While profiling ViTs with dnn, I found `ConstLayer` can take a proportion of the inference time, which is weird. This comes from the data copy during the inference of `ConstLayer`. There is a chance that we can improve the efficiency of data copying but the easiest and most convenient way is to avoid `ConstLayer`. This PR change the way how we handle constants in layer normalization layer and attention layer, which is storing in the layer blobs instead of making constant layers for them.

Checklists:

- [x] Backend compatibility in layer normalization layer.

### 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
- [x] 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-03-26 15:09:51 +03:00
..
calib3d Merge pull request #25145 from MaximSmolskiy:improve-contours-approximations-in-ChessBoardDetector-generateQuads-2 2024-03-06 14:03:50 +03:00
core Merge pull request #25237 from YusukeKameda:4.x 2024-03-26 14:20:17 +03:00
dnn Merge pull request #25238 from fengyuentau:optimized_const 2024-03-26 15:09:51 +03:00
features2d Merge pull request #25042 from mshabunin:doc-upgrade 2024-03-05 16:19:45 +03:00
flann Merge pull request #25024 from vrabaud:neon 2024-02-20 11:29:23 +03:00
gapi core: Rename cv::float16_t to cv::hfloat (#25217) 2024-03-21 23:44:19 +03:00
highgui Backport some highgui changes from #22754 2024-03-05 17:49:01 +03:00
imgcodecs libtiff upgrade to version 4.6.0 (#25096) 2024-03-22 04:08:16 +03:00
imgproc Merge pull request #25042 from mshabunin:doc-upgrade 2024-03-05 16:19:45 +03:00
java doc: fix formulas in JavaDoc broken after Doxygen upgrade 2024-03-11 23:47:23 +03:00
js Merge pull request #25084 from EDVTAZ:emscripten-3.1.54-compat 2024-02-26 10:30:56 +03:00
ml Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
objc Merge pull request #24136 from komakai:visionos_support 2023-12-20 15:35:10 +03:00
objdetect Merge pull request #25042 from mshabunin:doc-upgrade 2024-03-05 16:19:45 +03:00
photo Merge pull request #25042 from mshabunin:doc-upgrade 2024-03-05 16:19:45 +03:00
python fix [use hasattr("cv2", "name") ,but first param is 'character string', 2024-02-23 22:02:43 +08:00
stitching Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
ts Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
video Merge pull request #25042 from mshabunin:doc-upgrade 2024-03-05 16:19:45 +03:00
videoio Added support for V4L2_PIX_FMT_SGRBG8 pixel format to V4L2 backend 2024-03-21 18:54:27 +00:00
world cmake: use /INCREMENTAL:NO with MSVS 2015 2023-12-07 19:46:27 +00:00