MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / load_image

Method load_image

src/common/AutoModel/modeling_gemma4e_image.cpp:10–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include "AutoModel/modeling_gemma4e.hpp"
9#include <utility>
10gemma4e_image_t Gemma4e::load_image(const std::string &filename)
11{
12 gemma4e_image_t empty_result;
13 image_data_t decoded;
14 image_data_t reordered;
15 if (!image_reader_.load_image(filename, decoded))
16 {
17 return empty_result;
18 }
19
20 if (!image_reader_.reorder_hwc_to_chw(decoded, reordered))
21 {
22 image_reader_.recycle(decoded);
23 return empty_result;
24 }
25
26 image_reader_.recycle(decoded);
27
28 gemma4e_image_t result;
29 result.width = reordered.width;
30 result.height = reordered.height;
31 result._data = std::move(reordered.pixels);
32 image_reader_.recycle(reordered);
33 return result;
34}
35
36gemma4e_image_t Gemma4e::load_image_base64(const std::string &base64_string)
37{

Callers 1

insertMethod · 0.95

Calls 2

reorder_hwc_to_chwMethod · 0.80
recycleMethod · 0.80

Tested by

no test coverage detected