mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Android] fix JNI OCRResult allocate errors (#588)
* [FlyCV] Add global SetProcLibCpuNumThreads method * [Android] Support segmentation and facedet in Android * [Android] add JNI instance check to j_runtime_option_obj * [Model] fixed ppseg flycv resize error * [FlyCV] fix FlyCV resize flags * [cmake] remove un-need lite compile option * [Android] add PaddleSegModel JNI and fix some bugs * [Android] bind PaddleSegModel via JNI * [Android] bind VisSegmentation via JNI * [Android] bind YOLOv5Face and SCRFD via JNI * [Android] fix NewJavaFaceDetectionResultFromCxx error * [Android] remove un-need option in Java RuntimeOption * [Android] fixed OcrMainActivity setting errors * [Android] Update Android SDK usage docs * [Android] Update Android SDK usage docs * [Android] fix JNI OCRResult allocate errors
This commit is contained in:
@@ -209,9 +209,6 @@ public class DetectionMainActivity extends Activity implements View.OnClickListe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTextureChanged(Bitmap ARGB8888ImageBitmap) {
|
public boolean onTextureChanged(Bitmap ARGB8888ImageBitmap) {
|
||||||
Log.d(TAG, "onTextureChanged: bitmap height: "
|
|
||||||
+ ARGB8888ImageBitmap.getHeight() + " width: "
|
|
||||||
+ ARGB8888ImageBitmap.getWidth());
|
|
||||||
String savedImagePath = "";
|
String savedImagePath = "";
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
savedImagePath = Utils.getDCIMDirectory() + File.separator + "result.jpg";
|
savedImagePath = Utils.getDCIMDirectory() + File.separator + "result.jpg";
|
||||||
@@ -224,10 +221,12 @@ public class DetectionMainActivity extends Activity implements View.OnClickListe
|
|||||||
shutterBitmap = ARGB8888ImageBitmap;
|
shutterBitmap = ARGB8888ImageBitmap;
|
||||||
originShutterBitmap = ARGB8888ImageBitmap;
|
originShutterBitmap = ARGB8888ImageBitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean modified = false;
|
boolean modified = false;
|
||||||
DetectionResult result = predictor.predict(
|
DetectionResult result = predictor.predict(
|
||||||
ARGB8888ImageBitmap, true, DetectionSettingsActivity.scoreThreshold);
|
ARGB8888ImageBitmap, true, DetectionSettingsActivity.scoreThreshold);
|
||||||
modified = result.initialized();
|
modified = result.initialized();
|
||||||
|
|
||||||
if (!savedImagePath.isEmpty()) {
|
if (!savedImagePath.isEmpty()) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
DetectionMainActivity.this.savedImagePath = "result.jpg";
|
DetectionMainActivity.this.savedImagePath = "result.jpg";
|
||||||
|
@@ -30,6 +30,7 @@ bool AllocateJavaClassifyResultFromCxx(
|
|||||||
// (1) mScores float[] shape (n): [F
|
// (1) mScores float[] shape (n): [F
|
||||||
// (2) mLabelIds int[] shape (n): [I
|
// (2) mLabelIds int[] shape (n): [I
|
||||||
// (3) mInitialized boolean: Z
|
// (3) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/classification_result.md
|
||||||
if (cxx_result == nullptr) {
|
if (cxx_result == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -85,6 +86,7 @@ bool AllocateJavaDetectionResultFromCxx(
|
|||||||
// (2) mScores float[] shape (n): [F
|
// (2) mScores float[] shape (n): [F
|
||||||
// (3) mLabelIds int[] shape (n): [I
|
// (3) mLabelIds int[] shape (n): [I
|
||||||
// (4) mInitialized boolean: Z
|
// (4) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/detection_result.md
|
||||||
if (cxx_result == nullptr) {
|
if (cxx_result == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -138,7 +140,7 @@ bool AllocateJavaDetectionResultFromCxx(
|
|||||||
env->SetObjectField(j_det_result_obj, j_det_label_ids_id, j_det_label_ids_int_arr);
|
env->SetObjectField(j_det_result_obj, j_det_label_ids_id, j_det_label_ids_int_arr);
|
||||||
env->SetBooleanField(j_det_result_obj, j_det_initialized_id, JNI_TRUE);
|
env->SetBooleanField(j_det_result_obj, j_det_initialized_id, JNI_TRUE);
|
||||||
|
|
||||||
// Release non static local Refs
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_det_boxes_float_arr);
|
env->DeleteLocalRef(j_det_boxes_float_arr);
|
||||||
env->DeleteLocalRef(j_det_scores_float_arr);
|
env->DeleteLocalRef(j_det_scores_float_arr);
|
||||||
env->DeleteLocalRef(j_det_label_ids_int_arr);
|
env->DeleteLocalRef(j_det_label_ids_int_arr);
|
||||||
@@ -158,6 +160,7 @@ bool AllocateJavaOCRResultFromCxx(
|
|||||||
// (4) mClsScores float[] shape (n): [F
|
// (4) mClsScores float[] shape (n): [F
|
||||||
// (5) mClsLabels int[] shape (n): [I
|
// (5) mClsLabels int[] shape (n): [I
|
||||||
// (6) mInitialized boolean: Z
|
// (6) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/ocr_result.md
|
||||||
if (cxx_result == nullptr) {
|
if (cxx_result == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -212,30 +215,35 @@ bool AllocateJavaOCRResultFromCxx(
|
|||||||
jfloatArray j_ocr_rec_scores_float_arr = env->NewFloatArray(len);
|
jfloatArray j_ocr_rec_scores_float_arr = env->NewFloatArray(len);
|
||||||
env->SetFloatArrayRegion(j_ocr_rec_scores_float_arr, 0, len, rec_scores.data());
|
env->SetFloatArrayRegion(j_ocr_rec_scores_float_arr, 0, len, rec_scores.data());
|
||||||
|
|
||||||
// mClsScores float[] shape (n): [F
|
const int cls_len = static_cast<int>(c_result_ptr->cls_scores.size());
|
||||||
const auto &cls_scores = c_result_ptr->cls_scores;
|
if (cls_len > 0) {
|
||||||
jfloatArray j_ocr_cls_scores_float_arr = env->NewFloatArray(len);
|
// mClsScores float[] shape (n): [F
|
||||||
env->SetFloatArrayRegion(j_ocr_cls_scores_float_arr, 0, len, cls_scores.data());
|
const auto &cls_scores = c_result_ptr->cls_scores;
|
||||||
|
jfloatArray j_ocr_cls_scores_float_arr = env->NewFloatArray(cls_len);
|
||||||
|
env->SetFloatArrayRegion(j_ocr_cls_scores_float_arr, 0, cls_len, cls_scores.data());
|
||||||
|
|
||||||
// mClsLabels int[] shape (n): [I
|
// mClsLabels int[] shape (n): [I
|
||||||
const auto &cls_labels = c_result_ptr->cls_labels;
|
const auto &cls_labels = c_result_ptr->cls_labels;
|
||||||
jintArray j_ocr_cls_labels_int_arr = env->NewIntArray(len);
|
jintArray j_ocr_cls_labels_int_arr = env->NewIntArray(cls_len);
|
||||||
env->SetIntArrayRegion(j_ocr_cls_labels_int_arr, 0, len, cls_labels.data());
|
env->SetIntArrayRegion(j_ocr_cls_labels_int_arr, 0, cls_len, cls_labels.data());
|
||||||
|
|
||||||
|
env->SetObjectField(j_ocr_result_obj, j_ocr_cls_scores_id, j_ocr_cls_scores_float_arr);
|
||||||
|
env->SetObjectField(j_ocr_result_obj, j_ocr_cls_labels_id, j_ocr_cls_labels_int_arr);
|
||||||
|
|
||||||
|
env->DeleteLocalRef(j_ocr_cls_scores_float_arr);
|
||||||
|
env->DeleteLocalRef(j_ocr_cls_labels_int_arr);
|
||||||
|
}
|
||||||
|
|
||||||
// Set object fields
|
// Set object fields
|
||||||
env->SetObjectField(j_ocr_result_obj, j_ocr_boxes_id, j_ocr_boxes_int_arr);
|
env->SetObjectField(j_ocr_result_obj, j_ocr_boxes_id, j_ocr_boxes_int_arr);
|
||||||
env->SetObjectField(j_ocr_result_obj, j_ocr_text_id, j_ocr_text_arr);
|
env->SetObjectField(j_ocr_result_obj, j_ocr_text_id, j_ocr_text_arr);
|
||||||
env->SetObjectField(j_ocr_result_obj, j_ocr_rec_scores_id, j_ocr_rec_scores_float_arr);
|
env->SetObjectField(j_ocr_result_obj, j_ocr_rec_scores_id, j_ocr_rec_scores_float_arr);
|
||||||
env->SetObjectField(j_ocr_result_obj, j_ocr_cls_scores_id, j_ocr_cls_scores_float_arr);
|
|
||||||
env->SetObjectField(j_ocr_result_obj, j_ocr_cls_labels_id, j_ocr_cls_labels_int_arr);
|
|
||||||
env->SetBooleanField(j_ocr_result_obj, j_ocr_initialized_id, JNI_TRUE);
|
env->SetBooleanField(j_ocr_result_obj, j_ocr_initialized_id, JNI_TRUE);
|
||||||
|
|
||||||
// Release non static local Refs
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_ocr_boxes_int_arr);
|
env->DeleteLocalRef(j_ocr_boxes_int_arr);
|
||||||
env->DeleteLocalRef(j_ocr_text_arr);
|
env->DeleteLocalRef(j_ocr_text_arr);
|
||||||
env->DeleteLocalRef(j_ocr_rec_scores_float_arr);
|
env->DeleteLocalRef(j_ocr_rec_scores_float_arr);
|
||||||
env->DeleteLocalRef(j_ocr_cls_scores_float_arr);
|
|
||||||
env->DeleteLocalRef(j_ocr_cls_labels_int_arr);
|
|
||||||
env->DeleteLocalRef(j_ocr_result_clazz);
|
env->DeleteLocalRef(j_ocr_result_clazz);
|
||||||
env->DeleteLocalRef(j_ocr_int_arr_clazz);
|
env->DeleteLocalRef(j_ocr_int_arr_clazz);
|
||||||
env->DeleteLocalRef(j_ocr_str_clazz);
|
env->DeleteLocalRef(j_ocr_str_clazz);
|
||||||
@@ -253,6 +261,7 @@ bool AllocateJavaSegmentationResultFromCxx(
|
|||||||
// (3) mContainScoreMap boolean: Z
|
// (3) mContainScoreMap boolean: Z
|
||||||
// (4) mScoreMap float[] shape (n): [F
|
// (4) mScoreMap float[] shape (n): [F
|
||||||
// (5) mInitialized boolean: Z
|
// (5) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/segmentation_result.md
|
||||||
if (cxx_result == nullptr) {
|
if (cxx_result == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -314,7 +323,7 @@ bool AllocateJavaSegmentationResultFromCxx(
|
|||||||
env->SetObjectField(j_seg_result_obj, j_seg_shape_id, j_seg_shape_long_arr);
|
env->SetObjectField(j_seg_result_obj, j_seg_shape_id, j_seg_shape_long_arr);
|
||||||
env->SetBooleanField(j_seg_result_obj, j_seg_initialized_id, JNI_TRUE);
|
env->SetBooleanField(j_seg_result_obj, j_seg_initialized_id, JNI_TRUE);
|
||||||
|
|
||||||
// Release non static local Refs
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_seg_label_map_int_arr);
|
env->DeleteLocalRef(j_seg_label_map_int_arr);
|
||||||
env->DeleteLocalRef(j_seg_shape_long_arr);
|
env->DeleteLocalRef(j_seg_shape_long_arr);
|
||||||
env->DeleteLocalRef(j_seg_result_clazz);
|
env->DeleteLocalRef(j_seg_result_clazz);
|
||||||
@@ -332,6 +341,7 @@ bool AllocateJavaFaceDetectionResultFromCxx(
|
|||||||
// (3) mLandmarks float[][] shape (n,2): [[F
|
// (3) mLandmarks float[][] shape (n,2): [[F
|
||||||
// (4) mLandmarksPerFace int: I
|
// (4) mLandmarksPerFace int: I
|
||||||
// (5) mInitialized boolean: Z
|
// (5) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/face_detection_result.md
|
||||||
if (cxx_result == nullptr) {
|
if (cxx_result == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -521,6 +531,7 @@ bool AllocateClassifyResultFromJava(
|
|||||||
// (1) mScores float[] shape (n): [F
|
// (1) mScores float[] shape (n): [F
|
||||||
// (2) mLabelIds int[] shape (n): [I
|
// (2) mLabelIds int[] shape (n): [I
|
||||||
// (3) mInitialized boolean: Z
|
// (3) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/classification_result.md
|
||||||
if (cxx_result == nullptr || j_cls_result_obj == nullptr) {
|
if (cxx_result == nullptr || j_cls_result_obj == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -573,6 +584,7 @@ bool AllocateClassifyResultFromJava(
|
|||||||
std::memcpy(c_result_ptr->label_ids.data(), j_cls_label_ids_ptr, len * sizeof(int));
|
std::memcpy(c_result_ptr->label_ids.data(), j_cls_label_ids_ptr, len * sizeof(int));
|
||||||
env->ReleaseIntArrayElements(j_cls_label_ids_int_arr, j_cls_label_ids_ptr, 0);
|
env->ReleaseIntArrayElements(j_cls_label_ids_int_arr, j_cls_label_ids_ptr, 0);
|
||||||
|
|
||||||
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_cls_result_clazz_cc);
|
env->DeleteLocalRef(j_cls_result_clazz_cc);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -587,6 +599,7 @@ bool AllocateDetectionResultFromJava(
|
|||||||
// (2) mScores float[] shape (n): [F
|
// (2) mScores float[] shape (n): [F
|
||||||
// (3) mLabelIds int[] shape (n): [I
|
// (3) mLabelIds int[] shape (n): [I
|
||||||
// (4) mInitialized boolean: Z
|
// (4) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/detection_result.md
|
||||||
if (cxx_result == nullptr || j_det_result_obj == nullptr) {
|
if (cxx_result == nullptr || j_det_result_obj == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -662,6 +675,7 @@ bool AllocateDetectionResultFromJava(
|
|||||||
std::memcpy(c_result_ptr->label_ids.data(), j_det_label_ids_ptr, len * sizeof(int));
|
std::memcpy(c_result_ptr->label_ids.data(), j_det_label_ids_ptr, len * sizeof(int));
|
||||||
env->ReleaseIntArrayElements(j_det_label_ids_int_arr, j_det_label_ids_ptr, 0);
|
env->ReleaseIntArrayElements(j_det_label_ids_int_arr, j_det_label_ids_ptr, 0);
|
||||||
|
|
||||||
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_det_result_clazz_cc);
|
env->DeleteLocalRef(j_det_result_clazz_cc);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -677,6 +691,7 @@ bool AllocateOCRResultFromJava(
|
|||||||
// (4) mClsScores float[] shape (n): [F
|
// (4) mClsScores float[] shape (n): [F
|
||||||
// (5) mClsLabels int[] shape (n): [I
|
// (5) mClsLabels int[] shape (n): [I
|
||||||
// (6) mInitialized boolean: Z
|
// (6) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/ocr_result.md
|
||||||
if (cxx_result == nullptr || j_ocr_result_obj == nullptr) {
|
if (cxx_result == nullptr || j_ocr_result_obj == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -721,9 +736,12 @@ bool AllocateOCRResultFromJava(
|
|||||||
|
|
||||||
const int len = env->GetArrayLength(j_ocr_boxes_arr);
|
const int len = env->GetArrayLength(j_ocr_boxes_arr);
|
||||||
if ((len == 0) || (len != env->GetArrayLength(j_ocr_text_arr)) ||
|
if ((len == 0) || (len != env->GetArrayLength(j_ocr_text_arr)) ||
|
||||||
(len != env->GetArrayLength(j_ocr_rec_scores_float_arr)) ||
|
(len != env->GetArrayLength(j_ocr_rec_scores_float_arr))){
|
||||||
(len != env->GetArrayLength(j_ocr_cls_scores_float_arr)) ||
|
return false;
|
||||||
(len != env->GetArrayLength(j_ocr_cls_labels_int_arr))) {
|
}
|
||||||
|
|
||||||
|
const int cls_len = env->GetArrayLength(j_ocr_cls_scores_float_arr);
|
||||||
|
if (cls_len != env->GetArrayLength(j_ocr_cls_labels_int_arr)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -731,8 +749,11 @@ bool AllocateOCRResultFromJava(
|
|||||||
c_result_ptr->Clear();
|
c_result_ptr->Clear();
|
||||||
c_result_ptr->boxes.resize(len);
|
c_result_ptr->boxes.resize(len);
|
||||||
c_result_ptr->rec_scores.resize(len);
|
c_result_ptr->rec_scores.resize(len);
|
||||||
c_result_ptr->cls_scores.resize(len);
|
|
||||||
c_result_ptr->cls_labels.resize(len);
|
if (cls_len > 0) {
|
||||||
|
c_result_ptr->cls_scores.resize(cls_len);
|
||||||
|
c_result_ptr->cls_labels.resize(cls_len);
|
||||||
|
}
|
||||||
|
|
||||||
// mBoxes int[][] shape (n,8): [[I
|
// mBoxes int[][] shape (n,8): [[I
|
||||||
bool c_check_validation = true;
|
bool c_check_validation = true;
|
||||||
@@ -765,18 +786,21 @@ bool AllocateOCRResultFromJava(
|
|||||||
std::memcpy(c_result_ptr->rec_scores.data(), j_ocr_rec_scores_ptr, len * sizeof(float));
|
std::memcpy(c_result_ptr->rec_scores.data(), j_ocr_rec_scores_ptr, len * sizeof(float));
|
||||||
env->ReleaseFloatArrayElements(j_ocr_rec_scores_float_arr, j_ocr_rec_scores_ptr, 0);
|
env->ReleaseFloatArrayElements(j_ocr_rec_scores_float_arr, j_ocr_rec_scores_ptr, 0);
|
||||||
|
|
||||||
// mClsScores float[] shape (n): [F
|
if (cls_len > 0) {
|
||||||
jfloat *j_ocr_cls_scores_ptr =
|
// mClsScores float[] shape (n): [F
|
||||||
env->GetFloatArrayElements(j_ocr_cls_scores_float_arr, nullptr);
|
jfloat *j_ocr_cls_scores_ptr =
|
||||||
std::memcpy(c_result_ptr->rec_scores.data(), j_ocr_cls_scores_ptr, len * sizeof(float));
|
env->GetFloatArrayElements(j_ocr_cls_scores_float_arr, nullptr);
|
||||||
env->ReleaseFloatArrayElements(j_ocr_cls_scores_float_arr, j_ocr_cls_scores_ptr, 0);
|
std::memcpy(c_result_ptr->cls_scores.data(), j_ocr_cls_scores_ptr, cls_len * sizeof(float));
|
||||||
|
env->ReleaseFloatArrayElements(j_ocr_cls_scores_float_arr, j_ocr_cls_scores_ptr, 0);
|
||||||
|
|
||||||
// mClsLabels int[] shape (n): [I
|
// mClsLabels int[] shape (n): [I
|
||||||
jint *j_ocr_cls_labels_ptr =
|
jint *j_ocr_cls_labels_ptr =
|
||||||
env->GetIntArrayElements(j_ocr_cls_labels_int_arr, nullptr);
|
env->GetIntArrayElements(j_ocr_cls_labels_int_arr, nullptr);
|
||||||
std::memcpy(c_result_ptr->cls_labels.data(), j_ocr_cls_labels_ptr, len * sizeof(int));
|
std::memcpy(c_result_ptr->cls_labels.data(), j_ocr_cls_labels_ptr, cls_len * sizeof(int));
|
||||||
env->ReleaseIntArrayElements(j_ocr_cls_labels_int_arr, j_ocr_cls_labels_ptr,0);
|
env->ReleaseIntArrayElements(j_ocr_cls_labels_int_arr, j_ocr_cls_labels_ptr,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_ocr_result_clazz_cc);
|
env->DeleteLocalRef(j_ocr_result_clazz_cc);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -791,6 +815,7 @@ bool AllocateSegmentationResultFromJava(
|
|||||||
// (3) mContainScoreMap boolean: Z
|
// (3) mContainScoreMap boolean: Z
|
||||||
// (4) mScoreMap float[] shape (n): [F
|
// (4) mScoreMap float[] shape (n): [F
|
||||||
// (5) mInitialized boolean: Z
|
// (5) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/segmentation_result.md
|
||||||
if (cxx_result == nullptr || j_seg_result_obj == nullptr) {
|
if (cxx_result == nullptr || j_seg_result_obj == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -864,6 +889,7 @@ bool AllocateSegmentationResultFromJava(
|
|||||||
env->ReleaseFloatArrayElements(j_seg_score_map_float_arr, j_seg_score_map_float_ptr, 0);
|
env->ReleaseFloatArrayElements(j_seg_score_map_float_arr, j_seg_score_map_float_ptr, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_seg_result_clazz_cc);
|
env->DeleteLocalRef(j_seg_result_clazz_cc);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -878,6 +904,7 @@ bool AllocateFaceDetectionResultFromJava(
|
|||||||
// (3) mLandmarks float[][] shape (n,2): [[F
|
// (3) mLandmarks float[][] shape (n,2): [[F
|
||||||
// (4) mLandmarksPerFace int: I
|
// (4) mLandmarksPerFace int: I
|
||||||
// (5) mInitialized boolean: Z
|
// (5) mInitialized boolean: Z
|
||||||
|
// Docs: docs/api/vision_results/face_detection_result.md
|
||||||
if (cxx_result == nullptr || j_face_det_result_obj == nullptr) {
|
if (cxx_result == nullptr || j_face_det_result_obj == nullptr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -973,12 +1000,12 @@ bool AllocateFaceDetectionResultFromJava(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Release local Refs
|
||||||
env->DeleteLocalRef(j_face_det_result_clazz_cc);
|
env->DeleteLocalRef(j_face_det_result_clazz_cc);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AllocateCxxResultFromJava(
|
bool AllocateCxxResultFromJava(
|
||||||
JNIEnv *env, jobject j_result_obj, void *cxx_result,
|
JNIEnv *env, jobject j_result_obj, void *cxx_result,
|
||||||
vision::ResultType type) {
|
vision::ResultType type) {
|
||||||
|
Reference in New Issue
Block a user