Commit Graph

146 Commits (d77aeaa480a5dbcc8c4c0b119e1deac6f7d628b0)

Author SHA1 Message Date
Li Zhang d77aeaa480
[Refactor] Decouple preprocess operation and transformation (#1353)
* refactor SDK registry

* fix lint

* decouple transform logic and operations

* data management

* improve data management

* improve data management

* context management

* fix ResizeOCR

* fix operation fallback logic

* fix MSVC build

* clean-up

* sync master

* fix lint

* Normalize - add `to_float`, merge `cvtcolor` operations

* fix macOS build

* rename

* cleanup

* fix lint

* fix macOS build

* fix MSVC build

* support elena

* fix

* fix

* optimize normalize

* fix

* fix MSVC build

* simplify

* profiler

* use `throw_exception`

* misc

* fix typo
2022-11-28 14:46:05 +08:00
Chen Xin 3d1c135297
[Enhancement] refactor profiler (#1403)
* reduce profile node name

* add profiler for pipeline

* add profiler for cond

* udpate
2022-11-28 10:44:54 +08:00
Li Zhang 6468ef180d
[Fix] Relax module adapter template constraints (#1366)
* relax module adapter constraint

* remove forwarding `operator()`
2022-11-27 11:58:09 +08:00
Li Zhang 4d4c10a2dc
[Enhancement] Avoid copying dense arrays in Python API (#1349)
* eliminate copying for segmentor

* fix segmentor

* eliminate copying in Python API

* minor fix
2022-11-24 18:23:34 +08:00
AllentDan 301035a06f
[Fix] fix cls head in SDK (#1420)
* fix cls head

* resolve comments
2022-11-24 14:15:34 +08:00
Li Zhang b5b0dcfcff
[Fix] Support onnxruntime-1.13 (#1407)
* support onnxruntime-1.13

* fix lint
2022-11-22 20:25:44 +08:00
AllentDan 4dd4d4851b
Add rv1126 yolov3 support to sdk (#1280)
* add yolov3 head to SDK

* add yolov5 head to SDK

* fix export-info and lint, add reverse check

* fix lint

* fix export info for yolo heads

* add output_names to partition_config

* fix typo

* config

* normalize config

* fix

* refactor config

* fix lint and doc

* c++ form

* resolve comments

* fix CI

* fix CI

* fix CI

* float strides anchors

* refine pipeline of rknn-int8

* config

* rename func

* refactor

* rknn wrapper dict and fix typo

* rknn wrapper output update,  mmcls use end2end type

* fix typo
2022-11-22 20:16:22 +08:00
Chen Xin cdb6b46955
Sdk profiler (#1274)
* sdk-profiler

* fix lint

* support lift

* sync net module when profile

* use Scope*

* update use task name

* fix

* use std::unique_ptr<Event>

* remove mmdeploy::graph link for c and transform

* fix

* fix

* fix
2022-11-21 12:52:21 +08:00
Li Zhang 99040d5655
[Refactor] better SDK registry (#1368)
* refactor SDK registry

* fix lint

* fix typo

* sync

* use nested namespace

* rename
2022-11-15 21:06:13 +08:00
Mingcong Han ff7b8fb176
[FIX] set stream argument when using async memcpy (#1314) 2022-11-09 13:41:41 +08:00
Li Zhang b49cf42220
[Enhancement] Avoid copying dense arrays in C API (#1261)
* reduce copying dense array in C API

* format

* fix detector

* fix MSVC build

* simplify
2022-11-07 22:01:31 +08:00
lvhan028 625593d6f3
[Feature] Support rv1126 in sdk (#1238)
* tmp

* refine

* update ssd-lite

* tmp

* tmp

* 0.1

* 0.1.1

* rename to base_dense_head

* remove debug code

* wait stream

* update cmakelists

* add some comments

* fix lint

* fix ci error

* fix according reviewer comments

* update params

* fix

* support normalize with to_float being false

* fix lint

* support rv1126 build ci

* support rv1126 build ci

* change debug level

* fix ci

* update

* update doc

* fix circleci error

* update normalize

* update

* check in build script

* change name
2022-11-07 11:13:47 +08:00
Chen Xin 940fffa075
fix some errors (#1309) 2022-11-04 22:38:28 +08:00
Chen Xin d8e6229dc5
Support mmaction master (#1183)
* cpu format shape

* convert model

* python api

* speedup dataloader

* minor

* add cpp demo

* add visualize

* fix resize param order

* export pipeline.json

* fix three crop

* read SampleFrames from model_cfg

* minor

* lint

* move to a func

* speed up format shape cpu

* use input mat device

* fix comments

* fix comments

* update docs/benchmark

* docs/supported-codebases

* update tests/data

* fix lint

* fix lint
2022-11-04 14:15:36 +08:00
Li Zhang f2be2abeb5
[Feature] Add `Cond` node and pose tracker demo (#1186)
* add Cond node

* WIP PoseTracker

* fix pose tracker

* minor fix

* simplify design

* add timing

* sync

* visualize

* remove file check
2022-10-27 14:52:04 +08:00
lvhan028 f051a31e0f
make onnxruntime(gpu) available in SDK (#1253) 2022-10-26 19:23:42 +08:00
AllentDan 3eb60ea584
[Feature] Add RKNN support to SDK (#1145)
* add rknn_net [WIP]

* add cmake

* enable mmcls

* remove toTensor in SDK pipeline

* update doc

* translate to Chinese

* update doc and add tool-chain cmake

* use ::framework

* fix lint

* doc and print log

* data map

* refine install doc

* add rknpu2 workflow

* update gcc yaml

* better cmake file

* update doc link

* use vector instead of array

* better env variable

* use soft link

* release ctx

* name rule
2022-10-18 17:52:31 +08:00
Jiahao Sun 8e634059a1
[Feat] Support Monocular 3D Detection and FCOS3D Deployment (#1047)
* add monodet task

* format monodet

* format monodet

* sort test_monocular_detection_model.py import

* add fcos3d deploy

* change doc support model & fcos3d UT

* fix test monodet UT bug & remove ONNXBEVNMS op
2022-10-18 11:23:39 +08:00
tpoisonooo ace44ae9d9
improvement(scripts): cross build aarch64 (#1126)
* udpate

* update

* CI(scripts): add auto cross build aarch64

* docs(scripts): add zh_cn doc

* docs(scripts): update

* docs(scripts): update

* fix(tools): update

* docs(zh_cn): update

* fix(scripts): remove gcc-7

* docs(scripts): update result

* udpate

* fix(tools): remove useless option

* docs(en): typo

* Update cross_build_aarch64.md

* Update cross_build_aarch64.md

* fix(tools/scripts): review advices

* fix(tools/scripts): update

* fix(cmake): remove useless option

* Update aarch64-linux-gnu.cmake
2022-10-17 11:15:29 +08:00
Li Zhang 8c164ab3e5
[Fix] Detect filesystem library in CMake (#1190)
* detect filesystem library in CMake

* add filesystem.cmake
2022-10-14 12:52:16 +08:00
Li Zhang f389a68dd4
[Enhancement] Add a device field for `mmdeploy_mat_t` (#1176)
* add device field for mmdeploy_mat_t

* fix lint
2022-10-11 13:58:49 +08:00
tpoisonooo 5cdf29339b
feat(tools/scripts): add auto install jetson orin (#1105)
* feat(tools/scripts): add auto install jetson orin

* docs(script): rename file

* fix(script): if clause error

* style(scripts): typo
2022-10-09 15:53:19 +08:00
lvhan028 613acb366c
fix prebuilt error (#1123) 2022-09-28 17:52:09 +08:00
Chen Xin 0720ed8404
fix tracer (#1107) 2022-09-27 15:24:57 +08:00
Li Zhang bf887cc8bc
[Enhancement] Refactor SDK pipeline (#938)
* unify C API naming

* fix demo and move apis/c/* -> apis/c/mmdeploy/*

* fix lint

* WIP refactor pipeline

* backward compatibility

* working pipeline demo

* add text det-recog demo

* add det-pose demo

* fix build

* fix demo

* add environment interface

* add environment to pass scheduler & model info at runtime

* update demos

* add pipeline API for Python

* fix `FromPyObject`

* fix for opencv-4.2

* environment -> context, improve pipeline

* python model interface

* fix cmake

* fix python & cmake

* context & C++ pipeline API

* minor fix

* improve API

* fix shared libs

* refresh C/Python API

* propagate context

* fix  python demo

* fix

* add namespace

* fix namespace

* fix mis-changed strings

* fix

* fix python api

* rename

* clean-up

* fix pose detector

* clean-up

* clean-up

* clean-up

* fix python API build

* fix CI

* fix lint

* fix lint

* fix lint & demo

* install pipeline.hpp

* fix MSVC shared library build

* fix sample

* fix MSVC monolithic build

* minor fix
2022-09-26 16:11:14 +08:00
q.yao 0caeaf238c
[CustomOps] TensorRT Gather Topk Ops (#1033)
* add gather topk

* add shape inference and document

* fix faster rcnn

* reshape topk

* fix
2022-09-19 13:48:26 +08:00
Li Zhang b602356181
[Fix] Add isolated option for TorchScript SDK backend (#1002)
* add option for TorchScript SDK backend

* add doc

* format
2022-09-06 12:24:07 +08:00
Chen Xin 6b01a2e649
[Feature] Add option to fuse transform. (#741)
* add collect_impl.cpp to cuda device

* add dummy compute node wich device elena

* add compiler & dynamic library loader

* add code to compile with gen code(elena)

* move folder

* fix lint

* add tracer module

* add license

* update type id

* add fuse kernel registry

* remove compilier & dynamic_library

* update fuse kernel interface

* Add elena-mmdeploy project in 3rd-party

* Fix README.md

* fix cmake file

* Support cuda device and clang format all file

* Add cudaStreamSynchronize for cudafree

* fix cudaStreamSynchronize

* rename to __tracer__

* remove unused code

* update kernel

* update extract elena script

* update gitignore

* fix ci

* Change the crop_size to crop_h and crop_w in arglist

* update Tracer

* remove cond

* avoid allocate memory

* add build.sh for elena

* remove code

* update test

* Support bilinear resize with float input

* Rename elena-mmdeploy to delete

* Introduce public submodule

* use get_ref

* update elena

* update tools

* update tools

* update fuse transform docs

* add fuse transform doc link to get_started

* fix shape in crop

* remove fuse_transform_ == true check

* remove fuse_transform_ member

* remove elena_int.h

* doesn't dump transform_static.json

* update tracer

* update CVFusion to remove compile warning

* remove mmcv version > 1.5.1 dep

* fix tests

* update docs

* add elena use option

* remove submodule of CVFusion

* update doc

* use auto

* use throw_exception(eEntryNotFound);

* update

Co-authored-by: cx <cx@ubuntu20.04>
Co-authored-by: miraclezqc <969226879@qq.com>
2022-09-05 20:29:18 +08:00
Chen Xin a0fb3be0df
support coreml (#760)
* sdk inference

* fix typo

* fix typo

* add convert things

* fix missling name

* add cls support

* add more pytorch rewriter

* add det support

* support det wip

* make Model export model_path

* fix nms

* add output back

* add docstring

* fix lint

* add coreml build action

* add zh docs

* add coreml backend check

* update ci

* update

* update

* update

* update

* update

* fix lint

* update configs

* add return value when error occured

* update docs

* update docs

* update docs

* fix lint

* udpate docs

* udpate docs

* update

Co-authored-by: grimoire <streetyao@live.com>
2022-09-05 19:55:47 +08:00
q.yao 9541be9c0b
TensorRT dot product attention ops (#949)
* add detr support

* fix softmax

* add placeholder

* add implement

* add docs and ut

* update testcase

* update docs

* update docs
2022-09-05 18:25:39 +08:00
Li Zhang 792c27b054
[Feature] Ascend backend (#747)
* add acl backend

* support dynamic batch size and dynamic image size

* add preliminary ascend backend

* support dtypes other than float

* support dynamic_dims in SDK

* fix dynamic batch size

* better error handling

* remove debug info

* [WIP] dynamic shape support

* fix static shape

* fix dynamic batch size

* add retinanet support

* fix dynamic image size

* fix dynamic image size

* fix dynamic dims

* fix dynamic dims

* simplify config files

* fix yolox support

* fix negative index

* support faster rcnn

* add seg config

* update benchmark

* fix onnx2ascend dynamic shape

* update docstring and benchmark

* add unit test, update documents

* fix wrapper

* fix ut

* fix for vit

* error handling

* context handling & multi-device support

* build with stub libraries

* add ci

* fix lint

* fix lint

* update doc ref

* fix typo

* down with `target_link_directories`

* setup python

* makedir

* fix ci

* fix ci

* remove verbose logs

* fix UBs

* export Error

* fix lint

* update checkenv

Co-authored-by: grimoire <yaoqian@sensetime.com>
2022-09-05 12:08:36 +08:00
gy77 638e33a964
add_multi_label_postprocess (#950)
* 'add_multi_label_postprocess'

* fix pre-commit

* delete partial_sort

* delete idx

* delete num_classes and num_classes_

* Fix right brackets and spelling errors in lines 19 and 20

Co-authored-by: gaoying <gaoying@xiaobaishiji.com>
2022-08-30 19:02:42 +08:00
Li Zhang 6c2dde1cf8
[Feature] TorchScript SDK backend (#890)
* WIP SDK torchscript support

* support detection task

* make torchvision optional

* force link torchvision if enabled

* support torch-1.12

* fix export & sync cuda stream

* hide internal classes

* handle error

* set `MMDEPLOY_USE_CUDA` when CUDA is enabled
2022-08-29 18:01:18 +08:00
Chen Xin c04dcd2c62
Support risc-v platform (#910)
* add ppl.nn riscv engine

* update ppl.nn riscv engine

* udpate riscv service (ncnn backend)

* update _build_wrapper for ncnn

* fix build

* fix lint

* update default uri

* update file structure & add cn doc

* remove copy input data

* update docs

* remove ncnn server

* fix docs

* update zh doc

* update toolchain

* remove unused

* update doc

* update doc

* update doc

* rename cross build dirname

* add riscv.md to build_from_source.md

* update cls model

* test ci

* test ci

* test ci

* test ci

* test ci

* update ci

* update ci
2022-08-26 13:54:40 +08:00
lvhan028 91a060fdbb
fix mmdeploy_pplnn_net build error when target device is cpu (#896) 2022-08-15 14:51:28 +08:00
Li Zhang ef56036326
fix typo (#862) 2022-08-03 18:30:04 +08:00
Chen Xin 3ecee6f376
fix mmpose python api (#852) 2022-08-03 11:44:23 +08:00
lvhan028 a15365e93f
[Enhancement] build sdk python api in standard-alone manner (#810)
* build sdk python api in standard-alone manner

* enable MMDEPLOY_BUILD_SDK_MONOLITHIC and MMDEPLOY_BUILD_EXAMPLES in prebuild config

* link mmdeploy to python target when monolithic option is on

* checkin README to describe precompiled package build procedure

* use packaging.version.parse(python_version) instead of list(python_version)

* fix according to review results

* rebase master

* rollback cmake.in and apis/python/CMakeLists.txt

* reorganize files in install/example

* let cmake detect visual studio instead of specifying 2019

* rename whl name of precompiled package

* fix according to review results
2022-08-02 10:23:48 +08:00
Li Zhang 1d3ce15e35
import algorithm from buffer (#793) 2022-08-01 22:18:12 +08:00
tpoisonooo 2968a18d80
feat(tools/deploy.py): support snpe (#789)
* fix(tools/deploy.py): support snpe

* improvement(backend/snpe): review advices

* docs(backend/snpe): update build

* docs(backend/snpe): server support specify port

* docs(backend/snpe): update path

* fix(backend/snpe): time counter missing argument

* docs(backend/snpe): add missing argument

* docs(backend/snpe): update download and using

* improvement(snpe_net.cpp): load model with modeldata
2022-08-01 11:08:55 +08:00
Li Zhang f54854ec1c
[Feature] Add C++ API for SDK (#831)
* add C++ API

* unify result type & add examples

* minor fix

* install cxx API headers

* fix Mat, add more examples

* fix monolithic build & fix lint

* install examples correctly

* fix lint
2022-07-29 14:36:25 +08:00
tpoisonooo f54da4e73f
improvement(sdk): add sdk code coverage (#808)
* feat(doc): add CI

* CI(sdk): add sdk coverage

* style(test): code format

* fix(CI): update coverage.info path

* improvement(CI): use internal image

* improvement(CI): push coverage info once
2022-07-29 13:57:54 +08:00
lvhan028 2c18fbd2c8
[Enhancement] support kwargs in SDK python bindings (#794)
* support-kwargs

* make '__call__' as single image inference and add 'batch' API to deal with batch images inference

* fix linting error and typo

* fix lint
2022-07-29 12:32:42 +08:00
Chen Xin b6b22a1b6f
[Feature] support build single sdk library (#806)
* build single lib for c api

* update csharp doc & project

* update test build

* fix test build

* fix
2022-07-28 14:07:48 +08:00
q.yao b763611cad
[Fix] Fix setup on non-linux-x64 (#811)
* fix setup

* replace long to int64_t
2022-07-27 20:33:52 +08:00
Li Zhang bfd46c1c68
[Fix] Support macOS build (#762)
* fix macOS build

* fix missing
2022-07-26 21:54:49 +08:00
q.yao 0e1a3aa8c7
[Feature] support MMRotate model with le135 (#788)
* support MMRotate model with le135

* cse before fuse select assign

* remove unused import
2022-07-25 16:01:05 +08:00
q.yao 5b31d7a60d
[Enhancement] Install Optimizer by setuptools (#690)
* Add fuse select assign pass

* move code to csrc

* add config flag

* Add fuse select assign pass

* Add CSE for ONNX

* remove useless code

* Install optimizer by setup tools

* fix comment
2022-07-25 13:04:27 +08:00
Li Zhang ab07c223da
[Enhancement] Support latest ppl.nn & ppl.cv (#564)
* support latest ppl.nn

* fix pplnn for model convertor

* fix lint

* update memory policy

* import algo from buffer

* update ppl.cv

* use `ppl.cv==0.7.0`

* document supported ppl.nn version

* skip pplnn dependency when building shared libs
2022-07-21 11:47:53 +08:00
Li Zhang c20bb803db
[Fix] reduce log verbosity & improve error reporting (#755)
* reduce log verbosity & improve error reporting

* improve error reporting
2022-07-20 22:43:15 +08:00