Skip to content

Commit

Permalink
[Bug Fix] fix AllocateFaceDetectionResultFromJava error (PaddlePaddle…
Browse files Browse the repository at this point in the history
…#628)

* [Bug Fix] fix android app detail page errors

* [Android] fix realtime camera mode and shutter

* [Bug Fix] fix AllocateSegmentationResultFromJava error
  • Loading branch information
DefTruth authored Nov 18, 2022
1 parent 8dd3e64 commit 1609ce1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
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=".detection.DetectionMainActivity">
<activity android:name=".facedet.FaceDetMainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".detection.DetectionSettingsActivity"
android:name=".facedet.FaceDetSettingsActivity"
android:label="Settings">
</activity>
</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,30 +352,16 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {

@Override
public void onStartTrackingTouch(SeekBar seekBar) {

}

@Override
public void onStopTrackingTouch(SeekBar seekBar) {
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
// if (TYPE == ALBUM_SELECT) {
// SystemClock.sleep(TIME_SLEEP_INTERVAL * 10); // 500ms
// detail(picBitmap);
// } else {
// SystemClock.sleep(TIME_SLEEP_INTERVAL * 10); // 500ms
// svPreview.onPause();
// detail(shutterBitmap);
// }
// }
// });
}
});
}

private void detail(Bitmap bitmap) {
predictor.predict(bitmap, true, 0.6f);
predictor.predict(bitmap, true, 0.4f);
resultImage.setImageBitmap(bitmap);
resultNum = 1.0f;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,9 @@ bool AllocateFaceDetectionResultFromJava(
if (j_landmarks_per_face > 0) {
jobjectArray j_face_det_landmarks_float_arr = reinterpret_cast<jobjectArray>(
env->GetObjectField(j_face_det_result_obj, j_face_det_landmarks_id_cc));
for (int i = 0; i < len; ++i) {
const int landmarks_len = env->GetArrayLength(j_face_det_landmarks_float_arr);

for (int i = 0; i < landmarks_len; ++i) {
auto j_landmark = reinterpret_cast<jfloatArray>(
env->GetObjectArrayElement(j_face_det_landmarks_float_arr, i));
if (env->GetArrayLength(j_landmark) == 2) {
Expand Down

0 comments on commit 1609ce1

Please sign in to comment.