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

[Android] Support PPTinyPose on Android #746

Merged
merged 19 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e4f58e9
[Android] Update ppseg jni via new api and optimize jni vis funcs
DefTruth Nov 28, 2022
851e65e
Merge branch 'feat_add_android_pptinypose' of https://github.com/DefT…
DefTruth Nov 28, 2022
3c1af2e
Merge branch 'develop' into feat_add_android_pptinypose
DefTruth Nov 28, 2022
4e21aa8
delete local refs
DefTruth Nov 28, 2022
8e6bc7b
Merge branch 'feat_add_android_pptinypose' of https://github.com/DefT…
DefTruth Nov 28, 2022
6026318
Merge branch 'PaddlePaddle:develop' into feat_add_android_pptinypose
DefTruth Nov 29, 2022
bb75186
Merge branch 'PaddlePaddle:develop' into feat_add_android_pptinypose
DefTruth Nov 29, 2022
7f4514a
Merge branch 'PaddlePaddle:develop' into feat_add_android_pptinypose
DefTruth Nov 29, 2022
de74545
[Android] Add PPTinyPose jni and java api
DefTruth Nov 29, 2022
9c57395
Merge branch 'feat_add_android_pptinypose' of https://github.com/DefT…
DefTruth Nov 29, 2022
933d474
Merge branch 'develop' into feat_add_android_pptinypose
DefTruth Nov 30, 2022
fbb78ca
[Android] Update gradle download tasks info
DefTruth Nov 30, 2022
dd6a1df
Merge branch 'feat_add_android_pptinypose' of https://github.com/DefT…
DefTruth Nov 30, 2022
bb66c6a
Merge branch 'develop' into feat_add_android_pptinypose
DefTruth Nov 30, 2022
f3bc948
Merge branch 'feat_add_android_pptinypose' of https://github.com/DefT…
DefTruth Nov 30, 2022
a7c320f
[Android] Add PPTinyPose Android app example
DefTruth Nov 30, 2022
deb12b1
Merge branch 'develop' into feat_add_android_pptinypose
DefTruth Nov 30, 2022
abd6565
Merge branch 'feat_add_android_pptinypose' of https://github.com/DefT…
DefTruth Nov 30, 2022
a6bd4ca
update app build.gradle
DefTruth Nov 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions java/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
Expand Down Expand Up @@ -69,6 +68,10 @@ def FD_MODEL = [
[
'src' : 'https://bj.bcebos.com/paddlehub/fastdeploy/portrait_pp_humansegv2_lite_256x144_inference_model.tgz',
'dest': 'src/main/assets/models'
],
[
'src' : 'https://bj.bcebos.com/paddlehub/fastdeploy/PP_TinyPose_128x96_infer.tgz',
'dest': 'src/main/assets/models'
]
]

Expand All @@ -81,7 +84,7 @@ def FD_JAVA_SDK = [

task downloadAndExtractModels(type: DefaultTask) {
doFirst {
println "Downloading and extracting fastdeploy models ..."
println "[INFO] Downloading and extracting fastdeploy models ..."
}
doLast {
String cachePath = "cache"
Expand All @@ -91,27 +94,30 @@ task downloadAndExtractModels(type: DefaultTask) {
FD_MODEL.eachWithIndex { model, index ->
String[] modelPaths = model.src.split("/")
String modelName = modelPaths[modelPaths.length - 1]
String modelPrefix = modelName.substring(0, modelName.length() - 4)
// Download the target model if not exists
boolean copyFiles = !file("${model.dest}").exists()
boolean copyFiles = !file("${model.dest}/${modelPrefix}").exists()
if (!file("${cachePath}/${modelName}").exists()) {
println "Downloading ${model.src} -> ${cachePath}/${modelName}"
println "[INFO] Downloading ${model.src} -> ${cachePath}/${modelName}"
ant.get(src: model.src, dest: file("${cachePath}/${modelName}"))
copyFiles = true
}
if (copyFiles) {
println "Coping ${cachePath}/${modelName} -> ${model.dest}"
println "[INFO] Taring ${cachePath}/${modelName} -> ${model.dest}/${modelPrefix}"
copy {
from tarTree("${cachePath}/${modelName}")
into "${model.dest}"
}
} else {
println "[INFO] ${model.dest}/${modelPrefix} already exists!"
}
}
}
}

task downloadAndExtractSDKs(type: DefaultTask) {
doFirst {
println "Downloading and extracting fastdeploy android java sdk ..."
println "[INFO] Downloading and extracting fastdeploy android java sdk ..."
}
doLast {
String cachePath = "cache"
Expand All @@ -124,16 +130,18 @@ task downloadAndExtractSDKs(type: DefaultTask) {
// Download the target SDK if not exists
boolean copyFiles = !file("${sdk.dest}/${sdkName}").exists()
if (!file("${cachePath}/${sdkName}").exists()) {
println "Downloading ${sdk.src} -> ${cachePath}/${sdkName}"
println "[INFO] Downloading ${sdk.src} -> ${cachePath}/${sdkName}"
ant.get(src: sdk.src, dest: file("${cachePath}/${sdkName}"))
copyFiles = true
}
if (copyFiles) {
println "Coping ${cachePath}/${sdkName} -> ${sdk.dest}/${sdkName}"
println "[INFO] Coping ${cachePath}/${sdkName} -> ${sdk.dest}/${sdkName}"
copy {
from "${cachePath}/${sdkName}"
into "${sdk.dest}"
}
} else {
println "[INFO] ${sdk.dest}/${sdkName} already exists!"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions java/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".segmentation.SegmentationMainActivity">
<activity android:name=".keypointdetection.KeyPointDetectionMainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".segmentation.SegmentationSettingsActivity"
android:name=".keypointdetection.KeyPointDetectionSettingsActivity"
android:label="Settings">
</activity>
</application>
Expand Down
Loading