Commit Graph

1303 Commits (18e8f32fff73fe13aee953b6b7b7fdd12bcdb20c)
 

Author SHA1 Message Date
tripleMu 27d1d7fef2
Add type hints for mmcv/cnn/utils (#1996)
* Add typehint in mmcv/cnn/utils/*

* Update mmcv/cnn/utils/flops_counter.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/cnn/utils/weight_init.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix bugs

* Fix

* Fix2

* Update mmcv/cnn/utils/weight_init.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/cnn/utils/flops_counter.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/cnn/utils/weight_init.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/cnn/utils/weight_init.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix

* minor fix

* line is too long.

* Update mmcv/cnn/utils/weight_init.py

Co-authored-by: Jiazhen Wang <47851024+teamwong111@users.noreply.github.com>

* Fix

* Update mmcv/cnn/utils/weight_init.py

* fix default value of float type hint

* fix default value of float type hint

* fix default value of float type hint

* fix default value of float type hint

* fix default value of float type hint

* fix default value of float type hint

* fix default value of float type hint

* Fix

* minor refinement

* replace list with tuple for input

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Jiazhen Wang <47851024+teamwong111@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: zhouzaida <zhouzaida@163.com>
2022-06-07 21:00:29 +08:00
pc 0230fc3bc0
[Feature] Add rotated_feature_align_cpu and update iod3d in parrots (#2027) 2022-06-07 16:20:06 +08:00
tc_exe 4061fcdc95
Add type hints for mmcv/engine/test.py (#2034)
* Add type hints for mmcv/engine/test.py

* Add type hints for mmcv/engine/test.py

* Add type hints for mmcv/engine/test.py

* fix type hint

Co-authored-by: zhouzaida <zhouzaida@163.com>
2022-06-07 16:12:07 +08:00
Haobo Yuan 3ede2789cc
[Fix] Include torchvision_12.json in the sdist package (#2039) 2022-06-07 10:16:08 +08:00
古月闻星 70944a261d
[Docs] Update copyright years in docs (#2042) 2022-06-06 23:20:49 +08:00
ShawnHu dcdf89611e
Add type hints for mmcv/ops (#2037)
* Add type hints for mmcv/ops/ball_query.py, border_align.py and correlation.py

* Add type hints for mmcv/ops/deform_conv.py, deform_roi_pool.py and deprecated_wrappers.py

* Remove type hints for deform_conv.py and deform_roi_pool.py

* Fix type hints for other files
2022-06-06 23:10:06 +08:00
WINDSKY45 ea0e8cdb41
[Enhancement] Add type ints in several files (#2020)
* [Enhance] Add type ints in these files:
'base_module.py', 'checkpoint.py',
'default_constructor.py',
'dist_utils.py', 'fp16_utils.py',
'log_buffer.py', 'priority.py'.

* Fixed all the inappropriate type hints.
Removed the return type of __init__ funcs.

* Fixed type hint.

* Added type hints in `dist_utils.py` and `log_buffer.py`.

* Remove unnecessary import.

* minor fix

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-06-03 07:19:12 +08:00
tripleMu 88ae2a4e59
Add type hints in several files (#1999)
* Add typehint in such files

* Update mmcv/video/processing.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix np.ndarray str

* Fix

* Update mmcv/video/processing.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix

* Fix

* Update mmcv/video/processing.py

Co-authored-by: Jiazhen Wang <47851024+teamwong111@users.noreply.github.com>

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Jiazhen Wang <47851024+teamwong111@users.noreply.github.com>
2022-06-03 07:14:51 +08:00
WINDSKY45 85c0f85bea
[Enhancement] Add type hints in mmcv/ops/focal_loss.py. (#1994)
* [Enhance] Add type hint in `focal_loss.py`.

* Use torch.LongTensor as type of target.

* Fixed the missing type hint.

* Removed some unnecessary type hint.

* Add missing type hint and fix the type hint of `target`.

* Fix the format of typehint.

* minor refinement

* minor fix

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-06-02 23:32:01 +08:00
ShawnHu f51bcf50ed
Add type hints in mmcv/cnn/resnet.py (#1982)
* Add type hints in resnet.py

* using lint while commit

* using lint while commit

* using lint while commit

* reslove typehints

* add pre-defined type hints

* Add type hints for other methods in mmcv/cnn/resnet.py

* Fix type hints
2022-06-02 19:17:19 +08:00
ShawnHu aea2bb28d4
Add type hints for mmcv/ops (#2032)
* Add type hints in mmcv/ops/carafe.py

* Add type hints in mmcv/ops/corner_pool.py

* Add type hints in mmcv/ops/diff_iou_rotated.py

* Add type hints for other methods for mmcv/ops/corner_pool.py

* Add type hints for other methods in mmcv/ops/carafe.py

* Add type hints for symbolic method
2022-06-01 21:02:03 +08:00
WINDSKY45 bcd3291431
Add type hints for mmcv/runner (#2008)
* [Enhance] Add type hint in 'utils.py'.

* [Enhance] Add type hint in 'default_constructor.py'.

* Fixed undefined name.

* minor refinement

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-06-01 12:35:09 +08:00
gy77 d499abf2fd
Add type hints in mmcv/ops/pixel_group.py (#2016)
* add typehint in mmcv/ops/pixel_group.py

* fix indent

* fix indent

* improve format

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-31 10:06:05 +08:00
Zaida Zhou 9ea55badcb
[Fix] dump has incompatible type TextIO (#2029) 2022-05-31 00:02:37 +08:00
tripleMu 569d588e15
Add type hints for mmcv/fileio (#1997)
* Add typehint in mmcv/fileio/*

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/parse.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/parse.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/parse.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/fileio/io.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix hint bugs

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-30 17:42:53 +08:00
ShawnHu e234c183cc
Add type hints in ops/border_align.py (#2026) 2022-05-30 15:33:18 +08:00
tripleMu ea173c9f07
Add type hints for mmcv/runer/hooks/logger (#2000)
* Fix

* Fix
2022-05-30 15:31:15 +08:00
ShawnHu c70fafebf4
Add type hints in ops/assign_score_withk.py (#2023) 2022-05-29 20:55:50 +08:00
kira de90c7a2fd
[Enhancement] Update the missing warning message for LrUpdaterHook (#2021) 2022-05-29 11:31:47 +08:00
gy77 e5d9ef5285
Add type hints in mmcv/ops/point_sample.py (#2019)
* Add type hints in mmcv/ops/point_sample.py

* fix docstring and type hint
2022-05-29 09:25:27 +08:00
tripleMu 966b742817
Add type hints for mmcv/runner/optimizer (#2001) 2022-05-28 23:45:42 +08:00
ShawnHu 1577f40744
Add type hints in mmcv/ops/active_rotated_filter.py (#2017)
* add typehints in ops-active-rotated-filter

* resolve typehints in ops-active-rotated-filter
2022-05-28 19:57:27 +08:00
gy77 19902d897a
Add type hints in mmcv/ops/points_sampler.py (#2015)
* add typehint in mmcv/ops/points_sampler.py

* Update mmcv/ops/points_sampler.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/ops/points_sampler.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-28 15:35:17 +08:00
gy77 1211b06b9e
Add type hint in mmcv/ops/points_in_boxes.py (#2007)
* add type hint in mmcv/ops/points_in_boxes.py

* fix lint
2022-05-28 11:57:34 +08:00
gy77 50d1505225
Add type hint in mmcv/ops/points_in_polygons.py (#2013) 2022-05-28 11:57:08 +08:00
WINDSKY45 335199db92
Add type hint in lr_updater.py (#1988)
* [Enhance] Add type hint in `lr_updater.py`.

* Fix circle import
2022-05-27 15:43:47 +08:00
gy77 23eb359beb
Add type hint for the "boxes_iou_bev" function in iou3d.py (#2005)
* add type hints in iou3d.py

* fix lint

* Add a missing item in iou3d.py
2022-05-27 15:01:01 +08:00
Zaida Zhou d0dc7577b8
Transfer test data to aliyun (#2004) 2022-05-27 14:54:08 +08:00
kira a465fb4114
Add type hints in alexnet.py (#1983)
* Update alexnet.py

* Update alexnet.py

* Update mmcv/cnn/alexnet.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update alexnet.py

* Update mmcv/cnn/alexnet.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/cnn/alexnet.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update alexnet.py

* fix importing format

* Update alexnet.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-27 14:00:18 +08:00
zengxiang68 699398ad86
Add type hints for mmcv/ops (#1987)
* add type hints for mmcv/ops/...

* add type hints for mmcv/ops/...

* add type hints for mmcv/ops/...
2022-05-27 12:45:47 +08:00
Yvette Zhao 84a544fb3e
Add type hints for runner/builder (#1985) 2022-05-27 10:44:08 +08:00
tripleMu ef2b927b29
Add typehint in mmcv/utils* (#1998)
* Add typehint in mmcv/utils*

* Update mmcv/utils/registry.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/utils/registry.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-27 10:30:25 +08:00
gy77 af861bf9b8
Add type hints in iou3d.py (#1989)
* add type hints in iou3d.py

* fix lint
2022-05-27 10:23:10 +08:00
Range King bb4c65d8ff
Add type hints in bbox.py and box_iou_rotated.py (#1981)
* Add type hints in bbox.py

* Add type hints in box_iou_rotated.py

* Update ball_query.py

* Revert "Add type hints in bbox.py"

This reverts commit 102566488e.

* Update bbox.py

* Revert "Update bbox.py"

This reverts commit d34b2c6ed5.

* Update bbox.py
2022-05-27 10:21:48 +08:00
Zaida Zhou 1e922b84ee
[Fix] Fix protobuf compatible error (#1992) 2022-05-26 17:26:45 +08:00
Zaida Zhou 05bdd1624f
Fix lint (#1984) 2022-05-25 20:45:31 +08:00
Zaida Zhou 4ea914ed28
bump version to v1.5.2 (#1979) 2022-05-25 20:08:02 +08:00
Wencheng Wu cb781ae4ba
[Fix] Fix the problem that the instance cannot reuse when overwriting the file client. (#1747)
* [Fix] Fix the problem that the instance cannot reuse when overwriting the file client.

* Remove _overridden_backends and _overridden_prefixes, and pop the old instance when overwriting the file client.

* add unittest

* fix prefix error

* modify clear_backend to overridden_backend

* Delete redundant comments.
2022-05-25 19:34:15 +08:00
wlf-darkmatter 544a6b1432
Imporve ability to view usage data during training (#1940)
* Imporve ability to view usage data during training

The wrong labeling of the dataset may cause problems such as gradient explosion during the training process. The wrong labeling can be found by setting up a hook function.
**Problem**: However, when a for loop is used to traverse the iterator of the pytorch `DataLoader` class, the hook cannot obtain the information of the currently read image, and thus cannot determine the source of the error.
**Solution**: Load the data_batch information into the `runner` during the train process, and then pass it to the hook function to solve the problem.

* Update epoch_based_runner.py

* Update iter_based_runner.py

* strict the scope of runner.data_batch

* strict the scope of runner.data_batch

* strict the scope of runner.data_batch
2022-05-25 19:33:27 +08:00
Alex Yang 21bada3256
[fix]:fix docstrings in EvalHook (#1978) 2022-05-25 19:14:37 +08:00
whcao c90f2be0be
[Fix] Fix is_module_wrapper (#1900)
* fix is_module_wrapper

* test is_module_wrapper

* fix code style
2022-05-25 17:32:41 +08:00
Danila Rukhovich e9f48a4f8e
[Enhance] Replace BEV IoU with 3D IoU (#1902)
* add iou3d

* revert deprecated python function

* fix lint

* replace 3d iou/nms calls for bev iou/nms
2022-05-25 17:05:50 +08:00
del-zhenwu 7e6f462495
[Fix] Skip CPU test in test_rotated_feature_align.py for parrots (#1968)
* skip test_rotated_feature_align.py for parrots

Signed-off-by: del-zhenwu <dele.zhenwu@gmail.com>

* fix lint

Co-authored-by: zhouzaida <zhouzaida@163.com>
2022-05-20 17:04:58 +08:00
JarvisKevin 60eadb0665
[Enhancement] Lower the restrictions of _resize method in BaseMergeCell (#1959)
* Fix the bug met in using nasfpn

Fix the bug met in using nasfpn which is mentioned at https://github.com/open-mmlab/mmdetection/issues/5987.
Avoid the strong restrictions of _resize function in BaseMergeCell:
1. When Downsampling the feature map, the feature map's shape must be divisible by the target size. We pad zero around feature map before max_pool2d opt to make it always divisible. (line 102 ~ 107)
2. Considering the different downsampling scale of H and W, shape[-2] and shape[-1] are involed in the definition of kernel_size. (line 110)

* Update merge_cells.py

check flake8 & isort

* Update merge_cells.py

* Update merge_cells.py

yapf

* Update mmcv/ops/merge_cells.py

X_pad rename to padding_x

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update merge_cells.py

format the code style after renameing the X_pad to padding_x

* Update test_merge_cells.py

Mainly test the downsampling resize in BaseMergeCell. The smaller target size is set to (14, 7), the classical feature map's size in the last few stages of the backbone, which will product different downsampling scales in different dims.

* Update test_merge_cells.py

add "# Copyright (c) OpenMMLab. All rights reserved."

* Update merge_cells.py

format the variable name

* Update test_merge_cells.py

Testing divisible and indivisible situations simultaneously

* Update mmcv/ops/merge_cells.py

fix the bug when h is indivisible and w is divisible, the pad_w will be padded unreasonable.

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmcv/ops/merge_cells.py

fix the bug when w is indivisible and h is divisible, the pad_h will be padded unreasonable.

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* fix undefined error

* Update merge_cells.py

make pad_h, pad_w more readable

* Update test_merge_cells.py

use @pytest.mark.parametrize instead of 'for' methor

* Update merge_cells.py

* Update test_merge_cells.py

isort

* Update merge_cells.py

isort

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-20 15:13:13 +08:00
Zaida Zhou 45fa3e44a2
Add pyupgrade pre-commit hook (#1937)
* add pyupgrade

* add options for pyupgrade

* minor refinement
2022-05-18 11:47:14 +08:00
Zaida Zhou c561264d55
[Docs] Fix failed links in docs/zh_cn/faq.md (#1964)
* [Docs] Fix failed links in docs/zh_cn/faq.md

* fix links
2022-05-17 10:45:19 +08:00
Zaida Zhou b326a219a7
[Docs] Replace markdownlint with mdformat for avoiding installing ruby (#1936)
* Use mdformat pre-commit hook

* allows consecutive numbering

* improve .mdformat.toml

* test mdformat

* format markdown

* minor fix

* fix codespecll

* fix circleci

* add linkify-it-py dependency for cicleci

* add comments

* replace flake8 url

* add mdformat-myst dependency

* remove mdformat-myst dependency

* update contributing.md
2022-05-16 20:47:56 +08:00
q.yao 8708851eca
[Fix] Fix bbox overlap fp16 (#1958)
* add CUDA_ARCH check

* add check in cuh
2022-05-14 19:46:27 +08:00
Zaida Zhou a3b4640be8
bump version to v1.5.1 (#1951) 2022-05-13 10:50:11 +08:00
SuperDong 940609d5ea
[Enhancement] Add type annoations for mmcv/visualization/image (#1946)
* dev_1st_mmcv_visual_image_py

* dev_3rd_mmcv_visual_image_py

* dev_4th_mmcv_visual_image_py

* dev_5th_mmcv_visual_image_py

* dev_6th_mmcv_visual_image_py

* dev_7th_mmcv_visual_image_py

* dev_8th_mmcv_visual_image_py

* dev_9th_mmcv_visual_image_py

* minor fix

* fix isort

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-12 12:50:29 +08:00