Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] RT-DETR hybrid encoder #581

Merged
merged 14 commits into from
Nov 26, 2024

Conversation

hglee98
Copy link
Contributor

@hglee98 hglee98 commented Nov 5, 2024

Description

This PR aims to refactor replaceable blocks within RT-DETR hybrid encoder (e.g., ConvNormLayer, RepVGG).

Closes: #529

We recommend to link at least one existing issue for PR. Before your create a PR, please check if there is an issue for this change.

Change(s)

  • Move CSPRepLayer to op.custom
  • Replace ConvNormLayer to ConvLayer in op.custom
  • Replace RepVGG with custom operation layers.

Code Formatting

If you PR to either master or dev branch, you should follow the code linting process. Please check your code with lint_check.sh in ./scripts directory.
For more information, please read the contribution guide in CONTRIBUTING.md.

Changelog

If your PR is granted to dev branch, codeowner will add a brief summary of the change to the Upcoming Release section of the CHANGELOG.md file including a link to the PR (formatted in markdown) and a link to your github profile.

For example,

- Added a new feature by `@myusername` in [PR 2023](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/2023)

Please enable Allow edits and access to secrets by maintainers so that our maintainers can update the CHANGELOG.md.

@hglee98 hglee98 requested a review from illian01 as a code owner November 5, 2024 05:04
@illian01 illian01 added the refactoring Changes code or architecture internally without changing the output. label Nov 12, 2024
Comment on lines 174 to 177
class RepConv(nn.Module):
"""
A convolutional block that combines two convolution layers (kernel and point-wise conv).
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think renaming RepVggBlock -> RepConv is not proper to this class.
Actually, RepVGG block is came from https://arxiv.org/abs/2101.03697, this block is named by author.
Also, RepVggBlock should have residual connection option according to the original paper.

And, please add original codebase reference so that we can keep an eye on code license issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestions! I've include your feedback via additional commits👍

@hglee98 hglee98 requested a review from illian01 November 15, 2024 01:57
Copy link
Collaborator

@illian01 illian01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@illian01 illian01 merged commit 0139840 into Nota-NetsPresso:dev Nov 26, 2024
2 checks passed
@hglee98 hglee98 deleted the 529-refactor-repblock branch December 6, 2024 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Changes code or architecture internally without changing the output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sprint] Refactor RT-DETR blocks & enable fused and reparameterzed block when deploying the model
2 participants