* 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>
* Add type hints
* Add type hints
* Fix int float about scalar
* Add type hints for mmcv/tensorrt
* Update mmcv/tensorrt/tensorrt_utils.py
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
* Update mmcv/arraymisc/quantization.py
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
* Ignore type hint for dtype
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
* config dump fix
dump should not depend on how config was loaded only where it is dumped
changed checks for type to the given filename instead of the source filename
* defined test_fromdict and fixed dump function
it might be more convoluted than it needs to be but the formatting depends on the extension of the argument or the extension of the self.filename
* config dump defaults to returning pretty_text, test_fromdict renamed to test_dump_from_dict
* some reformatting in docstrings
* refine unittest
* fix unit test as comment
* Refine docstring
* minor refinement
* import mmcv
* fix lint
Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
* [fix]:fix type hint in file_client and mmcv
* [fix]:fix type hint in tests files
* [fix]:fix type hint in tests files
* [fix]:fix pre-commit.yaml to igore test for mypy
* [fix]:fix pre-commit.yaml to igore test for mypy
* [fix]:fix precommit.yml
* [fix]:fix precommit.yml
* Update __init__.py
delete unused type-ignore comment
* fix bug of can't pickle env objs
* use utf-8 to support Chinese
* use __del__ instead close
* move try import to init
* remove getitem
* use client instead
* add rotated_feature_align cpu implementation
* add rotated_feature_align onnxruntime implementation
* Update code for advices from grimoire
Remove useless comment from mmcv/ops/csrc/pytorch/cpu/rotated_feature_align.cpp
Replace ambiguous function name atomicAdd in mmcv/ops/csrc/pytorch/cpu/rotated_feature_align.cpp
Simplify unit test with parameter in tests/test_ops/test_rotated_feature_align.py
Use fma in interpolate in mmcv/ops/csrc/onnxruntime/cpu/rotated_feature_align.cpp mmcv/ops/csrc/pytorch/cpu/rotated_feature_align.cpp
* Inline the function to reduce the overhead of the function call
Use fma in interpolate