Skip to content

Commit

Permalink
Merge pull request #4 from mdurrani808/main
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 authored Jan 14, 2024
2 parents b500f7c + 0cf529f commit 8022c40
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/photonvision/rknn/RknnJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ public boolean equals(Object obj) {
* @param imagePtr Pointer to a cv::Mat input image
* @param nmsThresh
* @param boxThresh
* @param maxDetections
*/
public static native RknnResult[] detect(
long detectorPtr, long imagePtr, double nmsThresh, double boxThresh, int maxDetections
long detectorPtr, long imagePtr, double nmsThresh, double boxThresh
);
}
2 changes: 1 addition & 1 deletion src/main/native/cpp/rknn_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Java_org_photonvision_rknn_RknnJNI_destroy
JNIEXPORT jobjectArray JNICALL
Java_org_photonvision_rknn_RknnJNI_detect
(JNIEnv *env, jclass, jlong detector_, jlong input_cvmat_ptr,
jdouble nms_thresh, jdouble box_thresh, jint max_detections)
jdouble nms_thresh, jdouble box_thresh)
{
RknnWrapper *yolo = reinterpret_cast<RknnWrapper *>(detector_);
cv::Mat *input_img = reinterpret_cast<cv::Mat *>(input_cvmat_ptr);
Expand Down
2 changes: 1 addition & 1 deletion src/main/native/cpp/rknn_jni.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ JNIEXPORT void JNICALL Java_org_photonvision_rknn_RknnJNI_destroy(JNIEnv *,
* Signature: (JJIIF)[Lorg/photonvision/rknn/RknnJNI/RknnResult;
*/
JNIEXPORT jobjectArray JNICALL Java_org_photonvision_rknn_RknnJNI_detect(
JNIEnv *, jclass, jlong, jlong, jdouble, jdouble, jint);
JNIEnv *, jclass, jlong, jlong, jdouble, jdouble);

#ifdef __cplusplus
} // extern "C"
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/photonvision/rknn/RknnTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ public void testBasicBlobs() {
System.load("/home/mdurrani808/photon-testing/rknn_jni/cmake_build/librknn_jni.so");

System.out.println("Creating detector");
long ptr = RknnJNI.create("/home/mdurrani808/photon-testing/rknn_jni/src/test/resources/RK3588/yolov5s-640-640.rknn");
long ptr = RknnJNI.create("/home/mdurrani808/photon-testing/rknn_jni/src/test/resources/RK3588/yolov5s-640-640.rknn", 80);

System.out.println("Running detector");
var ret = RknnJNI.detect(ptr, img.getNativeObjAddr());
var ret = RknnJNI.detect(ptr, img.getNativeObjAddr(), .45, .25);
System.out.println(Arrays.toString(ret));

System.out.println("Killing detector");
Expand Down

0 comments on commit 8022c40

Please sign in to comment.