Skip to content

Commit

Permalink
Minor string fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
takeninenv committed May 28, 2024
1 parent 6c78f51 commit c1be876
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/flip/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,17 @@ std::tuple<py::array_t<float>, float, py::dict> evaluate(const py::array_t<float
py::buffer_info r_buf = referenceInput.request(), t_buf = testInput.request();

// Check number of dimensions and resolution.
if (r_buf.ndim != 3 || t_buf.ndim != 3){
if (r_buf.ndim != 3 || t_buf.ndim != 3)
{
std::stringstream message;
message << "Number of dimensions must be three. Reference image is " << r_buf.ndim << ", Test image is "<< t_buf.ndim;
message << "Number of dimensions must be three. The reference image has " << r_buf.ndim << " dimensions, while the test image has "<< t_buf.ndim << " dimensions.";
throw std::runtime_error(message.str());
}

if (r_buf.shape[0] != t_buf.shape[0] || r_buf.shape[1] != t_buf.shape[1] || r_buf.shape[2] != t_buf.shape[2]){
if (r_buf.shape[0] != t_buf.shape[0] || r_buf.shape[1] != t_buf.shape[1])
{
std::stringstream message;
message << "Reference and Test image resolutions differ. Reference image is " << r_buf.shape[0] << "x" << r_buf.shape[1] << ", Test image is "<< t_buf.shape[0] << "x" << t_buf.shape[1];
message << "Reference and test image resolutions differ.\nReference image resolution: " << r_buf.shape[0] << "x" << r_buf.shape[1] << "\nTest image resolution: "<< t_buf.shape[0] << "x" << t_buf.shape[1];
throw std::runtime_error(message.str());
}

Expand Down

0 comments on commit c1be876

Please sign in to comment.