Commit Graph

39 Commits (db6b0542c7ca13edcbad0bb90687bf680a685844)

Author SHA1 Message Date
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
Wang Xiaolin 0fc19b4692
[Feature]: parrots add parrots/fused_bias & upfirdn2d (#989) 2021-04-27 13:49: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
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
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
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
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
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
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
RunningLeon 3dd98daaa2
fix test unit of nms and batched_nms for tensorrt (#872) 2021-03-08 16:57:19 +08:00
z55250825 48d9902585
Add new parrots extension implementation for all ops (#794)
* 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
2021-02-26 19:05:25 +08:00
RunningLeon 72e4cc12bd
Fix pytorch2onnx failed for interpolate op with PyTorch==1.6.0(mmdet#4646) (#848)
* Fix pytorch2onnx for yolov3 with torch==1.6.0

* update and add test for F.interpolate

* add test_onnx.py with build_cuda
2021-02-26 10:49:12 +08:00
q.yao 1ee5315ea2
[Feature] : Add NonMaxSuppression TensorRT Plugin (#787)
* 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>
2021-02-23 15:09:49 +08:00
tangyanf be2616a0e2
add ort nms op (#803)
* add ort nms op

* fit lint check

* fix lint check

* update code

* fix lint check

* update code

* update code

* update code

* update code

* update code

* update code
2021-02-04 15:45:09 +08:00
q.yao 2ab544fc29
[Feature] : Add ScatterND TensorRT Plugin (#786)
* 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>
2021-01-20 11:15:07 +08:00
RunningLeon 477f0c0a39
[Fix]: Set installation of onnx simplify's related packages to optional (#779)
* Fix onnx, onnxruntime, onnxoptimizer import

* Revert "Fix onnx, onnxruntime, onnxoptimizer import"

This reverts commit 820e3785a1.

* remove simplify from init file

* update test for onnx simplify

* update onnx doc
2021-01-08 13:15:37 +08:00
q.yao 0de9e149c0
[Feature]: Add custom operators support for TensorRT in mmcv (#686)
* 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>
2021-01-06 11:05:19 +08:00
RunningLeon 83732ec2e3
[Feature] add onnx simplify (#751)
* [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
2020-12-31 19:16:48 +08:00
tangyanf 741e52dd5e
[Feature]: add custom op roialign for onnxruntime (#724)
* add ort custom op roialign

* Update roi_align.py

* Update test_onnx.py

* Update test_onnx.py

* Update test_onnx.py

* Update test_onnx.py

* Update onnxruntime_register.cpp

* Update roiAlign.h

* Update roiAlign.cpp

* lint modification

* update roiAlign.cpp

* lint check

* lint check

* lint fix

* lint fix

* fix lint

* add link to commit

Co-authored-by: maningsheng <maningsheng@sensetime.com>
2020-12-29 14:09:30 +08:00
BigBigDream 86c9ac2cb9
add 'iof' mode for box_iou_rotated (#753)
* add iof mode for box_iou_rotated

* update doc

* fix lint

* fix lint

* fix lint

* fix lint

* fix lint
2020-12-25 17:06:45 +08:00
q.yao 94810f2297
[Feature]: Add custom operators support for onnxruntime in mmcv (#612)
* 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>
2020-12-23 11:03:55 +08:00
WRH f0e68404d2
Fix some bug as well as unit test for nms_rotate (#728)
* add const to nms_rorate in pybind

* fix test nms rotated

* skip test instead of passing it

* fix lint

* update pytest skip syntax
2020-12-18 15:17:11 +08:00
BigBigDream 508a322fba
Support aligned mode for box_iou_rotated (#677)
* support aligned and parrots cpu for  box_iou_roatetd

* add aligned doc

* fix lint

* fix lint

* fix lint

* fix lint

* fix bug

* fix bug

* fix bug

* fix lint

* fix lint

* fix bug

* fix bug
2020-12-16 11:49:44 +08:00
BigBigDream 02920db2cc
fix roi_align ci for parrots (#708)
* fix roi_align ci for parrots

* fix lint
2020-12-13 20:01:25 +08:00
BigBigDream a978764883
Add box_iou_rotated, ml_nms_rotated and nms_rotated (#625)
* add box_iou_rotated, ml_nms_rotated and nms_rotated

* fix lint

* fix lint

* fix .py lint

* fix cpp lint

* add newline at the end

* add new line

* fix unittest

* config google style

* fix lint

* lint

* lint

* yapf

* update

* fix lint

* fix lint

* fix lint

* fix

* fix format

* fix format

* add modified from

* add docstring and update others

* update docstring

* update docstring

* update

* fix bug

* fix bug

* fix bug

Co-authored-by: Cao Yuhang <yhcao6@gmail.com>
2020-11-25 11:00:30 +08:00
q.yao c390e327fa
add onnx support to roi_align and roi_pool (#593)
* add onnx support to roi_align and roi_pool

* add test on roi_align and roi_pool

* fix conflict with master
2020-11-14 19:56:35 +08:00
Kai Chen 03214fd446
Support pytorch 1.7 and update the CI (#631)
* support pytorch 1.7 and update the CI

* fix CI

* fix onnxruntime version in macos
2020-10-31 17:58:15 +08:00
Ruohui Wang 761f725b70
Misc updates regarding Windows and unittests (#586)
* SKIP bbox test without CUDA

* use full filepath for creating latest.pth
2020-10-28 16:23:19 +08:00
robin Han 23b2bdbf52
add unittest for onnx convert (#608)
* 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
2020-10-26 11:33:35 +08:00
Wenwei Zhang c937d3953d
Mv wrappers into bricks and use wrappers in registry (#550)
* 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
2020-09-12 21:59:17 +08:00
Wenwei Zhang f4a5446e15
Support to split batched_nms when box number is too large (#516)
* 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
2020-08-24 00:32:39 +08:00
Cao Yuhang 7b18b97791
fix saconv (#489)
* fix saconv

* add parrots condition

* add unittest

* fix torch version
2020-08-16 01:45:01 +08:00
Jintao Lin c8e85b28e4
Add `tin_shift` function (#492)
* add tin shift

* add unittest

* add docstring

* add docstring

* parrots for tin_shift

* fix lint

* fix lint

Co-authored-by: jiaomenglei <jiaomenglei@sensetime.com>
2020-08-15 22:29:07 +08:00
Yuanhao Zhu 51c65c97ec
fix syncbn parameter order mismatch and parrots bug (#488) 2020-08-13 19:27:05 +08:00
Jintao Lin 9de04d2284
Replace `re` with `regex` (#457)
* replace `re` with `regex`

* add regex in requirements

* use regex on windows and re on linux

* update requirements.txt
2020-08-03 11:45:50 +08:00
Cao Yuhang d5cbf7eed1
Migrate op (#392)
* 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
2020-07-08 17:29:15 +08:00
Jerry Jiarui XU 0970ae94c2
Add cpu ops (#370)
* update actiion

* remove 1.3 cuda

* reorder

* add no torch

* fixed version

* make py3.8 on pt1.5

* make py3.8 on pt1.5

* remove torch 1.3

* disable py3.8

* pip

* merge master with cuda compile fix

* add cpu roi align

* fixed test

* fixed no torch

* add CUDA_ARGS

* use one line

* gencode=61

* seperate jobs

* update lint

* use parametrize test

* formart and rename

* unit test for all
2020-06-30 12:09:48 +08:00
zhuyuanhao c0f5492ee9
add ext ops, support parrots (#310)
* add ext ops, support parrots

* fix lint

* fix lint

* update op from mmdetection

* support non-pytorch env

* fix import bug

* test not import mmcv.op

* rename mmcv.op to mmcv.ops

* fix compile warning

* 1. fix syncbn warning in pytorch 1.5
2. support only cpu compile
3. add point_sample from mmdet

* fix text bug

* update docstrings

* fix line endings

* minor updates

* remove non_local from ops

* bug fix for nonlocal2d

* rename ops_ext to _ext and _ext to _flow_warp_ext

* update the doc

* try clang-format github action

* fix github action

* add ops to api.rst

* fix cpp format

* fix clang format issues

* remove .clang-format

Co-authored-by: Kai Chen <chenkaidev@gmail.com>
2020-06-28 23:15:47 +08:00