From c135e53bfc71cebd7ae7a721e47626c4a2702819 Mon Sep 17 00:00:00 2001 From: novak-99 <78002988+novak-99@users.noreply.github.com> Date: Mon, 24 May 2021 21:25:11 -0700 Subject: [PATCH] Updated Data.cpp --- MLPP/Data/Data.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MLPP/Data/Data.cpp b/MLPP/Data/Data.cpp index a86239e..43ba2ec 100644 --- a/MLPP/Data/Data.cpp +++ b/MLPP/Data/Data.cpp @@ -140,6 +140,15 @@ namespace MLPP{ // Images + void Data::getImage(std::string fileName, std::vector& image){ + std::ifstream img(fileName, std::ios::binary); + if(!img.is_open()){ + std::cout << "The file failed to open." << std::endl; + } + std::vector v{std::istreambuf_iterator{img}, {}}; + image = v; + } + // TEXT-BASED & NLP std::string Data::toLower(std::string text){ for(int i = 0; i < text.size(); i++){