From edac743b396679d1394c54fca751df6a91536da1 Mon Sep 17 00:00:00 2001 From: Adir Amsalem Date: Sun, 5 Jul 2026 21:06:25 +0300 Subject: [PATCH] feat(realtime): add lucy-2.5 realtime model Register `lucy-2.5` as a canonical realtime model streaming over `/v1/stream` at 1088x624. Adds a per-model `fps` field to the registry (previously hardcoded to 30) so future models can vary the capture rate. Brings the C++ SDK in line with the other Decart SDKs. --- include/decart/models.h | 2 +- src/models.cpp | 26 ++++++++++++++------------ tests/test_models.cpp | 9 ++++++++- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/include/decart/models.h b/include/decart/models.h index 1f8a97b..be8ca6f 100644 --- a/include/decart/models.h +++ b/include/decart/models.h @@ -27,7 +27,7 @@ namespace models { /// Resolve a realtime model by name. /// -/// Accepts canonical names ("lucy-2.1", "lucy-vton-2", +/// Accepts canonical names ("lucy-2.1", "lucy-2.5", "lucy-vton-2", /// "lucy-vton-3", "lucy-restyle-2"), server-resolved aliases ("lucy-latest", /// "lucy-vton-latest", "lucy-restyle-latest"), and deprecated names (which emit /// no error but resolve to the same stream endpoint). diff --git a/src/models.cpp b/src/models.cpp index b90f000..b497c55 100644 --- a/src/models.cpp +++ b/src/models.cpp @@ -13,26 +13,28 @@ constexpr const char* kStreamPath = "/v1/stream"; struct Entry { const char* name; + int fps; int width; int height; bool canonical; // false for "latest"/deprecated aliases }; // Realtime model registry. Kept in sync with the shared model list across the -// Decart SDKs. All realtime models stream over `/v1/stream` at 30 fps. -constexpr std::array kRealtime = {{ +// Decart SDKs. All realtime models stream over `/v1/stream`. +constexpr std::array kRealtime = {{ // Canonical - {"lucy-2.1", 1088, 624, true}, - {"lucy-vton-2", 1088, 624, true}, - {"lucy-vton-3", 1088, 624, true}, - {"lucy-restyle-2", 1280, 704, true}, + {"lucy-2.1", 30, 1088, 624, true}, + {"lucy-2.5", 30, 1088, 624, true}, + {"lucy-vton-2", 30, 1088, 624, true}, + {"lucy-vton-3", 30, 1088, 624, true}, + {"lucy-restyle-2", 30, 1280, 704, true}, // Server-resolved "latest" aliases - {"lucy-latest", 1088, 624, false}, - {"lucy-vton-latest", 1088, 624, false}, - {"lucy-restyle-latest", 1280, 704, false}, + {"lucy-latest", 30, 1088, 624, false}, + {"lucy-vton-latest", 30, 1088, 624, false}, + {"lucy-restyle-latest", 30, 1280, 704, false}, // Deprecated aliases (still accepted) - {"mirage_v2", 1280, 704, false}, - {"lucy-2.1-vton-2", 1088, 624, false}, + {"mirage_v2", 30, 1280, 704, false}, + {"lucy-2.1-vton-2", 30, 1088, 624, false}, }}; const Entry* find(std::string_view name) { @@ -43,7 +45,7 @@ const Entry* find(std::string_view name) { } ModelDefinition toDefinition(const Entry& e) { - return ModelDefinition{e.name, kStreamPath, 30, e.width, e.height}; + return ModelDefinition{e.name, kStreamPath, e.fps, e.width, e.height}; } } // namespace diff --git a/tests/test_models.cpp b/tests/test_models.cpp index aab7bda..d644183 100644 --- a/tests/test_models.cpp +++ b/tests/test_models.cpp @@ -17,6 +17,13 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") { auto vton = models::realtime("lucy-vton-3"); CHECK(vton.width == 1088); CHECK(vton.height == 624); + + auto lucy25 = models::realtime("lucy-2.5"); + CHECK(lucy25.name == "lucy-2.5"); + CHECK(lucy25.urlPath == "/v1/stream"); + CHECK(lucy25.fps == 30); + CHECK(lucy25.width == 1088); + CHECK(lucy25.height == 624); } TEST_CASE("realtime() accepts latest and deprecated aliases") { @@ -41,6 +48,6 @@ TEST_CASE("realtime() throws ModelNotFound for unknown names") { TEST_CASE("listRealtime() honors canonicalOnly") { auto all = models::listRealtime(/*canonicalOnly=*/false); auto canonical = models::listRealtime(/*canonicalOnly=*/true); - CHECK(canonical.size() == 4); + CHECK(canonical.size() == 5); CHECK(all.size() > canonical.size()); }