* 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>
* 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>
* 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()'
* 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
* 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
* 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++
* support clipping min_lr in StepLrUpdaterHook
* add docstring for StepLrUpdaterHook
* fix small bugs
* add unit test for StepLrUpdaterHook
* fix linting error
* 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
* 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
* 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>
* [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
* 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
* 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>
* add adjust sharpness
* revised according to commnts
* fix bug
* fix docstring
* revise according to comments
* fix blank lines
* revised according to comments
* delete all parrots file
add bbox_overlaps new parrots op impl
* support first new impl parrts op (bbox_overlaps)(success test)
* add box_iou_rotated op, test succeed
* add carafe and carafe_naive op, test succeed (one parrots bug need fix)
* add cc_attention op, test success
* add corner_pool op, test success
* add parrots op deform_conv, test success
* add deform_roi_pool op, test success (but has question)
* add focal loss op, test success (gradcheck)
* add masked_conv2d op, test success
* add modulated_deform_conv op, test success
* add nms and nms_rotated op, test success
* add psamask op, test success
* add roi_align op, test_success
* add roi_pool op, test success
* add sync_bn op, test success
* add tin_shift op, test success
* fix test_deform_roi_pool, add parrots test
* skip test_onnx because parrots does not support onnx
* fix c++ lint
* fix python lint
* fix python lint
* Fix the iter error when the number of GPUs is different during resume
* Add fromstring and unit test
* Remove is_pretty_text
* Fix comment
* Add log info
* Add py format check
* Remove SyntaxError check
* start trt plugin prototype
* Add test module, modify roialign convertor
* finish roi_align trt plugin
* fix conflict of RoiAlign and MMCVRoiAlign
* fix for lint
* fix test tensorrt module
* test_tensorrt move import to test func
* add except error type
* add tensorrt to setup.cfg
* code format with yapf
* fix for clang-format
* move tensorrt_utils to mmcv/tensorrt, add comments, better test module
* fix line endings, docformatter
* isort init, remove trailing whitespace
* add except type
* fix setup.py
* put import extension inside trt setup
* change c++ guard, update pytest script, better setup, etc
* sort import with isort
* sort import with isort
* move init of plugin lib to init_plugins.py
* add scatternd, nms plugin (WIP)
* fix bugs of trt_nms
* add trt nms test module
* fix bugs of scatternd
* code optimize, add comment about nms kernel
* fix transform_if bug of trt_nms_kernel
* fix struct name
* default nms offset=0, fix bugs of batched input
* format with clang-format
* onnx preprocess
* much better nms implementation, no need to transfer memory between host and device
* update preprocess_onnx
* parse constant tensor from initializer in preprocess_onnx
* update nms
* remove unnecessary codes
* workspace aligned address
* format trt_plugin_helper.hpp
* fix index memory bugs
* set alignment to 16 by default
* fix lint
* fix nms offset
* fix bugs of preprocess onnx
* update test for nms
* tensorrt only accept int32, not int64
* update nms comments
* fix indexing for scores in nms
* update trt temp
* make trt-nms compatiable to #803
* fix lint
* add docstring to trt_nms_kernel.cuda, add description to preprocess_onnx
* add comment to score indexing
* fix bugs of max output boxes
Co-authored-by: maningsheng <maningsheng@sensetime.com>
* add initializers and BaseModule for unified parameter initialization
* fix circle import
* bug fix
* add is_init flag in BaseModule
* fix docstring
* sort import and fix doc format
* fix bug
* fix docformat and double quote string
* fix import sort
* import sort
* sort import
* revise according to comments
* fix doc format
* revise according to comments
* revise import and fix typo
* polish code
* revise minors
* revice minors
* revise apply function
* revise bias initialization with probability
* add type test for bias_prob
* revise minors
* Refactor _load_checkpoint fn
* Update _load_checkpoint fn
* Update docs str and add unit test
* Fix unit test
* Fix lint
* Add comment and Optimize function
* Fix docs str
* Update load_ckpt and fix doc str
* Update doc str and add sort unit test
* Update and fix unit test
* Fix unit test
* Update and add unit test
* Fix openmmlab prefix error
* add scatter plugin
* fix bugs of scatternd
* add trt scatternd plugin
* format code with clang-format
* add test for scatternd
* skip test_tensorrt in CI
* remove unused variable
Co-authored-by: maningsheng <maningsheng@sensetime.com>
* add testing function
add unittest for check_dict
add unittest for the function in testing
* polish docstring of testing.py
rename some function
* remove in is_all_zeros
* modify the comment of check_dict
* modify the testing.py according to feedback
* add test about numpy for function dict_contains_subset
* applying unified style
* allow register multi-name for a module simultaneously
* add assertion for name type
* use isintance intead of is_str
* fix bug in unit test
* fix unit test
* start trt plugin prototype
* Add test module, modify roialign convertor
* finish roi_align trt plugin
* fix conflict of RoiAlign and MMCVRoiAlign
* fix for lint
* fix test tensorrt module
* test_tensorrt move import to test func
* add except error type
* add tensorrt to setup.cfg
* code format with yapf
* fix for clang-format
* move tensorrt_utils to mmcv/tensorrt, add comments, better test module
* fix line endings, docformatter
* isort init, remove trailing whitespace
* add except type
* fix setup.py
* put import extension inside trt setup
* change c++ guard, update pytest script, better setup, etc
* sort import with isort
* sort import with isort
* move init of plugin lib to init_plugins.py
* resolve format and add test dependency: tensorrt
* tensorrt should be installed from source not from pypi
* update naming style and input check
* resolve lint error
Co-authored-by: maningsheng <maningsheng@sensetime.com>
* [Enhance]: add onxx simplify
* add simple doc
* add unit test
* update docstring
* resolve some comment
* add test dependency:onnxoptimizer
* Fix onnxruntime register empty libpath
* test onnxruntime version
* set checker to false
* skip test_simplify for torch<1.5.0
* add onnx support to roi_align and roi_pool
* add softnms ort support
* fix for lint
* format cpp code with clang-format:google
* add new empty line to the end of head files in onnxruntime
* update to pytorch1.7
* add test of softnms to onnxruntime
* fix for lint
* remote print in ops/info.py
* change import order, fix for flake8
* fix include
* add assert torch>=1.7.0
* [doc]: add document for onnxruntime custom operator
* update onnxruntime version to v1.5.1 for softnms
* remove doc menu
* Resolve lint for markdown
* resolve naming style in onnxruntime_op.md
* Use old cpp apis, optimize test_onnx.py
* Fixing strings in tests/test_ops/test_onnx.py
* code format with yapf
* fix soft_nms parrot
* add import in onnxruntime setup, avoid conflict
* fix doc and add assert
* change cpp guard
Co-authored-by: maningsheng <maningsheng@sensetime.com>
* Allow to replace nested tuple and list via options
* Add comments
* Fix single nested items
* Simplify the code
* Simplify the code
* Simplify the code
* Simplify the code
* Update docstring
* Update docstring
* Support quotation mark
* modify docstring
* add jit decorator
* add parrots_jit.py
* modify test_parrots_jit.py
* modify for lint
* fix isort
* skip test_parrots_jit.py when build without pytorch
* try ci
* rm log
* fix double quote
* modify for comments and use partial_shape instead of full_shape
* fix for lint
* small modify for parrots 0.9.0rc0
* def skip no elena directly
* add clamp without unittest
* add clamp-act with unit test
* fix name bug
* use logical and
* fix logical_and
* fix linting
* rename ClampLayer to Clamp
* rename ClampLayer to Clamp
Co-authored-by: nbei <631557085@qq.com>
* Update lr_updater.py
since epoch/iteration in runner starts with 0, we shouldn't leave the latter iteration to former (12th epoch for example, with first period equal to 12) period.
* Update lr_updater.py
* Update test_hooks.py
* add unittest for onnx convert
* build onnx and onnxruntime in CI
* skip onnx op unit test while using CUDA
* fix offset==0 case in NMS
* remove tmp file used in test
* delete tmp file before assert so that we can remove the tmp file anyway
* import_modules_from_strings when loading cfg from file
* add unittest to tell whether the feature is enabled as expected
* minor
* set an environment variable instead of writing a file
* use 'shutil' instead of 'os.system'
* add version check in wrappers
* fix assersion
* use digital version for version comparison
* fix unit tests
* reformat
* fall back to compare the first two version
* fix unittest
* fix unittest
* fix unit test
* clean unnecessary change
* Support to specify LR of DCN's conv_offset
* Resolve comments & add unit test
* Resolve formats
* Fix CI for DCN
* Mock DCN when cpu only
* Use mock for cpu testing
* Fix docstring and support ModulatedDCN
* set offset_lr_mult as dcn's arguments, link CU-49u01p
* fix lr bug
* fall back to set LR in constructor
* resolve comments
* Add build_runner
* Parametrize test_runner
* Add imports to runner __init__
* Refactor max_iters and max_epochs from run to init
* Add assertion error messages
* Add test_builder
* Make change retro-compatible
* Raise ValueError if max_epochs and max_iters
* Add test case for type defined using default_args
* Refactor build_from_cfg
* Update exception of missing type
* pre-commit
* Fix default_args is None
* pre-commit
* Bring back test
* Update exception raising
* add brightness and contrast augmentation
* remove unnecessary
* reformat
* relax the precision constrain for adjust_brightness aug
* fix percision assertion error in unit test
* remove toy
* rename alpha as factor
* use np.testing.assert_allclose in place of np.less_equal
* Mv wrappers into bricks and use wrappers in registry
* resolve import issues
* fix import issues
* set nn op forward to torch 1.6.1
* fix CI bug and add warning
* Fix CI by using patch mock
* mv warnings inside deprecated module's initialization
* add equalize augmentation in mmcv
* delete unnecessary
* reformat
* remove clip in implementing equalize, and add uint test with case step=0
* remove clip in implementing equalize, and add uint test with case step=0
* add comments for unit test
* rename function name as imequalize
* add Color augmentation
* reformat
* reformat
* reformat docstring
* reformat docstring
* add more unit test
* add more unit test
* add clip value and uint test for image with type float
* rename function name
* Support to split batched_nms when box number is too large
* mv data from gpu to cpu
* Set split_thr through nms_cfg
* clean code
* Update motivation in docstring
* fix typos
* add ema hook
* add ema hook resume
* add ema hook test
* fix typo
* fix according to comment
* delete logger
* fix according to comment
* fix unitest
* fix typo
* fix according to comment
* change to resume_from
* typo
* fix isort
* add pairwise function for 'gaussian' and 'concatenation' mode
* rename test function
* decrease the complexity of nonlocal unittest
* fix typo and make unittest more complete
* add unittest when zero_init is False
* minor fix
* pack theta and phi
Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
* fix: remove all module wrapper when saving checkpoint
* refactor: move position of if
* docs: add docstring
* refactor: add _save_to_state_dict from official torch
* docs: modify docstring of _save_to_state_dict
* docs: modify docstring
* feat: add unittest
* feat: add DataParallel to unittest
* fix: a bug when model has batchnorm
* docs: update docstring
* update config with predefined variables
* rm redun
Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
* add test for config
Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
* support all types
Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
* newline at the end
Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
* update
Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
* extract code into a function and add docs
Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
* fix and add tests
Signed-off-by: lixuanyi <lixuanyi@sensetime.com>
* add unit tests and fix
* fix
* fix minor
* fix test
* migrate op
* migrate unittest
* update build no torch
* add back use_torch_vision for roi align
* fix type and unit test
* ignore test logging when no torch
* fix no torch ci test
* skip test registry
* remove coverage report when no torch
* fix mac ci order
* install latest pillow when no torch
* mv convws to brisk