| 138 | } |
| 139 | |
| 140 | std::pair<int,int> Siglip2Preprocessor::get_grid_layout(int height, int width) { |
| 141 | float aspect_ratio = (float)width / (float)height; |
| 142 | auto [grid_width, grid_height] = find_closest_aspect_ratio(aspect_ratio, width, height); |
| 143 | |
| 144 | int target_width = config_.tile_size * grid_width; |
| 145 | int target_height = config_.tile_size * grid_height; |
| 146 | |
| 147 | return {target_width, target_height}; |
| 148 | } |
| 149 | |
| 150 | Siglip2Preprocessor::SpatialShapeResult Siglip2Preprocessor::compute_spatial_shapes(int height, int width) { |
| 151 | if (height <= 0 || width <= 0) { |
nothing calls this directly
no outgoing calls
no test coverage detected