Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/decart/models.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace models {
/// Resolve a realtime model by name.
///
/// 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-3", "lucy-vton-3.5", "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).
///
Expand Down
6 changes: 4 additions & 2 deletions src/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@ struct Entry {

// Realtime model registry. Kept in sync with the shared model list across the
// Decart SDKs. All realtime models stream over `/v1/stream`.
constexpr std::array<Entry, 9> kRealtime = {{
constexpr std::array<Entry, 10> kRealtime = {{
// Canonical
{"lucy-2.1", 30, 1088, 624, true},
{"lucy-2.5", 30, 1280, 720, true},
{"lucy-vton-2", 30, 1088, 624, true},
{"lucy-vton-3", 30, 1088, 624, true},
{"lucy-vton-3.5", 30, 1280, 720, true},
{"lucy-restyle-2", 30, 1280, 704, true},
// Server-resolved "latest" aliases
{"lucy-latest", 30, 1088, 624, false},
{"lucy-vton-latest", 30, 1088, 624, false},
// Resolves server-side to lucy-vton-3.5.
{"lucy-vton-latest", 30, 1280, 720, false},
{"lucy-restyle-latest", 30, 1280, 704, false},
// Deprecated aliases (still accepted)
{"lucy-2.1-vton-2", 30, 1088, 624, false},
Expand Down
11 changes: 10 additions & 1 deletion tests/test_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") {
CHECK(vton.width == 1088);
CHECK(vton.height == 624);

auto vton35 = models::realtime("lucy-vton-3.5");
CHECK(vton35.name == "lucy-vton-3.5");
CHECK(vton35.urlPath == "/v1/stream");
CHECK(vton35.fps == 30);
CHECK(vton35.width == 1280);
CHECK(vton35.height == 720);

auto lucy25 = models::realtime("lucy-2.5");
CHECK(lucy25.name == "lucy-2.5");
CHECK(lucy25.urlPath == "/v1/stream");
Expand All @@ -29,6 +36,8 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") {
TEST_CASE("realtime() accepts latest and deprecated aliases") {
CHECK(models::realtime("lucy-latest").urlPath == "/v1/stream");
CHECK(models::realtime("lucy-vton-latest").name == "lucy-vton-latest");
CHECK(models::realtime("lucy-vton-latest").width == 1280);
CHECK(models::realtime("lucy-vton-latest").height == 720);
CHECK(models::isRealtimeModel("lucy-2.1-vton-2"));
}

Expand All @@ -47,6 +56,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() == 5);
CHECK(canonical.size() == 6);
CHECK(all.size() > canonical.size());
}
Loading