Nx5 taxonomy hierarchy
AnsweredI see that there are "nx.base.Vehicle", "nx.base.Car", "nx.base.Bus" and "nx.base.Truck".
Can I add all of them as "nx.base.Vehicle" and then specify their type via adding attributes?
If so, how can I do that?
-
Hi, Hendrick!
sorry for the late response..
I think it's possible, there are several ways of doing it:- (recommended) Declare a new object type, that will be derived from nx.base.Vehicle. Make it hiddenDerivedType (see taxonomy.md for the details)
And declare a new attribute, that should be an enum. And in GUI it will look like the Size attribute:
This way your analytics will use universal taxonomy and it will look and work the same way with any other integrated analytics, across all cameras.
- Declare your own object type, which will use the Vehicle icon (see "icon" in taxonomy.md) and it will have its own attribute list, including the subtype.
This way your object type will use a custom type and it will differ from other analytics and in search, it will appear as a different object type.
0 - (recommended) Declare a new object type, that will be derived from nx.base.Vehicle. Make it hiddenDerivedType (see taxonomy.md for the details)
-
Hello, Tagir!
Ok, I see that I can declare a hidden object and add attributes to it. But it means that I don't use "nx.base.Car" and other base classes, and define my own enum with my own attributes for vehicle types instead. Is it correct?
Should it look like the following?
"supportedTypes":
[
{
"objectTypeId": "mycompany.Vehicle",
"attributes":
[
"Type",
"Color",
"Model",
"License Plate",
"License Plate.Number"
],
"_comment": "hidden object"
}
],
"typeLibrary":
{
"objectTypes":
[
{
"id": "mycompany.Vehicle",
"name": "Vehicle",
"base": "nx.base.Vehicle",
"attributes":
[
{
"type": "Enum",
"subtype": "mycompany.VehicleEnumType",
"name": "Type",
},
],
}
],
"enumTypes":
[
{
"id": "mycompany.VehicleEnumType",
"name": "Vehicle Enum Type",
"items":
[
"Car",
"Bus",
"Truck"
]
}
]
}
Thank you for your answer0 -
Hi Hendrick,
It seems ok.
If you want a hidden object type, you should declare "flags":"hiddenDerivedType" in the obcetTypes.
{
"id": "mycompany.Vehicle",
"name": "Vehicle",
"base": "nx.base.Vehicle",
"flags":"hiddenDerivedType",
"attributes":
[
{
"type": "Enum",
"subtype": "mycompany.VehicleEnumType",
"name": "Type",
}
]
}Please, pay your attention that a comma is not needed after the last entity in a list or in an array.
0 -
Thanks, Andrey.
0
Please sign in to leave a comment.
Comments
4 comments