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
4 changes: 2 additions & 2 deletions include/decart/models.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ namespace models {
/// Resolve a realtime model by name.
///
/// Accepts canonical names ("lucy-2.1", "lucy-2.5", "lucy-vton-3.5",
/// "lucy-restyle-2") and server-resolved aliases ("lucy-latest",
/// "lucy-vton-latest", "lucy-restyle-latest").
/// "lucy-vton-3.6", "lucy-restyle-2") and server-resolved aliases
/// ("lucy-latest", "lucy-vton-latest", "lucy-restyle-latest").
///
/// @throws Exception(ErrorCode::ModelNotFound) if the name is unknown.
ModelDefinition realtime(std::string_view name);
Expand Down
3 changes: 2 additions & 1 deletion src/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ 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, 7> kRealtime = {{
constexpr std::array<Entry, 8> kRealtime = {{
// Canonical
{"lucy-2.1", 30, 1088, 624, true},
{"lucy-2.5", 30, 1280, 720, true, /*fastSpeed=*/true},
{"lucy-vton-3.5", 30, 1280, 720, true, /*fastSpeed=*/true},
{"lucy-vton-3.6", 30, 1280, 720, true},
{"lucy-restyle-2", 30, 1280, 704, true},
// Server-resolved "latest" aliases
{"lucy-latest", 30, 1088, 624, false, /*fastSpeed=*/true},
Expand Down
15 changes: 13 additions & 2 deletions tests/test_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ TEST_CASE("realtime() resolves canonical models with correct geometry") {
CHECK(vton35.width == 1280);
CHECK(vton35.height == 720);

auto vton36 = models::realtime("lucy-vton-3.6");
CHECK(vton36.name == "lucy-vton-3.6");
CHECK(vton36.urlPath == "/v1/stream");
CHECK(vton36.fps == 30);
CHECK(vton36.width == 1280);
CHECK(vton36.height == 720);
// 3.6 is not offered on the fast tier, unlike 3.5.
CHECK(vton36.supportedSpeeds.empty());

auto lucy25 = models::realtime("lucy-2.5");
CHECK(lucy25.name == "lucy-2.5");
CHECK(lucy25.urlPath == "/v1/stream");
Expand Down Expand Up @@ -76,15 +85,17 @@ TEST_CASE("supportedSpeeds advertises fast mode on exactly the lucy-2.5 and lucy
CHECK(m.supportedSpeeds.empty());
}
}
// Every other realtime model (lucy-2.1, lucy-restyle-2, lucy-restyle-latest) is standard-only.
// Every other realtime model (lucy-2.1, lucy-vton-3.6, lucy-restyle-2, lucy-restyle-latest)
// is standard-only.
CHECK(models::realtime("lucy-2.1").supportedSpeeds.empty());
CHECK(models::realtime("lucy-vton-3.6").supportedSpeeds.empty());
CHECK(models::realtime("lucy-restyle-2").supportedSpeeds.empty());
CHECK(models::realtime("lucy-restyle-latest").supportedSpeeds.empty());
}

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());
}
Loading