Closed caleb221 closed 2 years ago
What's wrong concretely ?
Oh! youre right i hadnt stated the problem, sorry about that. While this code does compile and run, the behavior is strange in that it comes off as almost constants (when the input is coming from the camera) For example, using this code will provide a valid result on the second iteration of the model, but after will no longer give any such results. I am looking into the camera configuration and other parts of the code, but I need to make sure I am using the library correctly so that I can locate where the bug is coming from
Can you get right results of convolutional networks, for each layer ? If so, then take a look into how processing the results.
Hello! For the life of me I cannot figure out what is wrong with an implementation of Pnet (smallest and first layer in MTCNN) the configuration is set to the same as the one in the example code (min_face = 0.07 and pyramid to 80) the input is a XGA frame buffer converted to a dl_marix3du_t, and then normalized and turned into the proper floating point dl_matrix3d_t the code is shown below, the weights are obtained from a .h file that adds values to input->items setOutput is a function that sets a global mtmn_net_t variable to the matrix given at the point of calling (0 for score, 1 for bounding boxes)
void pnetCore1(void *pvParameter) { printf("\n[PNET] HELLO P net!\n");
while(true)//xSemaphoreTake(skeletonKey,portMAX_DELAY))//true) {
xSemaphoreTake(skeletonKey,portMAX_DELAY);
//===================================== // PNET LAYER 1
//init weights getpnet_conv1_0(filt_c1);//pnetVals.h getpnet_conv1_1(bias1);//pnetvals.h getpnet_prelu1_0(prelu1);//pnetvals.h //calculate out1= dl_matrix3dff_conv_3x3(in,filt_c1,bias1,1,1,PADDING_VALID); //clean up dl_matrix3d_free(filt_c1); dl_matrix3d_free(bias1); //pool outPool=dl_matrix3d_pooling(out1,1,1,2,2,PADDING_VALID,DL_POOLING_MAX); //clean up dl_matrix3d_free(out1); dl_matrix3d_p_relu(outPool, prelu1); dl_matrix3d_free(prelu1);
//init weights getpnet_conv2_0(filt_c2); getpnet_conv2_1(bias2); getpnet_prelu2_0(prelu2); //calculate out2 = dl_matrix3dff_conv_3x3(outPool,filt_c2,bias2,1,1,PADDING_VALID); //clean up dl_matrix3d_free(outPool); //pool pool2=dl_matrix3d_pooling(out2,1,1,2,2,PADDING_VALID,DL_POOLING_MAX); //clean up dl_matrix3d_free(out2); dl_matrix3d_p_relu(pool2,prelu2); dl_matrix3d_free(prelu2);
score_out= dl_matrix3dff_conv_3x3(pool3,score_filter,score_bias,1,1,PADDING_VALID);
bbox_out = dl_matrix3dff_conv_3x3(pool3,bbox_filter,bbox_bias,1,1,PADDING_VALID); //dl_matrix3d_free(out3); dl_matrix3d_free(bbox_filter); dl_matrix3d_free(bbox_bias); dl_matrix3d_free(pool3); //========================================= // SET MEMORY //
//printf("\n\n");
printf("\n[PNET] Bye PNET!\n"); xSemaphoreGive(skeletonKey); vTaskDelay(1000/portTICK_PERIOD_MS); vTaskDelete( NULL ); }//endForeverWhile
printf("\n\n\n[PNET] I SHOULD NOT SEE THIS! \n\n\n"); //vTaskDelay(1000/portTICK_PERIOD_MS); for(; ; ) { vTaskDelay(1000/portTICK_PERIOD_MS); xSemaphoreGive(skeletonKey); printf(".");
vTaskDelete( NULL ); }
}