Commit Graph

460 Commits (master)

Author SHA1 Message Date
Wenhao Wu c1de4c9bbf
[Feature] Add spconv ops from mmdet3d (#1581)
* add ops (spconv) of mmdet3d

* fix typo

* refactor code

* resolve comments in #1452

* fix compile error

* fix bugs

* fix bug

* transform from 'types.h' to 'extension.h'

* fix bug

* transform from 'types.h' to 'extension.h' in parrots

* add extension.h in pybind.cpp

* add unittest

* Recover code

* (1) Remove prettyprint.h
(2) Switch `T` to `scalar_t`
(3) Remove useless lines
(4) Refine example in docstring of sparse_modules.py

* (1) rename from `cu.h` to `cuh`
(2) remove useless files
(3) move cpu files to `pytorch/cpu`

* reorganize files

* Add docstring for sparse_functional.py

* use dispatcher

* remove template

* use dispatch in cuda ops

* resolve Segmentation fault

* remove useless files

* fix lint

* fix lint

* fix lint

* fix unittest in test_build_layers.py

* add tensorview into include_dirs when compiling

* recover all deleted files

* fix lint and comments

* recover setup.py

* replace tv::GPU as tv::TorchGPU & support device guard

* fix lint

Co-authored-by: hdc <hudingchang.vendor@sensetime.com>
Co-authored-by: grimoire <yaoqian@sensetime.com>
2022-02-18 15:53:10 +08:00
Ma Zerun 33c83b5afa
Support deepcopy for Config (#1658)
* Support deepcopy for Config

* Iterate the `__dict__` of Config directly.

* Use __new__ to avoid unnecessary initialization.

* Improve according to comments
2022-02-16 22:51:08 +08:00
Hakjin Lee b10eaedd38
[Fix] batched nms for nms_rotated (#1688)
* Fix batched_nms to support nms_rotated

* Update test code for batched_nms with nms_rotated

* Edit indexing the score in nms

* Use -1 indexing for batched_nms
2022-02-12 14:45:39 +08:00
RangiLyu 62c1b7f68b
[Enhance] Use PyTorch HSwish implementation. (#1709)
* [Enhance] Use PyTorch HSwish implementation.

* fix conv test

* upgrade version

* add version comments
2022-02-12 14:34:35 +08:00
Zaida Zhou dd82ab1497
Upgrade the version of isort (#1705)
* Upgrade the version of isort

* sort the order of importing modules
2022-02-09 21:29:21 +08:00
Yue Zhou b0b30d0c5c
fix bug (#1702) 2022-02-09 14:00:12 +08:00
Hakjin Lee 7df4ebedb3
[Fix] Fix the mismatch torch version of MlflowLoggerHook(#1680)
* [Fix] mlflow logger error

* [Update] mlflow hook test arguments

* Replace torch.__version__ with mmcv.TORCH_VERSION

* update test code
2022-02-07 23:14:46 +08:00
Mashiro 26aba2f533
[Fix] Fix an incorrect assignment in the BaseTransformerLayer (#1670)
* fix BaseTransformerLayer

* Add BaseTransformerLayer unit test without ffn_cfg embed_dims

* Optimize code logic
2022-01-28 23:43:53 +08:00
Hakjin Lee 26c095dc11
[Fix] Fix the undefined name error (#1695) 2022-01-27 20:11:32 +08:00
Zaida Zhou 9dedc44555
[Fix] Fix the cast_tensor_type (#1639)
* [Fix] Fix the cast_tensor_type when the type of inputs is not the same as src_type

* Add note

* improve comments
2022-01-24 21:21:37 +08:00
Mashiro 580e374eae
Add decay to CyclicLrUpdater (#1655)
* Add decay to cyclic LR

* Simplify tests

* Fix error in tests

* fix cyclic lr

* add weight decay CyclicLrUpdate test

* Update mmcv/runner/hooks/lr_updater.py

update docstring

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

* update CyclicLrUpdater unit test

* add comments to CyclicLrUpdaterHook

* fix CyclicLrUpdater. Support peak_lr decay when target[0] < 1

* add momentum decay to CyclicMomentumUpdater

* update momentum unit test

* Fix CyclicMomentum comment

Fix CyclicMomentum comment

Co-authored-by: Dmytro Panchenko <panchenkodmytry@gmail.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-01-24 19:34:25 +08:00
bilibilee 0448fcf906
fix the scatter when input is cpu (#1621)
* fix the scatter when input is cpu

* Update _functions.py

Add spaces to comply with the code specification

* add unittests

* add a blank line

* fix unittet

Co-authored-by: zhouzaida <zhouzaida@163.com>
2022-01-24 19:17:10 +08:00
Jiazhen Wang b8d78336a7
[Fix] Align HSigmoid with pytorch official implementation(#1622)
* [Fix] align hsigmoid with pytorch official

* [Fix] add warnings for Hsigmoid

* [Fix] fix format

* [Fix] add unittest

* [Fix] fix docstring
2022-01-20 14:25:10 +08:00
imyhxy 37121bf4f4
[Fix] Fix the bug of momentum updater with warmup policy (#1626)
* fix momentum updater typo bug

* Add unit test for 'constant', 'linear' and 'exp' momentum warmup policy
2022-01-18 17:33:07 +08:00
Zaida Zhou 227037fcd3
[Fix] Fix the unit test of correlation op (#1659) 2022-01-13 14:27:50 +08:00
Yue Zhou 594ff3c0d3
[Feature] Add convex IoU CUDA op for rotated detection. (#1610)
* add convex iou

* fix lint

* add convex_iou

* fix convex_iou

* add convex_giou

* fix bug

* fix lint

* fix bug

* Update

* update

* add kernel loop

* fix bug.

* fix polygen typo

* simplify reverse

* Update convex_iou_cuda_kernel.cuh

* Update mmcv/ops/convex_iou.py

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

* Update mmcv/ops/convex_iou.py

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

* add   AT_DISPATCH_FLOATING_TYPES_AND_HALF

* fix lint

* fix lint

* Resolving conflicts

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-01-10 20:43:12 +08:00
Yue Zhou 9acc892a44
[Feature] Add active rotated filter op for rotated detection. (#1598)
* add  active_rotated_filter

* fix lint

* fix lint

* renaming nRotation and nOrientation

* Update active_rotated_filter_cuda_kernel.cuh

* Update active_rotated_filter_cuda.cu

* fix bug

* fix lint

* Update test_active_rotated_filter.py

* fix lint

* Update active_rotated_filter_cuda_kernel.cuh

* renaming

* Update mmcv/ops/active_rotated_filter.py

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

* Update mmcv/ops/active_rotated_filter.py

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

* Update mmcv/ops/active_rotated_filter.py

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

* Update mmcv/ops/active_rotated_filter.py

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

* Update mmcv/ops/active_rotated_filter.py

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

* Update mmcv/ops/active_rotated_filter.py

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

* fix lint

* Resolving conflicts

* fix lint.

* Update __init__.py

* Update mmcv/ops/csrc/pytorch/cuda/active_rotated_filter_cuda.cu

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

* Update active_rotated_filter.cpp

* fix lint

* Update mmcv/ops/csrc/pytorch/cpu/active_rotated_filter.cpp

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

* Update mmcv/ops/csrc/pytorch/cpu/active_rotated_filter.cpp

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

* Update active_rotated_filter.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-01-10 17:35:20 +08:00
fatih 40518322b6
add artifact logging to wandb hook (#1616)
* add artifact logging to wandb hook

* upload artifacts wiwth only specified suffix

* update docstring

* Update mmcv/runner/hooks/logger/wandb.py

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

* fix linting

* add tests for wandb artifact logging

* remove redundant lines

* fix wandb tests

* init `WandbLoggerHook` with `log_artifact=True` in tests

* remove redundant lines from wandb tests

* add docstring for `with_step`

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-01-10 16:52:38 +08:00
Yue Zhou 51b40c332a
[Feature] Add min_area_polygons CUDA op for rotated detection. (#1611)
* init

* Update pybind.cpp

* Update min_area_polygons_cuda.cuh

* Update cudabind.cpp

* fix bug

* Create test_min_area_polygons.py

* add test

* update

* Update min_area_polygons_cuda.cuh

* fix bugs.

* Update min_area_polygons_cuda.cuh

* Update min_area_polygons.py

* Update min_area_polygons_cuda.cuh

* merge these 4 nested loops

* add AT_DISPATCH_FLOATING_TYPES_AND_HALF

* fix lint

* Resolving conflicts
2022-01-10 11:00:50 +08:00
zhanggefan b6167d5987
[Enhancement] Add clockwise argument to ops box_iou_rotated and nms_rotated (#1592)
* add clockwise arguments to ops box_iou_rotated and nms_rotated

* refactor docs

* change code that may incur stopped gradient.

* refactor docs

* Update mmcv/ops/nms.py

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

* Update mmcv/ops/box_iou_rotated.py

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

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-01-10 10:57:11 +08:00
zhouyue 304efbb650
[Feature] Add points_in_polygons CUDA op for rotated detection. (#1600) 2021-12-24 10:56:48 +08:00
zhouyue 0bcbeadb53
[Feature] Add RiRoIAlignRotated CUDA op for rotated detection. (#1599) 2021-12-24 00:30:34 +08:00
zhouyue 2475dc3452
[Feature] Add feature refine CUDA op for rotated detection. (#1603)
* re PR

* replace all the feature_refine with rotated_feature_align

* replace all the FR with RotatedFeatureAlign

* Update mmcv/ops/rotated_feature_align.py

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

* Update mmcv/ops/rotated_feature_align.py

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

* fix lint

* Update mmcv/ops/csrc/pytorch/cuda/rotated_feature_align_cuda.cu

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

* Update mmcv/ops/csrc/pytorch/cuda/cudabind.cpp

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

* Update mmcv/ops/csrc/pytorch/cuda/rotated_feature_align_cuda.cu

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

* Update mmcv/ops/csrc/pytorch/cuda/rotated_feature_align_cuda.cu

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

* Update mmcv/ops/csrc/pytorch/cuda/rotated_feature_align_cuda.cu

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

* fix lint

* Update cudabind.cpp

* Update cudabind.cpp

* fix bug in test. & add backward test

* fix lint

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-12-23 17:38:58 +08:00
Hongbin Sun 690a77fa6f
[Feature]: Support tensor2grayimgs (#1595)
* support tensor2grayimgs

* give default mean and std according to the input channel

* update docstring

* update

* fix bug
2021-12-22 19:49:50 +08:00
David de la Iglesia Castro ac92a1116f
`DvcliveLoggerHook` updates to work with `DVC` (#1208)
* Updates to work with DVC

* Update docstrings

* Updated test

* Updated DVCLiveLoggerHook

* Fix name

* Added missing next_step call

* Fix expected call

* Implicit next_step

* Suggestions from review

* Update test_hooks.py

* Updated to last dvclive version

* Cleaned docstring

* Update mmcv/runner/hooks/logger/dvclive.py

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

* Update dvclive.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-12-22 19:35:06 +08:00
Jiazhen Wang fb486b96fd
[Fix] Fix some warnings in unittest (#1522)
* [Fix] fix some warnings in unittest

* [Impl] standardize some warnings

* [Fix] fix warning type in test_deprecation

* [Fix] fix warning type

* [Fix] continue fixing

* [Fix] fix some details

* [Fix] fix docstring

* [Fix] del useless statement

* [Fix] keep compatibility for torch < 1.5.0
2021-12-22 10:57:10 +08:00
Shilong Zhang 001f3f6610
[Feature]Add patch embed and patch merge (#1305) 2021-12-14 21:52:37 +08:00
wuwencheng 66bff139e4
[Feature] Add multi file backends to imread/imwrite. (#1527)
* Add file client to image io

* Fix petrel_client imwrite error

* Add examples to the docstring and delete the file check of imread

* modify docstring v1.3.19->v1.4.1

* Deprecate auto_mkdir parameter and complete test_io.py

* Fix error caused by deleting the mock package in test_io.py

* Add annotation to imencode

* modify imread input assert and delete the judgement of file client 'put' method

* Delete try except in imwrite.

* Add a error file extension unit test.
2021-12-14 14:37:21 +08:00
Shilong Zhang 43b2f0981c
[Feature]Support skip nms (#1552)
* skip nms

* judge at beginning

* add test

* remove else

* add more details in docstr including version not

* fix unitest

* fix doc

* fix doc

* fix typo

* resove conversation

* fix link
2021-12-14 13:18:30 +08:00
Jiazhen Wang 88e017337a
[Fix] fix config type inconsistency (#1575)
* [Fix] fix config type inconsistency

* [Fix] Fix unit test
2021-12-14 13:17:57 +08:00
Jiazhen Wang 250fadc210
[Fix] Fix checkpoint local files detect (#1549)
* [fix] fix checkpoint local files detect

* [Fix] add support for path like '~/xx/file'

* [Fix] fix some details

* [Fix] fix unittest
2021-12-14 13:17:29 +08:00
Zaida Zhou 84c7dc3436
[Fix] Fix the path of ceph containing cluster name (#1577)
* [Fix] Fix the path of ceph containing cluster name

* fix corner cases

* fix format

* add note
2021-12-14 10:41:27 +08:00
Shilong Zhang 22e73d6986
[Feature] Detect anomalous parameters (#1547)
* detect detect_anomalous_params

* fix default value

* merge two case

* fix none case

* add unitest

* fix typo

* change level to error

* fix type

* add more details in docstr
2021-12-14 10:28:36 +08:00
Luting Wang 56e9f73c58
[Feature] Add ModuleDict inherited from BaseModule and ModuleDict (#1542)
* improve: add module dict

* Update __init__.py

* docs: add module dict zh

* docs: add module dict

* Update test_basemodule.py

* Update __init__.py

* lint

* lint

* docs

* docs

* Update base_module.py

* lint
2021-12-06 11:56:12 +08:00
Zaida Zhou 990d8b6a83
[Fix] Add load_url to handle incompatibility of PyTorch versions (#1377)
* [Fix] Fix torch.load error

* [Fix] Fix torch.load error

* rename _save to _save_ckpt

* add load_url to handle imcompatibility of PyTorch versions

* add unittest for load_url

* fix typo

* print a friendly information when error occurred
2021-11-19 17:34:18 +08:00
WangJiaZhen e3c63f34bc
[Fix] Fix deform conv by adding an extra argument im2col_step (#1459)
* [Fix] fix deform conv by add argument

* [Fix] replace useless func with np.repeat and add necessary comment

* [Fix] reduce batch_size and remove useless lines and modify some var name

* [Fix] change position of comments

* [Fix] add im2col_step in the docstring and add two test cases

* [Fix] fix docstring and add comments for test cases

* [Fix] fix docstring

* [Fix] add note, fix issue link and other details

* [Fix] fix docstring details

* [Fix] fix links in docstring

* [Fix] fix docstring details
2021-11-10 19:05:20 +08:00
zhouzaida 0633f91139 print a warning information when eval_res is an empty dict 2021-11-10 15:44:48 +08:00
zhouzaida f2d11076eb [Fix] Raise AssertError when eval_res is a null dict 2021-11-10 15:44:48 +08:00
Tong Gao c522b47e6a
fix the wrong function reference bug in BaseTransformerLayer when batch_first is True (#1418) 2021-11-02 20:57:50 +08:00
q.yao 426e229d88
[Fix]: Update test data of test_tin_shift (#1426)
* Update test data of test_tin_shift

* Delete tmp.engine

* add pytest raises asserterror test

* raise valueerror, update test log

* add more comment

* Apply suggestions from code review

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

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-11-02 20:50:50 +08:00
Zaida Zhou 32e09f4933
[Feature] Upload checkpoints and logs to ceph (#1375)
* [Feature] Choose storage backend by the prefix of filepath

* refactor FileClient and add unittest

* support loading from different backends

* polish docstring

* fix unittet

* rename attribute str_like_obj to is_str_like_obj

* [Docs] Upload checkpoint to petrel oss

* add infer_client method

* Support uploading checkpoint to petrel oss

* add check_exist method

* refactor CheckpointHook

* support uploading logs to ceph

* rename var client to file_client

* polish docstring

* enhance load_from_ceph

* refactor load_from_ceph

* refactor TextLoggerHook

* change the meaning of out_dir argument

* fix test_checkpoint_hook.py

* add join_paths method

* remove join_paths and add _format_path

* enhance unittest

* refactor unittest

* add a unittest for EvalHook when file backend is petrel

* singleton pattern

* fix test_clientio.py

* deprecate CephBackend

* add warning in load_from_ceph

* fix type of out_suffix

* enhance docstring

* refactor unittest for petrel

* refactor unittest for disk backend

* update io.md

* add concat_paths method

* fix CI

* mock check_exist

* improve docstring

* improve docstring

* improve docstring

* improve docstring

* add isdir and copyfile for file backend

* delete copyfile and add get_local_path

* remove isdir method of petrel

* fix typo

* rename check_exists to exists

* refactor code and polish docstring

* fix windows ci

* add comment and polish docstring

* polish docstring

* polish docstring

* rename _path_mapping to _map_path

* polish docstring and fix typo

* refactor get_local_path

* add list_dir_or_file for FileClient

* add list_dir_or_file for PetrelBackend

* fix windows ci

* Add return docstring

* polish docstring

* fix typo

* fix typo

* fix typo

* fix error when mocking PetrelBackend

* deprecate the conversion from Path to str

* add docs for loading checkpoints with FileClient

* rename keep_log to keep_local

* refactor map_path

* add _ensure_methods to ensure methods have been implemented

* fix list_dir_or_file

* rename _ensure_method_implemented to has_method

* refactor

* polish information

* format information
2021-10-24 14:26:52 +08:00
Zaida Zhou 5b5b47fc87
[Feature] Loading objects from different backends and dumping objects to different backends (#1330)
* [Feature] Choose storage backend by the prefix of filepath

* refactor FileClient and add unittest

* support loading from different backends

* polish docstring

* fix unittet

* rename attribute str_like_obj to is_str_like_obj

* add infer_client method

* add check_exist method

* rename var client to file_client

* polish docstring

* add join_paths method

* remove join_paths and add _format_path

* enhance unittest

* refactor unittest

* singleton pattern

* fix test_clientio.py

* deprecate CephBackend

* enhance docstring

* refactor unittest for petrel

* refactor unittest for disk backend

* update io.md

* add concat_paths method

* improve docstring

* improve docstring

* add isdir and copyfile for file backend

* delete copyfile and add get_local_path

* remove isdir method of petrel

* fix typo

* add comment and polish docstring

* polish docstring

* rename _path_mapping to _map_path

* polish docstring and fix typo

* refactor get_local_path

* add list_dir_or_file for FileClient

* add list_dir_or_file for PetrelBackend

* fix windows ci

* Add return docstring

* polish docstring

* fix typo

* fix typo

* deprecate the conversion from Path to str

* add docs for loading checkpoints with FileClient

* refactor map_path

* add _ensure_methods to ensure methods have been implemented

* fix list_dir_or_file

* rename _ensure_method_implemented to has_method
2021-10-23 20:51:44 +08:00
dingchang 75cae78c55
[Feature] Add group points ops from mmdet3d (#1415)
* add op (group points) and its related ops (ball query and knn) in mmdet3d

* refactor code

* fix typo

* refactor code

* fix typo

* refactor code

* make input contiguous

Co-authored-by: zhouzaida <zhouzaida@163.com>
2021-10-23 14:01:31 +08:00
q.yao 6935a818ec
[Fix] Update test data for test_iou3d (#1427)
* Update test data for test_iou3d

* delete blank lines

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-10-22 21:18:19 +08:00
dingchang 2157b708fb
[Feature] Add iou3d op from mmdet3d (#1356)
* add ops (iou3d) in mmdet3d

* add unit test

* refactor code

* refactor code

* refactor code

* refactor code

* refactor code

Co-authored-by: zhouzaida <zhouzaida@163.com>
2021-10-22 10:46:55 +08:00
dingchang 4c8bfb48ef
[Feature] Add roiaware pool3d ops from mmdet3d (#1382)
* add ops (roiaware pool3d) in mmdet3d

* refactor code

* fix typo

Co-authored-by: zhouzaida <zhouzaida@163.com>
2021-10-21 20:00:04 +08:00
dingchang e3e1dba2c8
[Feature] Add voxel ops from mmdet3d (#1381)
* add ops (voxel) in mmdet3d

* add ops (voxel) in mmdet3d

* add ops (voxel) in mmdet3d

* refactor code

* update test

* update test

* update test

* refactor code

* refactor code

* refactor code

* fix typo

* fix typo
2021-10-21 11:08:11 +08:00
Ezra-Yu e8489a7b4b
Add case case_sensitive in scandir (#1389)
* add case_insensitive

* rename v

* case_insensitive to case_sensitive

* Update docstring
2021-10-20 14:34:34 +08:00
q.yao 91b8478c84
Reduce ms_deformable_attn test memory usage (#1407) 2021-10-15 19:49:39 +08:00
dingchang 5c25ae1a19
[Feature] Add roipoint_pool3d op from mmdet3d (#1358)
* add ops (roipoint_pool3d) in mmdet3d

* refactor code

* fix typo

* add unit test

* refactor code

* refactor code

* refactor code

* fix typo
2021-10-15 17:15:53 +08:00
dingchang e99bfce608
[Feature] Add assign_score_withk op for paconv from mmdet3d (#1357)
* add ops (assign_score_withk) in mmdet3d

* add ops (assign_score_withk) in mmdet3d

* refactor code

* fix typo

* refactor code

* fix typo

* polish docstring

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-10-15 13:18:31 +08:00
dingchang be5841e45d
[Feature] Add interpolate ops from mmdet3d (#1355)
* add ops (interpolate) in mmdet3d

* refactor code

* fix typo

* fix typo

* fix typo

* refactor code
2021-10-14 20:51:02 +08:00
Zaida Zhou 97e5bada4c
continue PR #1223 (#1404)
* fix MultiScaleDeformableAttention inference issue on cpu model

* fix lint

* add unintest

* remove some code

* Update tests/test_ops/test_ms_deformable_attn.py

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

* fix device

* remove device

* add more device

* refactor unittest

Co-authored-by: zhicheng huang <zhichenghzc@gmail.com>
Co-authored-by: zhangshilong <2392587229zsl@gmail.com>
Co-authored-by: Shilong Zhang <61961338+jshilong@users.noreply.github.com>
2021-10-14 20:50:38 +08:00
dingchang 1cd01db935
[Feature] Add gather points op from mmdet3d (#1338)
* add ops (gather points) in mmdet3d

* add ops (gather points) in mmdet3d

* refactor code

* refactor code

* fix typo
2021-10-14 16:58:12 +08:00
dingchang 42c9e71120
[Feature] Add knn op from mmdet3d (#1354)
* add ops (knn) in mmdet3d

* refactor code

* refactor code

* fix typo

* fix typo

* fix typo

* refactor code

* refactor code

* spell typo

* fix spell typo
2021-10-14 13:33:13 +08:00
Shilong Zhang fa22d9db4e
Fix potiential bug in `deprecated_api_warning` (#1395)
* assert both dep and new args exist at same time

* add unintest

* Update tests/test_utils/test_misc.py

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

* Update tests/test_utils/test_misc.py

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

* polish warning

* polish warning

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-10-13 20:53:11 +08:00
dingchang 63a6cbe913
[Feature] Add fps op from mmdet3d (#1337)
* add ops (furthest point sample) in mmdet3d

* refactor code

* refactor code

* fix typo

* fix typo

* fix typo

* refactor code

* fix typo

* define DIVUP in common_cuda_helper.hpp
2021-10-13 20:39:31 +08:00
Eugene Liu 599163e645
Add Deformable Conv CustomOp for onnxruntime (#1343)
* add onnx dcn

* replace gemm with torch C++ api

* small update

* fix cpp clang format

* pefer generic GEMM than torch ATen library

* addressing comments

* add ops path check
2021-10-13 20:28:24 +08:00
Zaida Zhou f22c9eb4a4
Add code spell hook to pre-commit and fix typos (#1384)
* Add code-spell hook to pre-commit

* Add code-spell hook to pre-commit and fix typos

* fix setup.cfg
2021-10-04 20:13:54 +08:00
Miao Zheng 745aa7373e
[Fix] Revise unit test of correlation (#1368)
* [Fix] Revise unit test of correlation

* rename

* lint

* lint

* lint

* lint
2021-09-25 21:13:34 +08:00
Miao Zheng 324e9f18ff
[Features] Load optical flow data from bytes (#1362)
* [Features] Load optical flow data from bytes

* docstring

* revise base on comments

* compression test data

* compression test data

* docstring

* minors
2021-09-23 21:25:59 +08:00
Miao Zheng b92ea0b5df
[Feature] Add Correlation CUDA op (#1361) 2021-09-23 21:08:41 +08:00
dingchang f3dfc4135b
[Feature] Add ballquery op from mmdet3d (#1332) 2021-09-23 21:08:00 +08:00
Wenwei Zhang 4e101e0b75
[Feature]: Support empty tensor in MMSyncBN (#1205)
* [Feature]: support empty tensor in MMSyncBN

* refine code

* resolve comments

* clean unnecessary comments

* fix inaccurate statistics when empty tensor

* resolve comments and add docstrings

* update unit tests

* rephrase, ready for merge
2021-09-23 17:10:38 +08:00
Leojc 2a3d2d4a35
Reimplement cc_attention using pure pytorch (#1201)
* Reimplement cc_attention using pure pytorch

* fix: avoid BC-Breaking

* delete cc_attention related cpp and cuda files

* delete cc_attention related lines in pybind.cpp

* make out Tensor contiguous.

* remove unneeded lines.

* Update mmcv/ops/cc_attention.py

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

* Update TestCrissCrossAttention

* passing pre-commit

* Update docstring of CrissCrossAttention

* Update docstring of CrissCrossAttention

* Update mmcv/ops/cc_attention.py

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

* [docs]polish the docstring

* [Docs] Polish the docstring

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

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2021-09-09 21:53:45 +08:00
Tong Gao 642d281823
[Feature] Add revert_sync_batchnorm (#1253)
* [Feature] Add revert_sync_batchnorm

* support mmsyncbn (to be tested)

* Test passed

* Update docstring, rename the test file

* remove test_sync_bn

* add comment

* add mmcv.ops check

* Add a comment

* Add notes and relax test req

Co-authored-by: gaotongxiao <gaotongxiao@gmail.con>
2021-09-08 10:59:39 +08:00
young 99088c81a8
[Fix] Restrict the warning message (#1267)
* restrict the warning message

* and an important keyword in warning description

* a more elegant way of condition

* link format code too long

* fix the stupid spelling mistake

* Use issubclass to restrict warning message.

* maybe this version is more elegant.

* conv + bias + norm warning pytest

* 'created' a warning, hahaha

* isort and yapf format revision

* isort and yapf format revision

* flake8 fail issue

* I have to right this way in order to solve the conflicts between yapf and flake8, sigh...

* fixed test bug

* Add ruby windows installer source.

* Simplified the code and remove ruby source from CONTRIBUTING.md

* use _BatchNorm to simplify the code

* bug fix and add instanceNorm case into warning

* change the warning message to make it more clear

* fix unit test
2021-09-07 19:45:14 +08:00
Ma Zerun f5c28a6e08
[Fix] Fix missing `state_dict._metadata` when saving and loading checkpoints. (#1294)
* Fix missing `state_dict._metadata` when saving & loading checkpoints.

* Add unit tests.

* Fix default value and variable names in unit tests.
2021-09-07 17:53:33 +08:00
Eugene Liu e621e08d54
Add DCN and Modulated DCN CPU implementation (#1278)
* DCN cpu version

* add modulated dcn cpu version

* move deform_conv_shape_check to deform conv utils

* add inline to deform_conv_shape_check

* add tests

* run linter

* add newline at file end

* run pre-commit against modulated deform conv cpp

* update saconv test

* run clang-format

* remove cuda device inline

* refactor dcn cuda/cpu functions

* remove DCN util

* remove DCN util hpp from all included files

* Addressing PR comment by refactoring modulated-DCN

* fix lint in cpp files
2021-08-29 20:48:31 +08:00
Wenwei Zhang 979a355d2a
[Feature] Add windows CI (#1023)
* add windows CI

* clean versions

* only allow pt1.7 on windows

* fix windows install issue

* add win cpu

* fix win command

* clean unnecessary command

* resolve turbojpeg & tempfile on win

* replace os.readlink with os.path.realpath

* fix windows ci

* close file before removing it

* fix windows ci

* fix symlink on windows

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* fix windows ci

* modify according to comment

Co-authored-by: zhouzaida <zhouzaida@163.com>
2021-08-24 10:07:31 +08:00
Paige Wang 1790e9f265
add modulated_deform_conv in onnxruntime support (#1281)
* add modulated_deform_conv in onnxruntime support

* Add docs descriptions

* Add gpu test in test_onnx.py

* code format

* remove new usage and move if outside for loop

* use memset when bias is nullptr
2021-08-23 11:22:24 +08:00
Ma Zerun 357b0dfb36
[WIP] continue PR #784 (#1221)
* Add gradient cumulative optimizer

fixes #190

* Update optimizer.py

* Update optimizer.py

* fix loss scale improperly in last equivalent_iter

* Add `GradientCumulativeOptimizerHook` in `__init__.py`.

* Add docstring of `GradientCumulativeOptimizerHook`.

* Add type check, BN warning and resume warning. And fix typo, lint the
code.

* Add unit test

* Update docstring example.

* Change GradientCumulativeOptimizerHook `__init__` arguments.

* Add GradientCumulativeOptimzierHook unit tests with IterBasedRunner.

* Add GradientCumulativeFp16OptimizerHook.

* Add unit tests of GradientCumulativeFp16OptimizerHook

* Use '!=' instead of '>' to determine resume

Co-authored-by: Zhiyuan Chen <this@zyc.ai>
2021-08-23 11:18:36 +08:00
Yining Li 4d9b43debd
Support deprecation info in Config (#1275)
* Support deprecation checking in Config

* add unittest for config deprecation

* support reference link in deprecation info

* add doc

* Update config.md
2021-08-23 10:36:37 +08:00
Zaida Zhou 846d3a4ac6
[Fix] Fix the bug that the training log and evaluating log are mixed (#1252)
* [Fix] Fix the bug that training log and evaluating log are mixed

* [Fix] Fix the bug that training log and evaluating log are mixed

* fix comment

* fix import error

* refactor

* refactor

* refactor

* clear log_buffer before evaluation

* fix error

* add unittest
2021-08-11 22:41:21 +08:00
Shilong Zhang 18c64d5fb0
Fix potential bugs of basemodule when record the initilization information (#1217)
* add logger for init

* change init_info of oevrload init_weight

* add judgement for params_init_info

* add delete comments for params_init_info

* add docstr and more comments

* add docstr and more comments

* resolve comments

* dump to a file

* add unitest

* fix unitest

* fix unitest

* write to ori log

* fix typo

* resolve commnets

* fix call initweights twice in topmost module

* fix the potential bug of recursive import

* fix unitest

* fix potiential bugs

* remove unneccesary change

* add more unitest

* fix add param in initweights

* add more comments

* raise error

* add more detail assert error
2021-08-11 22:05:44 +08:00
Jerry Jiarui XU c47c9196d0
[Docs] Add header for files (#1181)
* [Docs] Add header for files

* change to OpenMMLab

* add headers for .cpp, .cu, .h, .cuh

* replace Open-MMLab with OpenMMLab
2021-08-08 22:10:55 +08:00
Shilong Zhang 17fa6670eb
[Features] Add logger for initialization of parameters (#1150)
* add logger for init

* change init_info of oevrload init_weight

* add judgement for params_init_info

* add delete comments for params_init_info

* add docstr and more comments

* add docstr and more comments

* resolve comments

* dump to a file

* add unitest

* fix unitest

* fix unitest

* write to ori log

* fix typo

* resolve commnets
2021-07-23 21:07:54 +08:00
Haodong Duan ef48a47389
[Improvement] Improve digit_version & use it for version_checking (#1185)
* improve digit_version & use it for version_checking

* more testing for digit_version

* setuptools >= 50 is needed

* fix CI

* add debuging log

* >= to ==

* fix lint

* remove

* add failure case

* replace

* fix

* consider TORCH_VERSION == 'parrots'

* add unittest

* digit_version do not deal with the case if 'parrots' in version name.
2021-07-23 21:03:33 +08:00
Gu Wang 025ee9f5e6
[Feature] Add flat cosine lr updater (#1066)
* add flat cosine lr updater

* add test

* add doc

* update doc

* reformat

* update unittest

* update test flat cos

* remove momentum hook test

* update test

* change assert to ValueError

* fix unittest

* add by_epoch=True unittest

* change to start_percent

* change to start_percent in test
2021-07-20 17:16:50 +08:00
q.yao 5f9e6b610b
[Feature] Add ONNX export support to torch.roll (#1194)
* add torch.roll to onnx

* remove skip test

* add support to torch<170

* add dim=0 for torch==1.9.0

* update fixture function name, add comment in roll symbolic
2021-07-20 16:54:04 +08:00
Ma Zerun 366c628a85
[Fix] Fix potential interger overflow in `imequalize`. (#1198)
* Fix potential interger overflow in `imequalize`.

* Modify imequalize unit test image size to generate potential integer
overflow.
2021-07-14 21:03:06 +08:00
Ma Zerun 6659c38dd5
[Feature] Add `is_tracing` to wrap `torch.jit.is_tracing` in different versions. (#1187)
* Add `is_tracing` to wrap `torch.jit.is_tracing` in different versions.

* Remame `is_tracing` to `is_jit_tracing`

* Ignore `is_jit_tracing` tests in CI.
2021-07-13 14:42:50 +08:00
qjqfl 07d681ac00
[Feature]: support tensorrt custom plugin `MMCVCornerPool` (#1179) 2021-07-09 21:07:38 +08:00
Y_Xuan 2dc0a219c1
[Feature] Porting mmcv for hip (#1022)
* porting mmcv for hip

* add nvcc

* fix format

* fix format

* fix bug for carafe

* fix test_utils because rocm_torch not allow set torch.backends.cudnn.benchmark to false

* add LOOSEVERSION

* fix format

* fix format of version

* fix code format

* test for yaml

* fix bug for citest

* fix bug for how to get torch._version_ at setup.py
2021-07-09 21:02:10 +08:00
Zaida Zhou 4a9f83467c
[Fix] Fix unittest in pt1.9 (#1146)
* fix test.txt

* fix unittest in pt1.9

* fix checkpoint filename error

* add comment

* fix unittest

* fix onnxruntime version
2021-07-03 20:47:22 +08:00
Haodong Duan 1d5ee6e09a
use LooseVersion for version checking (#1158) 2021-06-29 21:33:08 +08:00
achaiah 21845db455
[Fix]: fix missing check of directory in scandir (#1110)
* Missing check for dir in the 'else' clause

Fixing issue when recursively scanning directories with filenames starting with '.'  Without this fix, the `if not entry.name.startswith('.') and entry.is_file()` logic falls through to the `else` clause which in the current code base will error out as it encounters '.' files (e.g. .DS_Store)

* Updated code per comments

* fixing indentation

* fix indenterror and add comment

* remove .DS_Store and add .file

Co-authored-by: zhouzaida <zhouzaida@163.com>
2021-06-29 21:31:00 +08:00
Ma Zerun 1b15f02220
support print hooks before running. (#1123)
* support print using hooks before running.

* Support to print hook trigger stages.

* Print stage-wise hook infos. And make `stages` as class attribute of
`Hook`

* Add util function `is_method_overriden` and use it in
`Hook.get_trigger_stages`.

* Add unit tests.

* Move `is_method_overriden` to `mmcv/utils/misc.py`

* Improve hook info text.

* Add base_class argument type assertion, and fix some typos.

* Remove `get_trigger_stages` to `get_triggered_stages`

* Use f-string.
2021-06-25 20:49:24 +08:00
Tong Gao 227e7a73b8
Support image reading while ignoring EXIF orientation info (#1091)
* Support image reading while ignoring EXIF orientation info

Add unit test for ignore_orientation flags in imread()

* add documentation for imread

* Add test cases
2021-06-25 20:46:13 +08:00
Ma Zerun 6fe3722510
Refine default hooks and custom hooks priority rank. (#1120)
* Refine default hooks and custom hooks priority rank.

* Add unit tests for custom hooks with string priority.

* Use priority `ABOVE_NORMAL` and `BELOW_NORMAL` instead of `HIGHER` and
`LOWER`.

And add unit tests for custom hook with the same priority as
default hooks.
2021-06-25 15:07:32 +08:00
lizz d9effbd1d0
Support variables in base files for configs (#1083)
* Support variables in base files for configs

Signed-off-by: lizz <lizz@sensetime.com>

* Test json and yaml as well

Signed-off-by: lizz <lizz@sensetime.com>

* Add test for recusive base

Signed-off-by: lizz <lizz@sensetime.com>

* Test misleading values

Signed-off-by: lizz <lizz@sensetime.com>

* Improve comments

Signed-off-by: lizz <lizz@sensetime.com>

* Add doc

Signed-off-by: lizz <lizz@sensetime.com>

* Improve doc

Signed-off-by: lizz <lizz@sensetime.com>

* More tests

Signed-off-by: lizz <lizz@sensetime.com>

* Harder test case

Signed-off-by: lizz <lizz@sensetime.com>

* use BASE_KEY instead of base

Signed-off-by: lizz <lizz@sensetime.com>
2021-06-25 14:30:58 +08:00
Yining Li 560719da41
EvalHook uses case-insensitive key indicator matching and configurabl… (#1076)
* EvalHook uses case-insensitive key indicator matching and configurable test functions

* * fix docstring

* * move test_fn import into __init__
* configurable greater/less keys

* * update unittest
* update DistEvalHook

* fix comments and remove debug code

* support single greater/less key
2021-06-24 22:08:48 +08:00
Junjun2016 49a1d347bb
[Enhancement] Support resize or rescale to multiple (#1121)
* add resize or rescale to multiple

* add imresize_to_multiple function in mmcv.image

* fix docstring

* use to_2tuple
2021-06-24 21:21:51 +08:00
Jintao Lin 9c26a1049e
empty tensor inference backward compatible (#1131)
* empty tensor inference backward continity

* update

* add 3d
2021-06-24 17:04:03 +08:00
Junjun2016 f7caa80f9c
[Enhancement] Add to_ntuple (#1125)
* add to_ntuple

* add unit test
2021-06-23 10:19:28 +08:00
q.yao 004c00675f
[Feature]: add modulated deformable conv TensorRT support (#1078)
* add modulated dcn, better dcn plugin

* clangformat

* update documentation
2021-06-16 21:38:07 +08:00
Shilong Zhang e05fb56031
Refactor the baseclass related to transformer (#978)
* minor changes

* change to modulist

* change to Sequential

* replace dropout with attn_drop and proj_drop in MultiheadAttention

* add operation_name for attn

* add drop path and move all ffn args to ffncfgs

* fix typo

* fix a bug when use default value of ffn_cfgs

* fix ffns

* add deprecate warning

* fix deprecate warning

* change to pop kwargs

* support register FFN of transformer

* support batch first

* fix batch first wapper

* fix forward wapper

* fix typo

* fix lint

* add unitest for transformer

* fix unitest

* fix equal

* use allclose

* fix comments

* fix comments

* change configdict to dict

* move drop to a file

* add comments for drop path

* add noqa 501

* move bnc wapper to MultiheadAttention

* move bnc wapper to MultiheadAttention

* use dep warning

* resolve comments

* add unitest:

* rename residual to identity

* revert runner

* msda residual to identity

* rename inp_identity to identity

* fix name

* fix transformer

* remove key in msda

* remove assert for key

Co-authored-by: HIT-cwh <2892770585@qq.com>
Co-authored-by: bkhuang <congee524@gmail.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
2021-06-11 18:09:31 +08:00
Dmitry Sidnev a88d1d28c1
[Feature] enable exporting to onnx for PointRend (#953)
* Fix export to onnx for PointRend

* Fix codestyle

* Fix codestyle

* Fix type in docstring

* Minor fix

* Fix export with custom ops

* Fix codestyle

* Add tests for bilinear_grid_sample function

* Remove redundant operation and rename variables

* Fix bug in bilinear_grid_sample and update test

* Fix getting batch size

* skip torch==1.3.1

* remove unused import

* fix lint

* support export with batch

* fix dynamic clip

* skip test for torch<1.5.0

* Add docstrings and comments

* Minor fix

* Recover clipping code

* Fix clamping in pytorch 1.7.0

* Fix bilinear_grid_sampler

* Minor fix

Co-authored-by: maningsheng <maningsheng@sensetime.com>
2021-06-11 13:49:19 +08:00
David de la Iglesia Castro bdd7022143
Add DvcliveLoggerHook (#1075)
* Add dvclive logger hook

* Move docstring to class

* docstring updates
2021-06-08 22:20:33 +08:00
Miao Zheng 50c255bc2d
[Feature] Support to use name of the base classes in init_cfg (#1057)
* [Fix] Support names of base classes matching in init_cfg

* revise bool to len
2021-06-01 22:35:19 +08:00
SemyonBevzuk bf2c9fa8d2
[Feature] NMS update (#957)
* Add score_threshold and max_num to NMS

* Fix codestyle

* Fix codestyle

* Fix inds in nms

* Update nms docstring

* Move score_threshold and max_num arguments

* Fix args order in docstring

* fix lint of c++ file

* Remove torch.onnx.is_in_onnx_export() and add max_num to batched_nms for separate classes.

* Rewrote max_num handling in NMSop.symbolic

* Added processing max_output_boxes_per_class when exporting to TensorRT

* Added score_threshold and max_num for NMS in test_onnx.py and test_tensorrt.py

* Remove _is_value(max_num)

* fix ci errors with torch==1.3.1

* Update test_batched_nms in test_nms.py

* Added tests for preprocess_onnx

* Moved 'test_tensorrt_preprocess.py' and 'preprocess', updated 'remove_tmp_file'.

* Update mmcv/tensorrt/__init__.py

* Fix segfault torch==1.3.1 (remove onnx.checker.check_model)

* Returned 'onnx.checker.check_model' with torch version check

* Changed torch version from 1.3.1 to 1.4.0

* update version check

* remove check for onnx

Co-authored-by: maningsheng <maningsheng@sensetime.com>
2021-05-31 23:42:26 +08:00
RunningLeon 4d42365ac2
[Feature]: add TensorRT InstanceNormalization plugin (#1034)
* add instancenorm plugin

* resolve comments

* fix lint

* fix typo
2021-05-25 20:03:57 +08:00
v-qjqs 6c7d6c32ee
Supports cuda version BorderAlign module (#1021)
* support cuda version `BorderAlign` module

* fix symbolic

* merge

* fix cpp lint error

* add unit test

* add comments for code references

* reformat doc

* fix lint error

* fix conflict
2021-05-25 15:23:11 +08:00
pc 732ff5093e
Add ms_deformable_attn in parrots (#1042) 2021-05-25 13:13:05 +08:00
q.yao 9d1436fb6c
[Feature] add cummax/cummin tensorrt plugin (#1031)
* add cummax/cummin tensorrt plugin

* fix isort

* fix with clang-format

* fix with clang-format again

* add document
2021-05-24 13:55:21 +08:00
Zaida Zhou 55b4847a41
[Feature] Add truncated normal weight init (#935)
* [Feature] Add truncated normal weight init

* [Feature] Add truncated normal weight init

* [Feature] Add truncated normal weight init

* update docstring

* delete modelA.pth

* modify according to comment

* use kstest to check truncated normal

* delete modelA.pth

* fix test.txt
2021-05-23 20:54:54 +08:00
Guangchen Lin 4bd3b5027a
[Fix] Support amp (pytorch >= 1.6.0) on DCN and DCNv2/ Add unit tests on DCN/DCNv2 amp (#1029)
* fix fp16 bug on DCNv2

* support fp16 on DCN/DCNv2 when pytorch >= '1.6.0'

* add comment

* Modified the comments

* Unified the usages of '.to()' and '.type_as()'
2021-05-23 17:42:59 +08:00
fcakyon e9f2a02b47
add neptune.ai logger hook (#1025)
* add neptune.ai logger hook

* add docstring

* move docstring

* update docstr

* update before_run
2021-05-23 15:28:21 +08:00
Guangchen Lin 5be9593499
[Fix] fix generalized attention fp16 (#1036)
* fix generalized attention fp16

* fix building without gpu error

* add comment

* Cast tensor at initialization
2021-05-23 15:16:27 +08:00
Ma Zerun 15bcaa9c05
Add custom hook by config file (#970)
* Assign different priority to default hooks, and add custom hook register in base runner.

* Add custom hook register in example train file

* Add unittest of custom hook

* Code format
2021-05-13 20:29:17 +08:00
Shilong Zhang 9b8dd0835d
[fix]: fix softnms (#1019)
* fix basemodule

* fix typo

* fix unitest
2021-05-13 14:04:54 +08:00
Jintao Lin 4c2b05f9b8
Load `hook_msgs` when resume checkpoint (#962) 2021-05-13 09:54:38 +08:00
jeffreykuang 2623fbf21c
Add pixel group and contour expand ops (#993)
* add pixel group ops

* reformatting

* formatting&rm auto

* Add citation

* Add contour expand

* c++ linting

* Add unit tests with Tensor

* rm model.pth

* rename

* c++ linting

* c++ linting

* Rename variables
2021-05-12 10:41:22 +08:00
Ziyi Wu c77e95a65f
[Enhance] Add step momentum updater to support MMDet3D (#1011)
* add StepMomentumUpdaterHook

* add unit test

* fix typos

* refactor step updater

* replace stage with exp

* fix linting error

* use all() operation
2021-05-11 20:06:04 +08:00
gengenkai 1a5bf76237
[Enhancement] LR triangular (#1001)
* [Fix] lr add triangular

* [Fix] lr_triangular

* lr add docstring

* lr add docstring

* add unittest of triangular lr update
2021-05-11 13:25:43 +08:00
lizz f61295d944
Add test util for checking stand-alone python scripts (#1007)
* Add test util for checking stand-alone scripts

Signed-off-by: lizz <lizz@sensetime.com>

* Restrict to python scripts

Signed-off-by: lizz <lizz@sensetime.com>

* fix

Signed-off-by: lizz <lizz@sensetime.com>

* tiny

Signed-off-by: lizz <lizz@sensetime.com>

* Allow no capture

Signed-off-by: lizz <lizz@sensetime.com>

* Simplify interface

Signed-off-by: lizz <lizz@sensetime.com>

* Technical notes

Signed-off-by: lizz <lizz@sensetime.com>

* tiny

Signed-off-by: lizz <lizz@sensetime.com>

* Update hello.py

* Update test_testing.py

* Update test_testing.py
2021-05-10 22:15:35 +08:00
v-qjqs 934b549e23
Support custom operators cummax and cummin for onnxruntime (#1010)
* support custom op `mmcv::cummax` for onnxruntime in mmcv

* fix clang-format lint error

* support mmcv::cummin, reformat codes

* fix merge from master

* add docs for mmcv::cummax and mmcv::cummin

* format doc

* add assertion for torch version, when exporting `cummax` to onnx

* add more comments for torch version

* handle exporting to onnx in `soft_nms`

* commit for test_onnx

* remove `is_in_onnx_export` in softnms

* add more comments

* fix c++ lint error

* add known issues doc for `cummax`

* fix known issues doc
2021-05-10 21:33:27 +08:00
v-qjqs db6b0542c7
[Feature]: Support corner_pool related custom operators for onnxruntime in mmcv (#997)
* supports for onnxruntime custom op `mmcv::MMCVTopPool`

* supports for onnxruntime custom op `mmcv::MMCVCornerPool`, involving TopPool, BottomPool, LeftPool and RightPool

* add unittest for corner_pool

* supports mmcv::CornerPool without memcpy

* add docs for mmcv::CornerPool

* re-add docs for mmcv::CornerPool

* fix output dtype doc

* reformat

* format with pre-commit

* format

* fix lint error, by using google clang-format style for c/c++
2021-05-01 16:28:25 +08:00
Ziyi Wu 04346fc7d0
[Feature] Support clipping min_lr in StepLrUpdaterHook to help MMDet3D (#995)
* support clipping min_lr in StepLrUpdaterHook

* add docstring for StepLrUpdaterHook

* fix small bugs

* add unit test for StepLrUpdaterHook

* fix linting error
2021-04-27 20:53:29 +08:00
Wang Xiaolin 0fc19b4692
[Feature]: parrots add parrots/fused_bias & upfirdn2d (#989) 2021-04-27 13:49:50 +08:00
Rui Xu 0be0410443
[Bug] fix raise error bug in registering multiple names (#949)
* fix raise error bug in registering multiple names

* fix bug in checking the type of name

* fix lint

* fix unit test for registry

* fix bug in unit test
2021-04-25 21:47:50 +08:00
ZhangShilong 54a7ebb4ec
[Feature]: support Multi-Scale-DeformAttention in deformable-detr (#878)
* add c++ ms_deform_atten

* fix cpp lint

* fix cpp lint

* clang format

* remove cmakefile

* google style

* clang-format precommit

* use clang-format-lint-action

* add transformer base class

* add merge

* add docstr

* add pyargs

* fix according to commments

* resiger module

* change to use basemodule

* add _ between build function

* split the name

* fix according to comments

* fix lint and fix unitest

* fix cpp lint

* fix bug of deformdetr_atten

* fix drop out

* fix residual

* use CUDA_1D_KERNEL_LOOP
2021-04-23 16:35:15 +08:00
Miao Zheng a76416393c
[Fix] Rename init_weight to init_weights (#971)
* [Fix] Rename init_weight to init_weights

* warning msg
2021-04-20 14:49:42 +08:00
Wang Xinjiang ee041cec6a
[Feature]: Add Rotated ROI align op for pytorch (cpu&cuda), parrots (cpu&cuda) and onnxruntime (cpu) (#933)
* add roi_align_rotated

* code format

* Add align key to roi align rotated

* Add clockwise for rotated roi align

* fix bugs in onnx export

* Add docstring for RoIAlignRotated

* remove cuda unittest

* Reformat c++ code

* add onnx roi align rotated file

* fix unittest

* Add  cpu and float64 of cuda support for parrots

* code format

* Add unified header to roi align rotated

Co-authored-by: luopeichao <luopeichao@sensetime.com>
2021-04-19 15:04:01 +08:00
Miao Zheng 79f8cbd661
[Bug] Fix DeformConv2d bias error and add tests (#940)
* [Bug] Fix DeformConv2d bias error and add tests

* fix repr

* revise tests

* lint
2021-04-12 20:31:34 +08:00
Miao Zheng 2fadb1a5ec
[Fix] Revise override in init_cfg (#930)
* [Fix] Config deep copy in initialize_override

* add asserts&comments

* add test

* test org init_cfg

* test override without name

* typo
2021-04-12 14:05:28 +08:00
Jerry Jiarui XU 375605fba8
add model registry (#760)
* add model registry

* fixed infer scoep

* fixed build func

* add docstring

* add md

* support multi level

* clean comments

* add docs

* fixed parent

* add more doc

* add value error, add docstring

* fixed docs

* change to local/global search

* resolve comments

* fixed test

* update some docstring

* update docs (minior)

* update docs

* update docs
2021-04-10 21:33:34 +08:00
Miao Zheng 47825b194e
[Refactoring] Revise init_weight in BaseModule (#905)
* [Refactoring] Add deprecated API warning

* revise test

* fix lint

* fix lint
2021-04-10 21:20:53 +08:00
Miao Zheng 89efc607ef
[Fix] OneCycleLrUpdaterHook adds total_steps (#929)
* [Fix] OneCycleLrUpdaterHook interface

* revise according to comments

* revise according to comments

* add test

* fix lint

* revise according to comments

* minors

* add pytest param

* fix lint

* ci
2021-04-10 21:19:45 +08:00
QingChuanWS b5e1facc85
[Refactor]: Remove deprecated onnx-simplify source code (#927)
* remove custom simplify model

* update docs about onnx-simplify
2021-04-09 16:17:11 +08:00
zhouzaida d525cfde10
[Fix] Fix bug of lr updater hook (#907)
* [Fix] fix bug of lr update hook

* [Fix] fix bug of lr update hook

* [Fix] Fix bug of lr updater hook
2021-04-09 10:13:32 +08:00
Jintao Lin be6541d480
[Feature] Add EvalHook which will be used in downstream projects (#739)
* add EvalHook

* add EvalHook

* refactor docstring

* polish

* use cp instead symlink

* add error info

* Update eval.py

* Update eval.py

* update

* add engine depandancy

* add comments

* fix unittest

* fix

* update unittest

* update unittest

* add docstring

* fix docstring
2021-04-08 16:42:30 +08:00
tangyanf 83cf25b284
[feature]:add onnxruntime custom op grid_sample (#916)
* add onnxruntime custom op grid_sample

* update code

* update code

* update code

* update code

* update code

* update code

* update code

* update code

* update code

* update code

* update code

* update code

* update code

* update code
2021-04-06 18:31:24 +08:00
zhouzaida f0c43fdc32
[Feature] Add OneCycleLrUpdaterHook (#906)
* [Feature] Add OneCycleLrUpdaterHook

* fix docstring

* fix docstring

* Remove redundant code
2021-04-02 09:44:18 +08:00
q.yao 9d80f56ae8
[Feature] : Add grid_sampler TensorRT Plugin (#865)
* add grid sample trt support

* fix align_corners=True

* change 'intep' to 'interp', fix bugs of grid sampler, better test script

* remove unused import

* move source comment to the top of trt_grid_sampler_kernel.cu
2021-03-31 00:28:08 +08:00
LXXXXR 8647b9a1b1
[Feature] Add cutout and lighting (#909)
* add cutout

* add adjust_lighting

* minor fix
2021-03-26 18:58:19 +08:00
Miao Zheng 65fec73509
[Refactoring] Revise function of layers and override keys in init_cfg (#893)
* [Refactoring]Approve init_cfg

* revise unit test

* revise according to comments

* add comment for wholemodule
2021-03-26 16:57:59 +08:00
Miao Zheng 5f5e8e83c2
[Refactoring] Add Caffe2Xavier Initializer (#902)
* [Refactoring] Add Caffe2Xavier Initializer

* fix lint
2021-03-24 13:25:36 +08:00
Rui Xu 933b052d95
[Feature] Add cuda ops: UpFirDn2d and fused_bias_leakyrelu (#900)
* add upfirdn2d op

* fix bug in pybind

* add fused bias leakyrelu

* fix bug in fused-bias-leakyrelu

* fix lint error

* fix bug in build cpu version

* fix bug in build cpu version

* fix lint

* fix comment from zww

Co-authored-by: zhangshilong <zhangshilong@sensetime.com>
2021-03-21 21:23:09 +08:00
ZhangShilong 371a21728f
fix bug of convmodule (#889)
* fix bug of convmodule

* fix bug of convmodule

* fix unitest

* remove assert
2021-03-20 23:08:20 +08:00
zhouzaida 97730c2316
[Feature] support to calculate FLOPs of GN, IN, LN (#897)
* [Feature] support to calculate FLOPs of GN, IN, LN

* Update flops_counter.py

* Update flops_counter.py
2021-03-19 14:04:49 +08:00
Miao Zheng 967d9d5812
[Refactoring]Add Sequential with init_weight (#884)
* [Refactoring]Add BaseSequtial with init_weight

* revise according to comments

* revise comments

* minors

* baseseq2seq

* add modulelist

* revise minors

* fix isort

* format
2021-03-17 15:45:28 +08:00
sshuair 73bff4ead1
add tifffile backend support for image io (#868)
* add tifffile backend support for imageio

* add tifffile package for test requirements

* add tifffile package for test requirements

* small tiffile
2021-03-12 10:28:30 +08:00
q.yao 9ba1f76005
[Feature] : Add Deformable Conv2d TensorRT Plugin (#858)
* add dcn tensorrt plugin

* prepare for fp16 support

* fix for lint

* limit column buffer

* add docstring to memcpyPermute
2021-03-11 15:41:47 +08:00
LXXXXR a4bb2c5b04
[Feature] Support auto contrast (#881)
* support auto contrast

* add comments

* Fix unittest for pillow 6.2.2

* revised according to comments
2021-03-09 18:46:35 +08:00
RunningLeon 3dd98daaa2
fix test unit of nms and batched_nms for tensorrt (#872) 2021-03-08 16:57:19 +08:00
LXXXXR ce10425d2f
[Feature] Add adjust sharpness (#864)
* add adjust sharpness

* revised according to commnts

* fix bug

* fix docstring

* revise according to comments

* fix blank lines

* revised according to comments
2021-03-08 10:23:49 +08:00
LXXXXR 27e9ede5b9
[Fix]: fix bugs in some photometric transforms (#863) 2021-03-03 18:58:15 +08:00
sshuair 6719cde43a
add HTTP backend (#860)
* add HTTP backend

* add HTTPbackend

* fix linting

* fix linting

* add docs attributes http

* fix format

* add real http link test for http backend
2021-03-03 16:23:04 +08:00
Ycr e076c8b042
[Feature] Support revise_keys in load_checkpoint(). (#829)
* Simplified the code.

* Improved chkpt compatibility.

* One may modify the checkpoint via adding keywords.

* Tiny.

* Following reviewer's suggestion.

* Added unit_test.

* Fixed.

* Modify the state_dict  with  construction.

* Added test.

* Modified。

* Mimimalised the modification.

* Added the docstring.

* Format.

* Improved.

* Tiny.

* Temp file.

* Added assertion.

* Doc string.

* Fixed.
2021-03-03 10:59:11 +08:00