* [Feature] Support Psamask with cambricon MLU backend
* [Fix] refine the format according to lint check
* Replace std:max/min with conditional operators
* [Fix] Format head files
* 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>
* 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>
* 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
* [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>
* [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>
* 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
* 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
* [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>
* 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
* [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.
* 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
* 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>