1319 Commits

Author SHA1 Message Date
Zaida Zhou
1e922b84ee
[Fix] Fix protobuf compatible error (#1992) 2022-05-26 17:26:45 +08:00
Zaida Zhou
05bdd1624f
Fix lint (#1984) v1.5.2 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
v1.5.1
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
Song Lin
94cc99d595
[Enhancement] Add type hints for mmcv/arraymisc and mmcv/video (#1950)
* 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>
2022-05-11 21:55:41 +08:00
Song Lin
882cab77bb
[Enhancement] Add type annotations for mmcv/visualization (#1947)
* Add type hints

* Replace mmcv is_str by isinstance str

* Add type hints in optflow.py

* Update mmcv/visualization/optflow.py

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

* Update mmcv/visualization/color.py

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

* Fix tuple hints

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-10 23:48:00 +08:00
Jiazhen Wang
105fe55002
[Feature] Add adjust_hue (#1628)
* [Impl] impl adjust hue

* Update docstring

* Fix docstring

* add copyright

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-10 17:06:45 +08:00
jmercat
1dbb5d360d
[Fix] Fix dump method of Config (#1837)
* 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>
2022-05-10 15:41:51 +08:00
Alex Yang
a848ecfdfc
[Fix] Fix type hint in file_client (#1942)
* [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
2022-05-10 14:01:07 +08:00
Zaida Zhou
fb9af9f36f
[Docs] Fix heading anchor in documentation (#1945) 2022-05-09 22:53:17 +08:00
Alex Yang
19b1d363a5
[Fix] Incorrectly append items to __all__ (#1944) 2022-05-09 19:45:45 +08:00
pc
e70a318ae9
[Fix] Fix parrots unit tests (#1913) 2022-05-09 16:59:32 +08:00
Hongbin Sun
a86e807105
[Fix] LmdbBackend can't pickle env obj (#1764)
* 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
2022-05-08 17:21:52 +08:00
Johannes L
d126f3026c
[Enhancement] Add support for latest Pillow resampling filter naming scheme (#1931)
* Add support for latest Pillow resampling filter naming scheme

* Comments added

* Shortened comments, lint fixes

* Added specific Pillow version
2022-05-08 17:20:49 +08:00
Zaida Zhou
8b4dcf1dfb
[Docs] Include several files in index.rts (#1939) 2022-05-07 16:26:18 +08:00
Boyuan Deng
8ecaf2e8b2
[Enhancement] Set environment variables in _init_dist_mpi (#1682)
* [Enhancement] Initialize 'mpi' launcher from OpenMPI's environmental variables

* raise exception when no MASTER_ADDR

Co-authored-by: jzwang <841713301@qq.com>
2022-05-05 12:36:52 +08:00
Mashiro
887d9a0f38
[Feature] Add a script to visualize lr (#1667)
* add learning rate visualization

* support momentum visualization

* fix second axis font size error

* fix argparse description

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

* fix lint

* Accelerate visualization

* Support custom batchsize and log-interval

Support custom batchsize and log-interval

* remove unnecessary keys and rename some varaible

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-05 12:29:03 +08:00
Wencheng Wu
a3a078eefb
[Enhancement] Support registering function (#1858)
* [Enhance] Support register function.

* fix unittest error

* add docs and unittest of register function

* modify the docs

* fix version to 1.5.1

* Update docs/zh_cn/understand_mmcv/registry.md

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

* Update docs/en/understand_mmcv/registry.md

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

* refine the docs

* modify module_class to module

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-05-02 18:31:41 +08:00
pc
9f5a03dc2c
[Feature] Add diff_iiou_rotated op in parrots (#1911) 2022-04-30 09:43:33 +08:00
Zaida Zhou
057c032347
[Docs] Update wechat in README_zh-CN.md (#1927) 2022-04-29 14:11:38 +08:00
Zaida Zhou
0cc84451df
[Fix] Fix GPG key error in CI (#1926) 2022-04-29 13:17:31 +08:00
WilliamKyle
b30755eef2
[Feature] Add rotated_feature_align cpu & onnxruntime implementation (#1878)
* 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
2022-04-29 10:02:33 +08:00
Hu Di
4efec73269
[Docs] Add IPU installation documentation (#1904)
* add doc for mmcv installation

* Update docs/en/get_started/build.md

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

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-04-28 14:59:27 +08:00
q.yao
30057a6113
[Fix] Fix nms rotate illegal memory access (#1891) 2022-04-27 21:06:30 +08:00
Jiazhen Wang
c324b1fcfc
[Fix] Ensure the type of filename parameter in Config is str (#1725)
* ensure type of filename is str

* check filename for func: fromfile

* add ut for fromfile
2022-04-27 19:50:04 +08:00
q.yao
de0c1039f7
Fix bbox unit test (#1914) 2022-04-26 16:49:28 +08:00
q.yao
0e59036211
[Enhancement] Optimize bbox overlap (#1718)
* add half support

* add cpu implementation

* fix bugs, load with inline asm

* better vector load

* add comments
2022-04-26 00:44:01 +08:00
Tan SU
86f8ade959
[Fix] Fix collec_env() encoding error on Windows (#1905) 2022-04-25 10:59:24 +08:00
Artem
94c071b310
[Feature] Add ClearMLLoggerHook (#1906)
* added clearml logger support

* review fixes

* review fixes
2022-04-24 13:20:09 +08:00
Alex Yang
4fb59b9830
[Docs] Update qq_group_qr_code (#1899) 2022-04-21 11:35:12 +08:00
Zaida Zhou
235c0253ab
bump version to v1.5.0 (#1883) v1.5.0 2022-04-19 00:14:38 +08:00
Mashiro
a80df6874d
[Enhancement] Enhance get_torchvision_models (#1867)
* enhance get_torchvision_models

* simplify logic

* Dump ckpt in torchvision lower than 0.13.0 to a json file

* add json

* refactor load urls logic

* fix unit test

* change url key to lower letters

* check torchvision version rather than check torch version in unittest

* Fix CI and refine test logic of torchvision version

* add comment

* support compare pre-release version

* support loaad modeel like torchvision

* refine comment.

* fix unit test and comment

* fxi unit test bug

* support get model by lower weights
2022-04-18 23:20:48 +08:00
Tan SU
a5cfcb93ff
[Fix] Get correct encoding in Windows for collect_env() (#1887)
* [Fix] get correct encoding in Windows for collect_env()

* stdout.fileno()
2022-04-18 17:27:22 +08:00
Vince Jankovics
b80447707c
[Enhancement] Support None in DictAction (#1834)
* None parsing fixed for config

* Formatting

* Lower case none fix
2022-04-18 14:44:32 +08:00
mattcasey02
6f6b17e65f
[Fix] Fixed version comparison to include prerelease versions (#1877)
* Fixed version comparison to include prerelease versions

Currently all tagged versions of torch 1.11.0 have version 1.11.0a0. Previously the comparison to 1.11.0 failed and self._sync_params() was still used, causing an error. This fix should include all versions of 1.11.

* Same update

Didn't realize that 1.11.0 was mentioned multiple times in the file. This fixes the other instances.
2022-04-18 10:47:56 +08:00
Hu Di
5221a3883c
[Feature] Support MMCV on IPU (#1882)
* implement runner on IPU

* adjust import

* adjust import

* add ignore for ipu on without ipu

* remove compilation cache

* remove ipu from mmcv/runner.__all__

* adjust IS_IPU and IS_MLU

* adjust by isort

* add ipuHardwareIsAvailable

* remove engine_cache

* code review 9
2022-04-18 00:02:49 +08:00
Qiza-lyhm
42e7e2eec4
[Fix] Add MLU kernels to be compiled (#1885)
- Add MLU operator kernels.
2022-04-17 01:10:06 +08:00
Zaida Zhou
03b38a46ad
[Refactor] Move is_mlu_available to mmcv/utils/device_type.py (#1884)
* [Refactor] Move is_mlu_available to mmcv/utils/device_type.py

* remove comma

* fix isort
2022-04-17 00:15:35 +08:00