MCPcopy Create free account
hub / github.com/NVIDIA/DALI / StoreBox

Function StoreBox

dali/operators/segmentation/random_object_bbox.cc:245–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243
244template <typename Lo, typename Hi>
245void StoreBox(const OutListCPU<int, 1> &out1,
246 const OutListCPU<int, 1> &out2,
247 RandomObjectBBox::OutputFormat format,
248 int sample_idx, Lo &&start, Hi &&end) {
249 assert(dali::size(start) == dali::size(end));
250 int ndim = dali::size(start);
251 switch (format) {
252 case RandomObjectBBox::Out_Box:
253 for (int i = 0; i < ndim; i++) {
254 out1.data[sample_idx][i] = start[i];
255 out1.data[sample_idx][i + ndim] = end[i];
256 }
257 break;
258 case RandomObjectBBox::Out_AnchorShape:
259 for (int i = 0; i < ndim; i++) {
260 out1.data[sample_idx][i] = start[i];
261 out2.data[sample_idx][i] = end[i] - start[i];
262 }
263 break;
264 case RandomObjectBBox::Out_StartEnd:
265 for (int i = 0; i < ndim; i++) {
266 out1.data[sample_idx][i] = start[i];
267 out2.data[sample_idx][i] = end[i];
268 }
269 break;
270 default:
271 assert(!"Unreachable code");
272 }
273}
274
275template <typename Box>
276void StoreBox(const OutListCPU<int, 1> &out1,

Callers 1

RunImplMethod · 0.85

Calls 1

sizeFunction · 0.50

Tested by

no test coverage detected