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

fix(traffic_light_classifier): fix zero size roi bug #7608

Conversation

technolojin
Copy link
Contributor

@technolojin technolojin commented Jun 20, 2024

Description

Even the previous fix #7461, similar issue has occurred.

[component_container_mt-61]   what():  OpenCV(4.5.4) ./modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
[component_container_mt-61]   what():  OpenCV(4.5.4) ./modules/imgproc/src/resize.cpp:4051: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
[component_container_mt-61] 
[component_container_mt-61] 
[component_container_mt-61] *** Aborted at 1718866324 (unix time) try "date -d @1718866324" if you are using GNU date ***
[component_container_mt-61] terminate called recursively
[component_container_mt-61] terminate called recursively
[component_container_mt-61] terminate called recursively
[component_container_mt-61] terminate called recursively
[component_container_mt-61] PC: @                0x0 (unknown)
[component_container_mt-61] *** SIGABRT (@0x3e800053712) received by PID 341778 (TID 0x7f89bbce9640) from PID 341778; stack trace: ***
[component_container_mt-61]     @     0x7f89c235d4d6 google::(anonymous namespace)::FailureSignalHandler()
[component_container_mt-61]     @     0x7f89c1c08520 (unknown)
[component_container_mt-61]     @     0x7f89c1c5c9fc pthread_kill
[component_container_mt-61]     @     0x7f89c1c08476 raise
[component_container_mt-61]     @     0x7f89c1bee7f3 abort
[component_container_mt-61]     @     0x7f89c1eb1b9e (unknown)
[component_container_mt-61]     @     0x7f89c1ebd20c (unknown)
[component_container_mt-61]     @     0x7f89c1ebc1e9 (unknown)
[component_container_mt-61]     @     0x7f89c1ebc959 __gxx_personality_v0
[component_container_mt-61]     @     0x7f89c1e05884 (unknown)
[component_container_mt-61]     @     0x7f89c1e062dd _Unwind_Resume
[component_container_mt-61]     @     0x7f89b1ec54de (unknown)
[component_container_mt-61]     @     0x7f88d72f0f02 _ZN19tensorrt_classifier13TrtClassifier14preprocess_optERKSt6vectorIN2cv3MatESaIS3_EE._omp_fn.0
[component_container_mt-61]     @     0x7f88d4deea16 GOMP_parallel
[component_container_mt-61]     @     0x7f88d72f2437 tensorrt_classifier::TrtClassifier::preprocess_opt()
[component_container_mt-61]     @     0x7f88d72f28e3 tensorrt_classifier::TrtClassifier::doInference()
[component_container_mt-61]     @     0x7f88d7556c13 traffic_light::CNNClassifier::getTrafficSignals()
[component_container_mt-61]     @     0x7f88d755d991 traffic_light::TrafficLightClassifierNodelet::imageRoiCallback()
[component_container_mt-61]     @     0x7f88d758c367 message_filters::CallbackHelper9T<>::call()
[component_container_mt-61]     @     0x7f88d759a5cc message_filters::sync_policies::ExactTime<>::checkTuple()
[component_container_mt-61]     @     0x7f88d75a7435 message_filters::Synchronizer<>::cb<>()
[component_container_mt-61]     @     0x7f88d7596097 _ZNSt17_Function_handlerIFvSt10shared_ptrIKN21tier4_perception_msgs3msg21TrafficLightRoiArray_ISaIvEEEEEZN15message_filters10SubscriberIS5_N6rclcpp4NodeEE9subscribeEPSC_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE17rmw_qos_profile_sNSB_32SubscriptionOptionsWithAllocatorIS4_EEEUlS7_E_E9_M_invokeERKSt9_Any_dataOS7_
[component_container_mt-61]     @     0x7f88d7571ba2 _ZNSt8__detail9__variant17__gen_vtable_implINS0_12_Multi_arrayIPFNS0_21__deduce_visit_resultIvEEOZN6rclcpp23AnySubscriptionCallbackIN21tier4_perception_msgs3msg21TrafficLightRoiArray_ISaIvEEESA_E8dispatchESt10shared_ptrISB_ERKNS5_11MessageInfoEEUlOT_E_RSt7variantIJSt8functionIFvRKSB_EESN_IFvSP_SH_EESN_IFvRKNS5_17SerializedMessageEEESN_IFvSW_SH_EESN_IFvSt10unique_ptrISB_St14default_deleteISB_EEEESN_IFvS14_SH_EESN_IFvS11_ISU_S12_ISU_EEEESN_IFvS1A_SH_EESN_IFvSD_ISO_EEESN_IFvS1F_SH_EESN_IFvSD_ISV_EEESN_IFvS1K_SH_EESN_IFvRKS1F_EESN_IFvS1Q_SH_EESN_IFvRKS1K_EESN_IFvS1W_SH_EESN_IFvSE_EESN_IFvSE_SH_EESN_IFvSD_ISU_EEESN_IFvS25_SH_EEEEEJEEESt16integer_sequenceImJLm8EEEE14__visit_invokeESL_S2B_
[component_container_mt-61]     @     0x7f88d758759f rclcpp::Subscription<>::handle_message()
[component_container_mt-61]     @     0x7f89c21d9ba0 rclcpp::Executor::execute_subscription()
[component_container_mt-61]     @     0x7f89c21db10e rclcpp::Executor::execute_any_executable()
[component_container_mt-61]     @     0x7f89c21e1432 rclcpp::executors::MultiThreadedExecutor::run()

Overall process were reviewed with consideration of zero-size roi and empty roi input.

Tests performed

Tested on a local recompute environment and TIER IV INTERNAL cloud test

Data:TIER IV INTERNAL

Effects on system behavior

Not applicable.

Interface changes

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jun 20, 2024
@technolojin technolojin marked this pull request as ready for review June 20, 2024 09:54
@technolojin technolojin removed their assignment Jul 2, 2024
@technolojin
Copy link
Contributor Author

@tzhong518 Can I request your review?

@technolojin technolojin marked this pull request as draft July 23, 2024 05:45
@technolojin technolojin force-pushed the fix/traffic-light-classifier-zero-size-image-bug branch from 55884b4 to b04ea9a Compare July 26, 2024 02:25
Copy link

github-actions bot commented Jul 26, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@technolojin technolojin force-pushed the fix/traffic-light-classifier-zero-size-image-bug branch from b04ea9a to 82e26cd Compare August 5, 2024 06:25
@technolojin technolojin added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Aug 5, 2024
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes missing coverage. Please review.

Project coverage is 29.29%. Comparing base (2705a63) to head (464d1f8).
Report is 15 commits behind head on main.

Files Patch % Lines
...t_classifier/src/traffic_light_classifier_node.cpp 0.00% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7608      +/-   ##
==========================================
- Coverage   29.29%   29.29%   -0.01%     
==========================================
  Files        1609     1609              
  Lines      119415   119421       +6     
  Branches    51481    51498      +17     
==========================================
- Hits        34988    34987       -1     
- Misses      75118    75219     +101     
+ Partials     9309     9215      -94     
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 29.30% <ø> (+<0.01%) ⬆️ Carriedforward from aec7e97

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…light indices

The code changes in `traffic_light_classifier_node.cpp` modify the way images and backlight indices are added to the respective vectors. Instead of using `push_back`, the code now uses `emplace_back`. This change improves performance and ensures proper object construction.

Signed-off-by: Taekjin LEE <[email protected]>
@technolojin technolojin force-pushed the fix/traffic-light-classifier-zero-size-image-bug branch from 82e26cd to 021ede7 Compare August 6, 2024 06:37
@technolojin technolojin marked this pull request as ready for review August 7, 2024 00:10
@technolojin
Copy link
Contributor Author

Test result
https://evaluation.tier4.jp/evaluation/reports/d552c065-01ef-5cf7-920e-8937fca66bf2?project_id=prd_jt
39/46 (failed cases are caused by test dataset)

Copy link
Contributor

@yukkysaito yukkysaito left a comment

Choose a reason for hiding this comment

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

LGTM

@technolojin technolojin enabled auto-merge (squash) August 7, 2024 01:31
@technolojin technolojin merged commit a60cf68 into autowarefoundation:main Aug 7, 2024
29 of 30 checks passed
@technolojin technolojin deleted the fix/traffic-light-classifier-zero-size-image-bug branch August 7, 2024 02:38
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Aug 7, 2024
…ion#7608)

* fix: continue to process when input roi size is zero

Signed-off-by: Taekjin LEE <[email protected]>

* fix: consider when roi size is zero, rois is empty

fix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: use emplace_back instead of push_back for adding images and backlight indices

The code changes in `traffic_light_classifier_node.cpp` modify the way images and backlight indices are added to the respective vectors. Instead of using `push_back`, the code now uses `emplace_back`. This change improves performance and ensures proper object construction.

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: bring back for loop skim and output_msg filling

Signed-off-by: Taekjin LEE <[email protected]>

* chore: refactor code to handle empty input ROIs in traffic_light_classifier_node.cpp

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: using index instead of vector length

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Aug 7, 2024
…ion#7608)

* fix: continue to process when input roi size is zero

Signed-off-by: Taekjin LEE <[email protected]>

* fix: consider when roi size is zero, rois is empty

fix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: use emplace_back instead of push_back for adding images and backlight indices

The code changes in `traffic_light_classifier_node.cpp` modify the way images and backlight indices are added to the respective vectors. Instead of using `push_back`, the code now uses `emplace_back`. This change improves performance and ensures proper object construction.

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: bring back for loop skim and output_msg filling

Signed-off-by: Taekjin LEE <[email protected]>

* chore: refactor code to handle empty input ROIs in traffic_light_classifier_node.cpp

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: using index instead of vector length

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
esteve pushed a commit to esteve/autoware.universe that referenced this pull request Aug 13, 2024
…ion#7608)

* fix: continue to process when input roi size is zero

Signed-off-by: Taekjin LEE <[email protected]>

* fix: consider when roi size is zero, rois is empty

fix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: use emplace_back instead of push_back for adding images and backlight indices

The code changes in `traffic_light_classifier_node.cpp` modify the way images and backlight indices are added to the respective vectors. Instead of using `push_back`, the code now uses `emplace_back`. This change improves performance and ensures proper object construction.

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: bring back for loop skim and output_msg filling

Signed-off-by: Taekjin LEE <[email protected]>

* chore: refactor code to handle empty input ROIs in traffic_light_classifier_node.cpp

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: using index instead of vector length

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
xtk8532704 pushed a commit to tier4/autoware.universe that referenced this pull request Aug 15, 2024
…ion#7608)

* fix: continue to process when input roi size is zero

Signed-off-by: Taekjin LEE <[email protected]>

* fix: consider when roi size is zero, rois is empty

fix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: use emplace_back instead of push_back for adding images and backlight indices

The code changes in `traffic_light_classifier_node.cpp` modify the way images and backlight indices are added to the respective vectors. Instead of using `push_back`, the code now uses `emplace_back`. This change improves performance and ensures proper object construction.

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: bring back for loop skim and output_msg filling

Signed-off-by: Taekjin LEE <[email protected]>

* chore: refactor code to handle empty input ROIs in traffic_light_classifier_node.cpp

Signed-off-by: Taekjin LEE <[email protected]>

* refactor: using index instead of vector length

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
Signed-off-by: xtk8532704 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants