| 107 | int ObjectCount(bool masks) { return masks ? 7 : 194; } |
| 108 | |
| 109 | std::vector<int> CopyIds(Workspace &ws, int ids_out_idx = 3) { |
| 110 | auto &output = ws.Output<dali::CPUBackend>(ids_out_idx); |
| 111 | const auto &shape = output.shape(); |
| 112 | |
| 113 | vector<int> ids(shape.size()); |
| 114 | |
| 115 | auto *out_ptr = ids.data(); |
| 116 | for (int sample_idx = 0; sample_idx < shape.num_samples(); sample_idx++) { |
| 117 | MemCopy( |
| 118 | out_ptr, |
| 119 | output.tensor<int>(sample_idx), |
| 120 | shape[sample_idx].num_elements() * sizeof(int)); |
| 121 | out_ptr += shape[sample_idx].num_elements(); |
| 122 | } |
| 123 | cudaStreamSynchronize(0); |
| 124 | return ids; |
| 125 | } |
| 126 | |
| 127 | void RunTestForPipeline(Pipeline &pipe, bool ltrb, bool ratio, bool skip_empty, int expected_size, |
| 128 | bool polygon_masks = false, bool polygon_masks_legacy = false) { |
no test coverage detected