-
Notifications
You must be signed in to change notification settings - Fork 1.4k
return empty list, if input is empty #188
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #188 +/- ##
==========================================
+ Coverage 82.82% 83.04% +0.22%
==========================================
Files 102 103 +1
Lines 5909 6046 +137
Branches 958 979 +21
==========================================
+ Hits 4894 5021 +127
+ Misses 836 834 -2
- Partials 179 191 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Just for safety & code readability. |
@@ -52,6 +52,8 @@ def _xyxy2xywh(bbox_xyxy): | |||
np.ndarray: Bounding boxes (with scores), | |||
shaped (n, 4) or (n, 5). (left, top, width, height, [score]) | 8000|||
""" | |||
if len(bbox_xyxy) == 0: | |||
return [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the docstring says the return type is np.ndarray
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will change the returned type from np array to list, so it is not ideal.
if the purpose of the change is to speed up things, then you can skip the two lines after copy:
if len(bbox_xyxy) > 0:
bbox_xywh[:, 2] = bbox_xywh[:, 2] - bbox_xywh[:, 0] + 1
bbox_xywh[:, 3] = bbox_xywh[:, 3] - bbox_xywh[:, 1] + 1
…mlab#188) * [Enhancement] Add PolyParamScheduler, PolyMomentum and PolyLR * min_lr -> eta_min, refined docstr
* [Docs] Refine registry documentation (open-mmlab#186) * [Docs] Refine registry documentation * reslove comments * minor refinement * Refine Visualizer docs (open-mmlab#177) * Refine Visualizer docs * update * update * update featmap * update docs * update visualizer docs * [Refactor] Refine LoggerHook (open-mmlab#155) * rename global accessible and intergration get_sintance and create_instance * move ManagerMixin to utils * fix as docstring and seporate get_instance to get_instance and get_current_instance * fix lint * fix docstring, rename and move test_global_meta * rename LogBuffer to HistoryBuffer, rename MessageHub methods, MessageHub support resume * refine MMLogger timestamp, update unit test * MMLogger add logger_name arguments * Fix docstring * Add LogProcessor and some unit test * update unit test * complete LogProcessor unit test * refine LoggerHook * solve circle import * change default logger_name to mmengine * refactor eta * Fix docstring comment and unitt test * Fix with runner * fix docstring fix docstring * fix docstring * Add by_epoch attribute to LoggerHook and fix docstring * Please mypy and fix comment * remove \ in MMLogger * Fix lint * roll back pre-commit-hook * Fix hook unit test * Fix comments * remove \t in log and add docstring * Fix as comment * should not accept other arguments if corresponding instance has been created * fix logging ddp file saving * fix logging ddp file saving * move log processor to logging * move log processor to logging * remove current datalaoder * fix docstring * fix unit test * add learing rate in messagehub * Support output training/validation/testing message after iterations/epochs * fix docstring * Fix IterBasedRunner log string * Fix IterBasedRunner log string * Support parse validation loss in log processor * [Enhancement] Add PolyParamScheduler, PolyMomentum and PolyLR (open-mmlab#188) * [Enhancement] Add PolyParamScheduler, PolyMomentum and PolyLR * min_lr -> eta_min, refined docstr Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com> Co-authored-by: Tong Gao <gaotongxiao@gmail.com>
No description provided.