| 8 | #include "AutoModel/modeling_gemma3.hpp" |
| 9 | |
| 10 | bytes Gemma3::load_image(const std::string& filename) { |
| 11 | constexpr int target_width = 896; |
| 12 | constexpr int target_height = 896; |
| 13 | |
| 14 | image_data_t decoded; |
| 15 | image_data_t resized; |
| 16 | |
| 17 | if (!image_reader_.load_image(filename, decoded)) { |
| 18 | return bytes(); |
| 19 | } |
| 20 | |
| 21 | if (!image_reader_.resize_image(decoded, target_width, target_height, resized)) { |
| 22 | image_reader_.recycle(decoded); |
| 23 | return bytes(); |
| 24 | } |
| 25 | |
| 26 | image_reader_.recycle(decoded); |
| 27 | bytes result = std::move(resized.pixels); |
| 28 | resized.width = 0; |
| 29 | resized.height = 0; |
| 30 | return result; |
| 31 | } |
| 32 | |
| 33 | bytes Gemma3::load_image_base64(const std::string& base64_string) { |
| 34 | constexpr int target_width = 896; |
nothing calls this directly
no test coverage detected