8000 return empty list, if input is empty by jin-s13 · Pull Request #188 · open-mmlab/mmpose · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Closed
wants to merge 1 commit into from
Closed

return empty list, if input is empty #188

wants to merge 1 commit into from

Conversation

jin-s13
Copy link
Collaborator
@jin-s13 jin-s13 commented Oct 12, 2020

No description provided.

@codecov
Copy link
codecov bot commented Oct 12, 2020

Codecov Report

Merging #188 into master will increase coverage by 0.22%.
The diff coverage is 86.95%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
#unittests 83.04% <86.95%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmpose/apis/inference.py 69.23% <0.00%> (-2.00%) ⬇️
mmpose/models/mesh_heads/discriminator.py 81.67% <68.75%> (-1.80%) ⬇️
mmpose/models/detectors/mesh.py 92.24% <92.24%> (ø)
mmpose/models/detectors/__init__.py 100.00% <100.00%> (ø)
mmpose/models/detectors/base.py 57.40% <0.00%> (+14.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a72861b...b5311ba. Read the comment docs.

@jin-s13
Copy link
Collaborator Author
jin-s13 commented Oct 12, 2020

Just for safety & code readability.
In fact, Numpy will automatically deal with np.array([]).
Even if the input is empty, we will not get index errors.

@jin-s13 jin-s13 requested a review from innerlee October 12, 2020 07:12
8000
@@ -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])
"""
if len(bbox_xyxy) == 0:
return []
Copy link
Contributor

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

Copy link
Contributor

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

@jin-s13 jin-s13 closed this Oct 15, 2020
@jin-s13 jin-s13 deleted the demo_fix branch October 17, 2020 09:40
HAOCHENYE pushed a commit to HAOCHENYE/mmpose that referenced this pull request Jun 27, 2023
…mlab#188)

* [Enhancement] Add PolyParamScheduler, PolyMomentum and PolyLR

* min_lr -> eta_min, refined docstr
HAOCHENYE added a commit to HAOCHENYE/mmpose that referenced this pull request Jun 27, 2023
* [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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0