Spaces:

arjun.a
range data
5aefcf4
raw
history blame
5.9 kB
Ticket Name: TDA2: TIDL-1.1 SSD model test application output
Query Text:
Part Number: TDA2 Hi , I changed config_list.txt to "1 C:\PROCESSOR_SDK_VISION_03_03_00_00\ti_components\algorithms\REL.TIDL.01.01.00.00\modules\ti_dl\test\testvecs\config\infer\tidl_config_jdetnet.txt" so that it can run the SSD model and look at the profile output and the output result. The result bin file contains 560 values for 768X320 image. How to make sense of this output bin file? Can we extract bounding boxes from this data?
Responses:
Refer Line number for 327 for output for of SSD object detection layer for output format. github.com/.../detection_output_layer.cpp It is 20 bounding box parameter each 7 float values (20x7x4). Please refer vision SDK OD use case example code for more details. This network is optimal when split between EVE and DSP (Tail end layers are best optimal on DSP). Set runFullNet = 0 in the infer config file for EVE profile numbers only. We would recommend the Vision SDK profile log for better understanding SSD performance.
Hi Kumar, Thank you for the reply. Now I'm able to make sense of the output and the profile numbers are accurate. I have few more questions: 1) How many classifications are possible. In the given test input I see pedestrian, road sign and one another. 2)How many layers run on EVE and how many on DSP? 3)I'm attaching the output bin file(changed the extension to .lib). One of the bounding boxes values is wrong. It's ymax is less than ymin and Is classified as 3 with a confidence of 0.7. it is marked as blue in the image attached. Can you please confirm whether the output is correct. Because I do not have a reference bin file for this. stats_tool_out_eve.lib
1. The model that is used in demo was trained with 4 classes. increasing the number of classes (We have tested with 21, we can increase further as well) will have minimal imapact on EVE performace and will have considerable impact on DSP performace . 2. layers with layersGroupId == 1 are running on EVE and and layers with layersGroupId == 2 are running on DSP 3.The vehicle (atleaste three) in the images also needs to be detected. Can you run the model with "runFullNet = 1" on EVE and check whether you observe the Bbox for vehicle. Because of cahce coherency issues in the stanalone test bench, the output may be wrong some time in the DSP
I had run it with runFullNet = 1 and on an EVE simulator...
Could you please try on target (EVE), We have not tried recently on EVE simulator.
I tried it on the target. The results still remain the same.
Hi, The output (stats_tool_out_eve.lib) you attached in previous post looks correct and I used the same for visualisation. See below screenshot for your reference. So, looks like there is some problem in your visualisation tool. Please check. Thanks, Praveen
Hi Praveen, I'm attaching my c code to read the bin file and draw the BB on the image. Let me know whether its the right way to read values from the bin file. markBox.c #include <stdio.h>
#include <stdint.h>
int main()
{
FILE *fi, *fb, *fout;
float data[4];
float label;
float dummy;
uint8_t orig[768*320];
uint8_t result[768*320*3];
int x1, x2;
uint16_t xmin, ymin, xmax, ymax;
uint8_t value;
uint8_t Red, Green, Blue;
fi = fopen("trace_dump_0_768x320.raw", "r");
fb = fopen("stats_tool_out_eve.bin", "r");
fout = fopen("markedBoxes.ppm", "w");
fread(&orig[0], 768 * 320, sizeof(uint8_t), fi);
for(x1 = 0; x1 < 320; x1 ++)
{
for(x2 = 0; x2 < 768; x2 ++)
{
value = orig[(x1 * 768) + x2];
result[(x1 * 768 * 3) + (x2 * 3)]= value;
result[(x1 * 768 * 3) + (x2 * 3) + 1] = value;
result[(x1 * 768 * 3) + (x2 * 3) + 2] = value;
}
}
for(x2 = 0; x2 < 20; x2 ++)
{
fread(&dummy, 1, sizeof(float), fb);
fread(&label, 1, sizeof(float), fb);
fread(&dummy, 1, sizeof(float), fb);
fread(&data[0], 4, sizeof(float), fb);
xmin = (uint16_t)(data[0] * 768);
ymin = (uint16_t)(data[1] * 320);
xmax = (uint16_t)(data[2] * 768);
ymax = (uint16_t)(data[3] * 320);
// printf("data[3] = %f, ymax = %d\n", data[3], ymax);
// printf("%f - (%f, %f) (%f, %f) - %f\n", label, data[0], data[1], data[2], data[3], dummy);
printf("%d - (%d, %d) (%d, %d) - %f\n\n", (uint8_t)label, xmin, ymin, xmax, ymax, dummy);
if(label == 1)
{
Red = 255;
Green = 0;
Blue = 0;
}
if(label == 2)
{
Red = 0;
Green = 255;
Blue = 0;
}
if(label == 3)
{
Red = 0;
Green = 0;
Blue = 255;
}
for(x1 = xmin; x1 <= xmax; x1 ++)
{
result[(ymin * 768 * 3) + (x1 * 3)] = Red;
result[(ymin * 768 * 3) + (x1 * 3) + 1] = Green;
result[(ymin * 768 * 3) + (x1 * 3) + 2] = Blue;
}
for(x1 = xmin; x1 <= xmax; x1 ++)
{
result[(ymax * 768 * 3) + (x1 * 3)] = Red;
result[(ymax * 768 * 3) + (x1 * 3) + 1] = Green;
result[(ymax * 768 * 3) + (x1 * 3) + 2] = Blue;
}
for(x1 = ymin; x1 <= ymax ; x1 ++)
{
result[(x1 * 768 * 3) + (xmin * 3)] = Red;
result[(x1 * 768 * 3) + (xmin * 3) + 1] = Green;
result[(x1 * 768 * 3) + (xmin * 3) + 2] = Blue;
}
for(x1 = ymin; x1 <= ymax ; x1 ++)
{
result[(x1 * 768 * 3) + (xmax * 3)] = Red;
result[(x1 * 768 * 3) + (xmax * 3) + 1] = Green;
result[(x1 * 768 * 3) + (xmax * 3) + 2] = Blue;
}
}
fprintf(fout, "P3 768 320 255 ");
for(x1 = 0; x1 < 768 * 320 * 3; x1 ++)
fprintf(fout, "%d ", result[x1]);
fclose(fi);
fclose(fb);
fclose(fout);
return 1;
} I feel its right because it works for all others except for vehicle detection values.
Hi Praveen, I fixed it. I was reading the bin file in text mode on windows, hence it was hitting a early EOF. I opened it in binary mode and now it runs fine. Thank you
Hi, Thanks for the update. Glad to hear that. Regards, Praveen