arm_compute v17.12
diff --git a/utils/GraphUtils.cpp b/utils/GraphUtils.cpp
index bcfc0f7..b9be9d4 100644
--- a/utils/GraphUtils.cpp
+++ b/utils/GraphUtils.cpp
@@ -32,7 +32,6 @@
#include "arm_compute/core/Error.h"
#include "arm_compute/core/PixelValue.h"
-#include "libnpy/npy.hpp"
#include <algorithm>
#include <iomanip>
@@ -99,6 +98,9 @@
// Open PPM file
ppm.open(_ppm_path);
+ ARM_COMPUTE_ERROR_ON_MSG(ppm.width() != tensor.info()->dimension(0) || ppm.height() != tensor.info()->dimension(1),
+ "Failed to load image file: dimensions [%d,%d] not correct, expected [%d,%d].", ppm.width(), ppm.height(), tensor.info()->dimension(0), tensor.info()->dimension(1));
+
// Fill the tensor with the PPM content (BGR)
ppm.fill_planar_tensor(tensor, _bgr);
@@ -299,30 +301,12 @@
// Open file
std::ifstream stream(_filename, std::ios::in | std::ios::binary);
ARM_COMPUTE_ERROR_ON_MSG(!stream.good(), "Failed to load binary data");
- // Check magic bytes and version number
- unsigned char v_major = 0;
- unsigned char v_minor = 0;
- npy::read_magic(stream, &v_major, &v_minor);
-
- // Read header
- std::string header;
- if(v_major == 1 && v_minor == 0)
- {
- header = npy::read_header_1_0(stream);
- }
- else if(v_major == 2 && v_minor == 0)
- {
- header = npy::read_header_2_0(stream);
- }
- else
- {
- ARM_COMPUTE_ERROR("Unsupported file format version");
- }
+ std::string header = npy::read_header(stream);
// Parse header
bool fortran_order = false;
std::string typestr;
- npy::ParseHeader(header, typestr, &fortran_order, shape);
+ npy::parse_header(header, typestr, fortran_order, shape);
// Check if the typestring matches the given one
std::string expect_typestr = arm_compute::utils::get_typestring(tensor.info()->data_type());
@@ -363,4 +347,4 @@
});
}
return true;
-}
\ No newline at end of file
+}