Generates appropriate output accessor according to the specified graph parameters * * @note If the output accessor is requested to validate the graph then ValidationOutputAccessor is generated * else if output_accessor_file is empty will generate a DummyAccessor else will generate a TopNPredictionsAccessor * * @param[in] graph_parameters Graph parameters * @param[in] tensor_shapes
| 580 | * @return An appropriate tensor accessor |
| 581 | */ |
| 582 | inline std::unique_ptr<graph::ITensorAccessor> |
| 583 | get_detection_output_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, |
| 584 | std::vector<TensorShape> tensor_shapes, |
| 585 | bool is_validation = false, |
| 586 | std::ostream &output_stream = std::cout) |
| 587 | { |
| 588 | ARM_COMPUTE_UNUSED(is_validation); |
| 589 | if (!graph_parameters.validation_file.empty()) |
| 590 | { |
| 591 | return std::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, output_stream, |
| 592 | graph_parameters.validation_range_start, |
| 593 | graph_parameters.validation_range_end); |
| 594 | } |
| 595 | else if (graph_parameters.labels.empty()) |
| 596 | { |
| 597 | return std::make_unique<DummyAccessor>(0); |
| 598 | } |
| 599 | else |
| 600 | { |
| 601 | return std::make_unique<DetectionOutputAccessor>(graph_parameters.labels, tensor_shapes, output_stream); |
| 602 | } |
| 603 | } |
| 604 | /** Generates appropriate npy output accessor according to the specified npy_path |
| 605 | * |
| 606 | * @note If npy_path is empty will generate a DummyAccessor else will generate a NpyAccessor |
no test coverage detected