| 30 | vector<float> anchors_; |
| 31 | |
| 32 | void RunForCocoCpu(const vector<float> &anchors, float criteria, bool offset = false) { |
| 33 | this->SetBatchSize(coco_batch_size); |
| 34 | this->AddExternalInputs({{"bboxes", &this->boxes_}, {"labels", &this->labels_}}); |
| 35 | this->AddSingleOp(OpSpec("BoxEncoder") |
| 36 | .AddArg("device", "cpu") |
| 37 | .AddArg("criteria", criteria) |
| 38 | .AddArg("anchors", anchors) |
| 39 | .AddArg("offset", offset) |
| 40 | .AddArg("scale", 300.0f) |
| 41 | .AddArg("stds", std::vector<float>({0.1f, 0.1f, 0.2f, 0.2f})) |
| 42 | .AddInput("bboxes", StorageDevice::CPU) |
| 43 | .AddInput("labels", StorageDevice::CPU) |
| 44 | .AddOutput("encoded_bboxes", StorageDevice::CPU) |
| 45 | .AddOutput("encoded_labels", StorageDevice::CPU)); |
| 46 | |
| 47 | dali::Workspace ws; |
| 48 | this->RunOperator(&ws); |
| 49 | this->CheckAnswersForCocoOnCpu(&ws, offset); |
| 50 | } |
| 51 | |
| 52 | void RunForCocoGpu(const vector<float> &anchors, float criteria, bool offset = false) { |
| 53 | this->SetBatchSize(coco_batch_size); |
no test coverage detected