FACE RECOGNITION

  • rajadey150@gmail.com wrote: 2024-04-03 9:48 Respected Sir,
    Using RKNN library and open cv,the norm value is coming same for all faces

    Hello, after testing, the program is functioning normally. The typical threshold is approximately 1.1 (using Chinese faces as a reference). Faces with significant differences have a Euclidean distance of around 1.4 compared to the reference image, while matched faces have a distance of around 1.1. If you're interested in developing further, please familiarize yourself with the application of various software interfaces in the source code and the underlying principles behind them.
  • Sir,
    With none of the captured images it is showing 1.1 or <1.1. I have tried with sample picture also.
    It is also capturing False image i.e Picture/images no live detection is showing
  • rajadey150@gmail.com wrote: 2024-04-03 12:00 Sir,
    With none of the captured images it is showing 1.1 or <1.1. I have tried with sample picture also.
    It is also capturing False image i.e Picture/images no live detection is showing

    This is the dataset we use for experimentation purposes, which you can use for testing. Our program has been tested to ensure it calculates correctly, while issues regarding the accuracy of the model itself need to be explored and optimized independently. We do not provide technical support related to this.
  • //Get reference img feature
    cv::Mat image = cv::imread(image_path);
    unsigned char * input_data = (unsigned char *)app_facenet_ctx.input_mems[0]->virt_addr;
    letterbox(image,input_data);
    ret = rknn_run(app_facenet_ctx.rknn_ctx, nullptr);
    if (ret < 0) {
    printf("rknn_run fail! ret=%d\n", ret);
    return -1;
    }
    uint8_t *output = (uint8_t *)(app_facenet_ctx.output_mems[0]->virt_addr);
    float* reference_out_fp32 = (float*)malloc(sizeof(float) * 128);
    output_normalization(&app_facenet_ctx,output,reference_out_fp32);
    memset(input_data,0,facenet_width * facenet_height * channels);

    float* out_fp32 = (float*)malloc(sizeof(float) * 128);
    char show_text[12];
    char fps_text[32];
    float fps = 0;
    printf("Loop\n");
    } here the image is taken as jpg mode but i want to process it in H265 mode
  • rajadey150@gmail.com wrote: 2024-04-16 10:26 //Get reference img feature
    cv::Mat image = cv::imread(image_path);
    unsigned char * input_data = (unsigned char *)app_facenet_ctx.input_mems[0]->virt_addr;
    letterbox(image,input_data);
    ret = rknn_run(app_facenet_ctx.rknn_ctx, nullptr);
    if (ret < 0) {
    printf("rknn_run fail! ret=%d\n", ret);
    return -1;
    }
    uint8_t *output = (uint8_t *)(app_facenet_ctx.output_mems[0]->virt_addr);
    float* reference_out_fp32 = (float*)malloc(sizeof(float) * 128);
    output_normalization(&app_facenet_ctx,output,reference_out_fp32);
    memset(input_data,0,facenet_width * facenet_height * channels);

    float* out_fp32 = (float*)malloc(sizeof(float) * 128);
    char show_text[12];
    char fps_text[32];
    float fps = 0;
    printf("Loop\n");
    } here the image is taken as jpg mode but i want to process it in H265 mode
    Due to the lack of hardware decoding support on Luckfox-pico and the fact that images in H.265 format are typically saved as video streams containing multiple frames, whereas RKNN only supports single-frame inference and also involves the H.265 packetization process, the resource consumption will be significantly higher compared to using JPG. Therefore, it's not recommended to use H.265 format. If you need to use H.265 format input, please refer to relevant audio and video encoding/decoding resources. Implementing this feature is quite complex, so you'll need to explore the implementation on your own.
  • Thank you for your input,

    1.As per previous discussion, I want to enhance my video fps and make it very smooth and real, now it is buffering and slow

    2.I wanted to increase my camera focus area so that it can cover most of the faces.

    Thank you for you input very much
  • rajadey150@gmail.com wrote: 2024-04-16 11:49 Thank you for your input,

    1.As per previous discussion, I want to enhance my video fps and make it very smooth and real, now it is buffering and slow

    2.I wanted to increase my camera focus area so that it can cover most of the faces.

    Thank you for you input very much
    1. If you need higher fluidity, you may have to consider sacrificing resolution. However, the model's input size is 640 * 640. If it's smaller than that, enlarging the image afterward could actually affect efficiency. Another direction for improvement is the image display process. Consider using DMA to transfer images to the SPI screen, or using mmap to operate the screen as a framebuffer device. Both of these methods have been mentioned in previous answers and can be tested accordingly.

    2. The current camera uses a photosensitive sensor with a maximum operational resolution of 2304x1296, which is the theoretical maximum amount of information that can be captured. You can try capturing images at the maximum resolution and then compressing and cropping them to fit into the RKNN model.

    The above answers are based on reliable solutions obtained from data. Further testing and development will require your exploration. Since we don't have optimization plans for these two issues and haven't conducted related testing, please understand that we cannot provide further details on subsequent testing.
  • Sir,
    we are ready to sacrifice the resolution,

    Consider using DMA to transfer images to the SPI screen, or using mmap to operate the screen as a framebuffer device. Both of these methods have been mentioned in previous answers and can be tested accordingly.

    can you please explain it briefly so i can try it?

    thank you
  • rajadey150@gmail.com wrote: 2024-04-16 12:19 Sir,
    we are ready to sacrifice the resolution,

    Consider using DMA to transfer images to the SPI screen, or using mmap to operate the screen as a framebuffer device. Both of these methods have been mentioned in previous answers and can be tested accordingly.

    can you please explain it briefly so i can try it?

    thank you

    Both of these methods are extensively covered online on how to implement them, and they are both universally applicable in the ARM Linux environment.
    As I mentioned earlier, since we haven't conducted any testing, I find it difficult to explain them further.