Spaces:

File size: 5,902 Bytes
5aefcf4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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