nx_metadata_sdk  1.0
Metadata SDK
Stub Object Streamer stream generation script

// Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/

The generate.py script is intended to be used for generation of custom stream and manifest files for the Object Streamer sub-plugin of the Stub Analytics Plugin.

Command line options

Example:

generate.py --config my_config.json --manifest-file my_manifest.json --stream-file stream.json
--compressed-stream

Configuration file format

Configuration file is a simple JSON file with a JSON object on the top level. The following settings are available:

Random movement generator settings

All fields are optional.

Example:

{
"objectCount": 5,
"streamDurationInFrames": 100,
"typeLibrary":
{
"objectTypes":
[
{
"id": "stub.objectStreamer.custom.type.1",
"name": "Stub OS: Custom Type 1"
}
]
},
"objectTemplates":
[
{
"objectTypeId": "nx.base.Vehicle",
"movementPolicy": "random",
"minWidth": 0.1,
"minHeight": 0.1,
"maxWidth": 0.3,
"maxHeight": 0.3,
"attributes":
{
"Color": "Red",
"Brand": "Ford",
"Model": "F150",
"LicensePlate.Number": "LHD 8448",
"LicensePlate.State/Province": "Texas",
"LicensePlate.Country": "USA"
},
"bestShots": [
{
"imageSource": "https://picsum.photos/200/300",
"frameNumber": 10,
"attributes": {
"some attribute": "attribute value"
}
}
]
},
{
"objectTypeId": "stub.objectStreamer.custom.type.1",
"movementPolicy": "random",
"attributes":
{
"string attribute 1": "first string attribute",
"string attribute 2": "second string attribute",
"number attribute 1": "0.1",
"number attribute 2": "300"
}
}
]
}