Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@CNOCycle
Copy link
Contributor

Pull Request Readiness Checklist

Merge with extra: opencv/opencv_extra#1180

This PR adds support for GlobalAveragePooling2D and GlobalMaxPool2D on the TFlite backend. When the keep_dims option is enabled, the output is a 2D tensor, necessitating the inclusion of an additional flatten layer. Additionally, the names of these layers have been updated to match the output tensor names generated by generate.py from the opencv_extra repository.

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@CNOCycle
Copy link
Contributor Author

@dkurt

Thank you for your comment. However, I'm not sure which case you're concerned about. Could you please provide your expected model architecture for me to verify the correctness.

@dkurt
Copy link
Member

dkurt commented May 31, 2024

@CNOCycle, never mind. I misunderstood the fact that Flatten goes after Pooling, not before.

I added minor changes to the code to make it look more unified with other layers. LGTM after tests pass.

@asmorkalov asmorkalov added this to the 4.10.0 milestone May 31, 2024
@asmorkalov asmorkalov merged commit 98b8825 into opencv:4.x May 31, 2024
@mshabunin mshabunin mentioned this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants