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

Nanodet jit and c fixes #490

Merged
merged 34 commits into from
Nov 30, 2023
Merged

Nanodet jit and c fixes #490

merged 34 commits into from
Nov 30, 2023

Conversation

ManosMpampis
Copy link
Collaborator

@ManosMpampis ManosMpampis commented Nov 23, 2023

This PR aims to translate some changes of #488 into C API and simplify some optimizations for smaller memory footprint during inference and optimizations.
Adds dynamic shape capabilities into JIT optimizations for Python and C APIs.
Fix some buggs with C APIs during model export and when the output had zero bounding boxes.

ManosMpampis and others added 16 commits November 15, 2023 17:33
fix optimization procedure and add dynamic and channel last implementations for faster inference
fix optimization procedure and add dynamic and channel last implementations for faster inference
fix nanodet_RepVGG_A0_416.yml and nanodet_g.yml,
simplify vgg backbone
transfer tensorRT dependencies into gpu installation
small fixes into prints - docks
check all backbone, fpns, heads, modules for jit cripting compatible implementations.
update docks.
add export compatible with C api.
fix C api, outputs and preprocessing.
add new demo for c export - update docks.
@ManosMpampis ManosMpampis added test sources Run style checks test tools Test the toolkit methods labels Nov 23, 2023
@ManosMpampis ManosMpampis marked this pull request as ready for review November 23, 2023 15:38
ManosMpampis and others added 2 commits November 24, 2023 12:39
Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
@tsampazk tsampazk self-requested a review November 24, 2023 11:18
Copy link
Collaborator

@tsampazk tsampazk left a comment

Choose a reason for hiding this comment

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

Thank you @ManosMpampis, just a couple of minor comments.

Co-authored-by: Kostas Tsampazis <27914645+tsampazk@users.noreply.github.com>
@tsampazk
Copy link
Collaborator

I suggest not merging this until #488 is reviewed and ready to be merged as well, as i think it would complicate #488's review. @omichel @ManosMpampis @passalis.

@ManosMpampis
Copy link
Collaborator Author

Thank you for your comments @tsampazk and @omichel. @tsampazk Yes, I think it is better to review #488 and then merge that PR, so that if something needs to be changed in #488 it doesn't clutter this PR as well.

ManosMpampis and others added 5 commits November 28, 2023 14:42
Co-authored-by: Kostas Tsampazis <27914645+tsampazk@users.noreply.github.com>
update model heads to have unified initializations and update config_file_detail.md .
delete unused parameter of yml files.
Base automatically changed from Real-Time-OD-In-AGRICULTURAL to develop November 29, 2023 09:14
ManosMpampis added 2 commits November 29, 2023 13:30
…nodet-jit-and-c-fixes

# Conflicts:
#	docs/reference/object-detection-2d-nanodet.md
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/data/transform/warp.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/inferencer/utilities.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/model/arch/one_stage_detector.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/model/backbone/custom_csp.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/model/backbone/efficientnet_lite.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/model/fpn/ghost_pan.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/model/head/gfl_head.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/model/head/nanodet_plus_head.py
#	src/opendr/perception/object_detection_2d/nanodet/algorithm/nanodet/model/module/conv.py
#	src/opendr/perception/object_detection_2d/nanodet/nanodet_learner.py
Copy link
Collaborator

@tsampazk tsampazk left a comment

Choose a reason for hiding this comment

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

Latest changes look good to me, thank you.

Copy link
Collaborator

@passalis passalis left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Collaborator

@omichel omichel left a comment

Choose a reason for hiding this comment

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

Thank you.

@passalis passalis merged commit 96d2492 into develop Nov 30, 2023
48 checks passed
@passalis passalis deleted the nanodet-jit-and-c-fixes branch November 30, 2023 06:50
lucamarchionni pushed a commit to lucamarchionni/opendr that referenced this pull request Jun 10, 2024
* add new augmentation strategies

* add VGG backbone

* easier code readability to add custom losses

* better code readability

* better code readability and small bug fixes

* better and more stable training implementation and logging

* add cache in dataset

* add faster post processing in nanodet_plus_head.py and add new nanodet_plus_fast model

* add TensorRT optimizations and fix embedded device inference,
fix optimization procedure and add dynamic and channel last implementations for faster inference

* add TensorRT optimizations and fix embedded device inference,
fix optimization procedure and add dynamic and channel last implementations for faster inference

* update docks and add warning ignores in test_nanodet

* delete unused code,
fix nanodet_RepVGG_A0_416.yml and nanodet_g.yml,
simplify vgg backbone
transfer tensorRT dependencies into gpu installation
small fixes into prints - docks

* optimize some memory usage during optimizations.
check all backbone, fpns, heads, modules for jit cripting compatible implementations.
update docks.
add export compatible with C api.
fix C api, outputs and preprocessing.
add new demo for c export - update docks.

* styletest fix

* fix a bug that still uses gpu nodes even self.device was set to "cpu"

* update c test

* Apply suggestions from code review

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Apply suggestions from code review

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>

* Apply suggestions from code review

Co-authored-by: Kostas Tsampazis <27914645+tsampazk@users.noreply.github.com>

* update optimize_c_model dock as noted in PR suggestions

* update tool dock as noted in PR suggestions

* Apply suggestions from code review

Co-authored-by: Kostas Tsampazis <27914645+tsampazk@users.noreply.github.com>

* update dynamic input explanation accross optimization and inference.
update model heads to have unified initializations and update config_file_detail.md .
delete unused parameter of yml files.

* fix TensorRT loading message and docs as suggested

* update dock about dynamic input

* delete unused code

---------

Co-authored-by: ManosMpampis <gmp.manos@gmail.com>
Co-authored-by: Nikolaos Passalis <passalis@users.noreply.github.com>
Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.com>
Co-authored-by: Kostas Tsampazis <27914645+tsampazk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test sources Run style checks test tools Test the toolkit methods
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants