ENH: disable skip when objects number>64 or model is not support

Jira: [TUDIO-13411]

Change-Id: I93617965e69ba72a1cc34dd0981b8fd92eb58d3a
(cherry picked from commit 417109e5f02613bd18eae125705effa7ae61cfda)
This commit is contained in:
hemai
2025-07-15 21:55:18 +08:00
committed by Noisyfox
parent c6cd14eb6b
commit eaa545f71f
4 changed files with 37 additions and 5 deletions

View File

@@ -649,6 +649,7 @@ void XMLCALL ModelSettingHelper::StartElementHandler(void *userData, const XML_C
if (strcmp(atts[i], "value") == 0) value = atts[i + 1];
}
if (key == "index") { self->context_.current_plate.index = std::stoi(value); }
if (key == "label_object_enabled") { self->context_.current_plate.label_object_enabled = value == "true"; }
} else if (strcmp(name, "object") == 0 && self->context_.in_plate) {
ObjectInfo obj;
for (int i = 0; atts[i]; i += 2) {
@@ -678,6 +679,14 @@ std::vector<ObjectInfo> ModelSettingHelper::GetPlateObjects(int plate_idx) {
return std::vector<ObjectInfo>();
}
bool ModelSettingHelper::GetLabelObjectEnabled(int plate_idx)
{
for (const auto &plate : context_.plates) {
if (plate.index == plate_idx) { return plate.label_object_enabled; }
}
return false;
}
void ModelSettingHelper::DataHandler(const XML_Char *s, int len)
{
// do nothing