| 527 | } |
| 528 | |
| 529 | DetectionOutputAccessor::DetectionOutputAccessor(const std::string &labels_path, |
| 530 | std::vector<TensorShape> &imgs_tensor_shapes, |
| 531 | std::ostream &output_stream) |
| 532 | : _labels(), _tensor_shapes(std::move(imgs_tensor_shapes)), _output_stream(output_stream) |
| 533 | { |
| 534 | _labels.clear(); |
| 535 | |
| 536 | std::ifstream ifs; |
| 537 | |
| 538 | try |
| 539 | { |
| 540 | ifs.exceptions(std::ifstream::badbit); |
| 541 | ifs.open(labels_path, std::ios::in | std::ios::binary); |
| 542 | |
| 543 | for (std::string line; !std::getline(ifs, line).fail();) |
| 544 | { |
| 545 | _labels.emplace_back(line); |
| 546 | } |
| 547 | } |
| 548 | catch (const std::ifstream::failure &e) |
| 549 | { |
| 550 | ARM_COMPUTE_ERROR_VAR("Accessing %s: %s", labels_path.c_str(), e.what()); |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | template <typename T> |
| 555 | void DetectionOutputAccessor::access_predictions_tensor(ITensor &tensor) |