Commit Graph

29 Commits (49d891754bce9a9b4afaf54290b8af64d44329fc)

Author SHA1 Message Date
Zaida Zhou b6a7fd98e4
Upgrade pre commit hooks (#2321)
* Upgrade the versions of pre-commit hooks

* update the versions of zh-cn.yaml
2022-10-08 11:48:44 +08:00
xcnick 4558bfbd5b
[Fix] Fix onnx unit tests (#2155) 2022-07-29 19:23:29 +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
pc e70a318ae9
[Fix] Fix parrots unit tests (#1913) 2022-05-09 16:59:32 +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
q.yao 6289b6f922
[Fix] Fix rocm support (#1704) 2022-03-21 15:24:22 +08:00
Zaida Zhou 6e9ce18323
Add copyright pre-commit-hook (#1742)
* first commit

* Add copyright pre-commit-hook
2022-02-24 09:24:25 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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