| 1426 | } |
| 1427 | |
| 1428 | void mtmd_debug_encode_image(mtmd_context * ctx, const std::vector<std::vector<float>> & image) { |
| 1429 | if (!ctx->ctx_v) { |
| 1430 | LOG_ERR("%s: model does not support vision input\n", __func__); |
| 1431 | return; |
| 1432 | } |
| 1433 | clip_image_f32 inp_image; |
| 1434 | inp_image.nx = image.size(); |
| 1435 | inp_image.ny = inp_image.nx; |
| 1436 | inp_image.buf.reserve(inp_image.nx * inp_image.ny); |
| 1437 | for (const auto & row : image) { |
| 1438 | inp_image.buf.insert(inp_image.buf.end(), row.begin(), row.end()); |
| 1439 | } |
| 1440 | LOG_INF("%s: created input image with nx=%d, ny=%d\n", __func__, inp_image.nx, inp_image.ny); |
| 1441 | mtmd_debug_encode_impl(ctx, ctx->ctx_v, inp_image); |
| 1442 | } |
| 1443 | |
| 1444 | void mtmd_debug_encode_audio(mtmd_context * ctx, const std::vector<float> & input) { |
| 1445 | if (!ctx->ctx_a) { |