Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAVA Detector API #287

Closed

Conversation

hanrui1sensetime
Copy link
Collaborator

@hanrui1sensetime hanrui1sensetime commented Mar 29, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Add JNI JAVA api for ncnn android demo.

Modification

Add JAVA detector api.

  • Add JAVA detector api
  • Use new api to test the apk.

BC-breaking (Optional)

None.

Use cases (Optional)

Call the java api for the apk development.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@codecov
Copy link

codecov bot commented Mar 29, 2022

Codecov Report

Merging #287 (9e12b74) into dev-v0.5.0 (2265217) will increase coverage by 0.48%.
The diff coverage is 68.42%.

❗ Current head 9e12b74 differs from pull request most recent head f05a82c. Consider uploading reports for the commit f05a82c to get more accurate results

@@              Coverage Diff               @@
##           dev-v0.5.0     #287      +/-   ##
==============================================
+ Coverage       62.62%   63.11%   +0.48%     
==============================================
  Files             219      212       -7     
  Lines            7291     7170     -121     
  Branches         1120     1108      -12     
==============================================
- Hits             4566     4525      -41     
+ Misses           2402     2322      -80     
  Partials          323      323              
Flag Coverage Δ
unittests 63.11% <68.42%> (+0.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdeploy/core/rewriters/rewriter_utils.py 93.28% <ø> (ø)
...y/codebase/mmedit/deploy/super_resolution_model.py 77.77% <25.00%> (ø)
...oy/codebase/mmdet/deploy/object_detection_model.py 83.45% <100.00%> (+0.05%) ⬆️
mmdeploy/codebase/mmseg/deploy/segmentation.py 71.57% <0.00%> (-3.69%) ⬇️
mmdeploy/codebase/base/task.py 79.41% <0.00%> (-1.93%) ⬇️
mmdeploy/codebase/mmcls/deploy/classification.py 66.66% <0.00%> (-0.65%) ⬇️
mmdeploy/codebase/mmdet/deploy/object_detection.py 73.33% <0.00%> (-0.44%) ⬇️
mmdeploy/mmcv/ops/__init__.py 100.00% <0.00%> (ø)
mmdeploy/backend/ncnn/wrapper.py 0.00% <0.00%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 651eec2...f05a82c. Read the comment docs.

endif ()
endmacro()

mmdeploy_java_add_module(detector)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miss the definition of macro mmdeploy_java_add_module.
If the target is a Module, how it can be used, by loading a dynamic library or others?

endif ()
endmacro()

mmdeploy_java_add_module(detector)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Miss the definition of macro mmdeploy_java_add_module.
If the target is a Module, how it can be used, by loading a dynamic library or others?

lzhangzz and others added 5 commits April 7, 2022 11:11
* fix formatter

* relax GCC version requirement
* fix show

* lint

* remove redundant codes

* resolve comment

* type hint
* docs(build): add missing build option

* docs(build): add onnx install

* style(doc): trim whitespace

* docs(build): revert install onnx

* docs(build): add ncnn LD_LIBRARY_PATH

* docs(build): fix path error
@hanrui1sensetime hanrui1sensetime changed the title [WIP] JAVA Detector API JAVA Detector API May 25, 2022
@hanrui1sensetime hanrui1sensetime changed the base branch from master to dev-v0.5.0 May 26, 2022 02:07
@lvhan028
Copy link
Collaborator

lvhan028 commented May 28, 2022

@hanrui1sensetime Can we provide an example showing how to use mmdeploy Java API as #388 did?

@tpoisonooo
Copy link
Collaborator

tpoisonooo commented May 30, 2022

Missing:

  • CI build
  • doc
    • for formal java project, proguard configuration should be mentioned

csrc/apis/java/classifier.cpp Outdated Show resolved Hide resolved
csrc/apis/java/classifier.cpp Outdated Show resolved Hide resolved
csrc/apis/java/classifier.cpp Outdated Show resolved Hide resolved
csrc/apis/java/classifier.cpp Outdated Show resolved Hide resolved
csrc/apis/java/classifier.cpp Outdated Show resolved Hide resolved
csrc/apis/java/classifier.cpp Outdated Show resolved Hide resolved
csrc/apis/java/classifier.cpp Outdated Show resolved Hide resolved
endif ()
foreach (TASK ${TASK_LIST})
set(TARGET_NAME mmdeploy_${TASK}_javaapis)
mmdeploy_add_module(${TARGET_NAME} SHARED ${TASK}.cpp)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmdeploy_add_library(${PROJECT_NAME} SHARED EXCLUDE ${TASK}.cpp)

@lvhan028
Copy link
Collaborator

Reimplement this feature in the other PR #563

@lvhan028 lvhan028 closed this Jun 17, 2022
hanrui1sensetime added a commit to hanrui1sensetime/mmdeploy that referenced this pull request Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.