From 7c3b92403958e8970e901fd15b2fc904e7996eee Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 21 Jun 2018 19:01:25 +0100 Subject: COMPMID-1308: Add and validate JPEG accessors Change-Id: I93d7345a795b26153600287346d672209dbb2622 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/137479 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- utils/GraphUtils.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'utils/GraphUtils.h') diff --git a/utils/GraphUtils.h b/utils/GraphUtils.h index 597708369d..349d8558fc 100644 --- a/utils/GraphUtils.h +++ b/utils/GraphUtils.h @@ -157,7 +157,7 @@ public: /** Constructor * * @param[in] ppm_path Path to PPM file - * @param[in] bgr (Optional) Fill the first plane with blue channel (default = false) + * @param[in] bgr (Optional) Fill the first plane with blue channel (default = false - RGB format) * @param[in] preprocessor (Optional) PPM pre-processing object */ PPMAccessor(std::string ppm_path, bool bgr = true, std::unique_ptr preprocessor = nullptr); @@ -173,6 +173,36 @@ private: std::unique_ptr _preprocessor; }; +/** Input Accessor used for network validation */ +class ValidationInputAccessor final : public graph::ITensorAccessor +{ +public: + /** Constructor + * + * @param[in] image_list File containing all the images to validate + * @param[in] images_path Path to images. + * @param[in] bgr (Optional) Fill the first plane with blue channel (default = false - RGB format) + * @param[in] start (Optional) Start range + * @param[in] end (Optional) End range + * + * @note + */ + ValidationInputAccessor(const std::string &image_list, + std::string images_path, + bool bgr = true, + unsigned int start = 0, + unsigned int end = 0); + + // Inherited methods overriden: + bool access_tensor(ITensor &tensor) override; + +private: + std::string _path; + std::vector _images; + bool _bgr; + size_t _offset; +}; + /** Result accessor class */ class TopNPredictionsAccessor final : public graph::ITensorAccessor { -- cgit v1.2.1