重新编译aar和binarypb解决不必要的人体遮罩的问题

升级了gradle的版本
移除了弃用的getProto函数
This commit is contained in:
jackfiled 2023-01-19 18:37:37 +08:00
parent 59387de36f
commit b4df911c64
6 changed files with 11 additions and 11 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

Binary file not shown.

View File

@ -1,7 +1,4 @@
ConstantSidePacketCalculator2PACKET:enable_segmentationBI
Atype.googleapis.com/mediapipe.ConstantSidePacketCalculatorOptions

`FlowLimiterCalculator input_videoFINISHED:output_video"throttled_input_videoj
FINISHED
×PoseLandmarkGpuIMAGE:throttled_input_video"LANDMARKS:pose_landmarks"#SEGMENTATION_MASK:segmentation_mask"DETECTION:pose_detection"%ROI_FROM_LANDMARKS:roi_from_landmarks*'ENABLE_SEGMENTATION:enable_segmentation

View File

@ -40,7 +40,6 @@ class MainActivity : AppCompatActivity() {
init {
// 加载项目中用到的jni库
System.loadLibrary("mediapipe_jni")
System.loadLibrary("opencv_java3")
}
override fun onCreate(savedInstanceState: Bundle?) {
@ -80,7 +79,6 @@ class MainActivity : AppCompatActivity() {
processor.videoSurfaceOutput.setFlipY(true)
// 捕获获得的坐标数据包
// 遇到InvalidProtocolBufferException
// 参考 https://github.com/google/mediapipe/issues/1013
@ -91,8 +89,13 @@ class MainActivity : AppCompatActivity() {
) {
Log.i(tag, "Received Landmark Packets.")
try {
val landmarkList = PacketGetter.getProto(it, NormalizedLandmarkList::class.java)
Log.i(tag, getPoseLandmarksDebugString(landmarkList))
// 无法采用这种方法获取packet
// 回报Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 15943 (Thread-9), pid 15810 (o.motioncapture)
/*val packetRaw = PacketGetter.getBytes(it)
val landmarks = NormalizedLandmarkList.parseFrom(packetRaw)
Log.i(tag, getPoseLandmarksDebugString(landmarks))*/
val landmarks = PacketGetter.getProto(it, NormalizedLandmarkList.getDefaultInstance())
Log.i(tag, getPoseLandmarksDebugString(landmarks))
} catch (exception: InvalidProtocolBufferException) {
Log.e(tag, "failed to get protocol.", exception)
}

View File

@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}

View File

@ -1,6 +1,6 @@
#Sat Jan 07 16:28:48 CST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME