|
|
@ -56,7 +56,7 @@ JNIEXPORT void JNI_OnUnload(JavaVM *vm, void *reserved) {
|
|
|
|
Yolov5
|
|
|
|
Yolov5
|
|
|
|
********************************************************************************************/
|
|
|
|
********************************************************************************************/
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
Java_wificar_YOLOv5_init(JNIEnv *env, jclass, jobject assetManager, jboolean useGPU) {
|
|
|
|
Java_wificar_yolo_YOLOv5_init(JNIEnv *env, jclass, jobject assetManager, jboolean useGPU) {
|
|
|
|
if (YoloV5::detector != nullptr) {
|
|
|
|
if (YoloV5::detector != nullptr) {
|
|
|
|
delete YoloV5::detector;
|
|
|
|
delete YoloV5::detector;
|
|
|
|
YoloV5::detector = nullptr;
|
|
|
|
YoloV5::detector = nullptr;
|
|
|
@ -68,7 +68,7 @@ Java_wificar_YOLOv5_init(JNIEnv *env, jclass, jobject assetManager, jboolean use
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" JNIEXPORT jobjectArray JNICALL
|
|
|
|
extern "C" JNIEXPORT jobjectArray JNICALL
|
|
|
|
Java_wificar_YOLOv5_detect(JNIEnv *env, jclass, jobject image, jdouble threshold, jdouble nms_threshold) {
|
|
|
|
Java_wificar_yolo_YOLOv5_detect(JNIEnv *env, jclass, jobject image, jdouble threshold, jdouble nms_threshold) {
|
|
|
|
auto result = YoloV5::detector->detect(env, image, threshold, nms_threshold);
|
|
|
|
auto result = YoloV5::detector->detect(env, image, threshold, nms_threshold);
|
|
|
|
|
|
|
|
|
|
|
|
auto box_cls = env->FindClass("wificar/Box");
|
|
|
|
auto box_cls = env->FindClass("wificar/Box");
|
|
|
@ -86,7 +86,7 @@ Java_wificar_YOLOv5_detect(JNIEnv *env, jclass, jobject image, jdouble threshold
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************[ Yolov5 Custom Layer ]****************************************
|
|
|
|
// ***************************************[ Yolov5 Custom Layer ]****************************************
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
Java_wificar_YOLOv5_initCustomLayer(JNIEnv *env, jclass, jobject assetManager, jboolean useGPU) {
|
|
|
|
Java_wificar_yolo_YOLOv5_initCustomLayer(JNIEnv *env, jclass, jobject assetManager, jboolean useGPU) {
|
|
|
|
if (YoloV5CustomLayer::detector != nullptr) {
|
|
|
|
if (YoloV5CustomLayer::detector != nullptr) {
|
|
|
|
delete YoloV5CustomLayer::detector;
|
|
|
|
delete YoloV5CustomLayer::detector;
|
|
|
|
YoloV5CustomLayer::detector = nullptr;
|
|
|
|
YoloV5CustomLayer::detector = nullptr;
|
|
|
@ -98,7 +98,7 @@ Java_wificar_YOLOv5_initCustomLayer(JNIEnv *env, jclass, jobject assetManager, j
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" JNIEXPORT jobjectArray JNICALL
|
|
|
|
extern "C" JNIEXPORT jobjectArray JNICALL
|
|
|
|
Java_wificar_YOLOv5_detectCustomLayer(JNIEnv *env, jclass, jobject image, jdouble threshold, jdouble nms_threshold) {
|
|
|
|
Java_wificar_yolo_YOLOv5_detectCustomLayer(JNIEnv *env, jclass, jobject image, jdouble threshold, jdouble nms_threshold) {
|
|
|
|
auto result = YoloV5CustomLayer::detector->detect(env, image, threshold, nms_threshold);
|
|
|
|
auto result = YoloV5CustomLayer::detector->detect(env, image, threshold, nms_threshold);
|
|
|
|
|
|
|
|
|
|
|
|
auto box_cls = env->FindClass("wificar/Box");
|
|
|
|
auto box_cls = env->FindClass("wificar/Box");
|
|
|
@ -197,7 +197,7 @@ Java_wificar_NanoDet_detect(JNIEnv *env, jclass, jobject image, jdouble threshol
|
|
|
|
********************************************************************************************/
|
|
|
|
********************************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
extern "C" JNIEXPORT void JNICALL
|
|
|
|
Java_wificar_SimplePose_init(JNIEnv *env, jclass clazz, jobject assetManager, jboolean useGPU) {
|
|
|
|
Java_wificar_yolo_SimplePose_init(JNIEnv *env, jclass clazz, jobject assetManager, jboolean useGPU) {
|
|
|
|
if (SimplePose::detector != nullptr) {
|
|
|
|
if (SimplePose::detector != nullptr) {
|
|
|
|
delete SimplePose::detector;
|
|
|
|
delete SimplePose::detector;
|
|
|
|
SimplePose::detector = nullptr;
|
|
|
|
SimplePose::detector = nullptr;
|
|
|
@ -209,7 +209,7 @@ Java_wificar_SimplePose_init(JNIEnv *env, jclass clazz, jobject assetManager, jb
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" JNIEXPORT jobjectArray JNICALL
|
|
|
|
extern "C" JNIEXPORT jobjectArray JNICALL
|
|
|
|
Java_wificar_SimplePose_detect(JNIEnv *env, jclass clazz, jobject image) {
|
|
|
|
Java_wificar_yolo_SimplePose_detect(JNIEnv *env, jclass clazz, jobject image) {
|
|
|
|
auto result = SimplePose::detector->detect(env, image);
|
|
|
|
auto result = SimplePose::detector->detect(env, image);
|
|
|
|
|
|
|
|
|
|
|
|
auto box_cls = env->FindClass("wificar/KeyPoint");
|
|
|
|
auto box_cls = env->FindClass("wificar/KeyPoint");
|
|
|
|