MCPcopy Create free account
hub / github.com/PABannier/sam3.cpp / print_table

Function print_table

examples/benchmark.cpp:400–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398// ── Table printing ──────────────────────────────────────────────────────────
399
400static void print_table(const std::vector<BenchResult> & results,
401 const std::string & video_path,
402 float px, float py, int n_frames, int n_threads) {
403 printf("\n");
404 printf("=========================================================================================================\n");
405 printf("SAM3.CPP BENCHMARK — %d frames, point=(%.1f, %.1f), threads=%d\n", n_frames, px, py, n_threads);
406 printf("video: %s\n", video_path.c_str());
407 printf("=========================================================================================================\n\n");
408
409 printf(" %3s | %-36s | %7s | %6s | %9s | %9s | %13s | %10s | %3s | %s\n",
410 "#", "Model", "Size", "Backend", "Load (ms)", "Init (ms)", "Track/fr (ms)", "Total (ms)", "Det", "Status");
411 printf("------+--------------------------------------+---------+--------+-----------+-----------+---------------+------------+-----+--------\n");
412
413 for (size_t i = 0; i < results.size(); i++) {
414 const auto & r = results[i];
415 if (r.success) {
416 printf(" %3d | %-36s | %7s | %6s | %9s | %9s | %13s | %10s | %3d | OK\n",
417 (int)(i + 1),
418 r.model_name.c_str(),
419 format_size(r.file_size).c_str(),
420 r.backend.c_str(),
421 format_time_short(r.t_load_ms).c_str(),
422 format_time_short(r.t_frame0_ms).c_str(),
423 format_time_short(r.t_track_avg_ms).c_str(),
424 format_time_short(r.t_total_ms).c_str(),
425 r.n_detections);
426 } else {
427 printf(" %3d | %-36s | %7s | %6s | %9s | %9s | %13s | %10s | %3s | FAIL: %s\n",
428 (int)(i + 1),
429 r.model_name.c_str(),
430 format_size(r.file_size).c_str(),
431 r.backend.c_str(),
432 r.t_load_ms > 0 ? format_time_short(r.t_load_ms).c_str() : "-",
433 "-", "-", "-", "-",
434 r.error.c_str());
435 }
436 }
437
438 printf("------+--------------------------------------+---------+--------+-----------+-----------+---------------+------------+-----+--------\n");
439
440 int n_ok = 0, n_fail = 0;
441 for (const auto & r : results) { if (r.success) n_ok++; else n_fail++; }
442 printf("\nSUMMARY: %d runs, %d OK, %d FAIL\n", (int)results.size(), n_ok, n_fail);
443}
444
445// ── Main ────────────────────────────────────────────────────────────────────
446

Callers 1

mainFunction · 0.70

Calls 2

format_sizeFunction · 0.85
format_time_shortFunction · 0.85

Tested by

no test coverage detected