Skip to content

Commit

Permalink
Update image_io.cpp
Browse files Browse the repository at this point in the history
STBIR_RGBA replaced with static_cast<stbir_pixel_layout>(depth)
  • Loading branch information
amirtronix authored Oct 28, 2023
1 parent a5f9885 commit 8d8814b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/image_io/src/image_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ torch::Tensor load_image(const std::string& file_path,
std::vector<unsigned char> image_resized_buffer(buffer_size);

stbir_resize_uint8_linear(image_raw.get(), width, height, 0,
image_resized_buffer.data(), new_width, new_height, 0, STBIR_RGBA);
image_resized_buffer.data(), new_width, new_height, 0, static_cast<stbir_pixel_layout>(depth));

return transform(torch::from_blob(image_resized_buffer.data(),
{new_height, new_width, depth}, torch::kUInt8).clone().to(torch::kFloat32).permute({2, 0, 1}).div_(255));
Expand Down

0 comments on commit 8d8814b

Please sign in to comment.