Constructor
new Occupancy()
- Source:
Methods
(async) getAverageFovOccupancy(documentDb, input) → {Promise.<Object>}
- Description:
- returns an object containing average fov occupancy.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {sensorId: "abc", fromTimestamp: "2023-01-12T11:20:10.000Z", toTimestamp: "2023-01-12T14:20:10.000Z"};
let occupancyObject = new mdx.Metrics.Occupancy();
let occupancyResult = await occupancyObject.getAverageFovOccupancy(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
sensorId |
string
|
|
|
|
fromTimestamp |
string
|
|
|
|
toTimestamp |
string
|
|
|
|
objectType |
string
|
<optional>
<nullable>
|
null
|
|
|
Returns:
Average Fov Occupancy is returned
-
Type
-
Promise.<Object>
(async) getAverageRoiOccupancy(documentDb, input) → {Promise.<Object>}
- Description:
- returns an object containing average roi occupancy.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {sensorId: "abc", fromTimestamp: "2023-01-12T11:20:10.000Z", toTimestamp: "2023-01-12T14:20:10.000Z"};
let occupancyObject = new mdx.Metrics.Occupancy();
let occupancyResult = await occupancyObject.getAverageRoiOccupancy(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
sensorId |
string
|
|
|
|
roiId |
string
|
<optional>
<nullable>
|
null
|
|
fromTimestamp |
string
|
|
|
|
toTimestamp |
string
|
|
|
|
objectType |
string
|
<optional>
<nullable>
|
null
|
|
|
Returns:
Average Roi Occupancy is returned
-
Type
-
Promise.<Object>
(async) getHistogramOfAverageFovOccupancy(documentDb, input) → {Promise.<Object>}
- Description:
- returns an object containing histogram of average fov occupancy.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {sensorId: "abc", fromTimestamp: "2023-01-12T11:20:10.000Z", toTimestamp: "2023-01-12T14:20:10.000Z",bucketCount:24};
let occupancyObject = new mdx.Metrics.Occupancy();
let fovHistogramResult = await occupancyObject.getHistogramOfAverageFovOccupancy(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
sensorId |
string
|
|
|
|
fromTimestamp |
string
|
<optional>
|
|
Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present. |
toTimestamp |
string
|
<optional>
|
|
Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present. |
minutesAgo |
number
|
<optional>
|
|
minutesAgo must be an integer. Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present. |
bucketCount |
number
|
<optional>
|
20
|
bucketCount must be an integer. |
objectType |
string
|
<optional>
<nullable>
|
null
|
|
|
Returns:
Histogram of Average Fov Occupancy is returned
-
Type
-
Promise.<Object>
(async) getHistogramOfAverageRoiOccupancy(documentDb, input) → {Promise.<Object>}
- Description:
- returns an object containing histogram of average roi occupancy.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {sensorId: "abc", fromTimestamp: "2023-01-12T11:20:10.000Z", toTimestamp: "2023-01-12T14:20:10.000Z",bucketCount:24};
let occupancyObject = new mdx.Metrics.Occupancy();
let roiHistogramResult = await occupancyObject.getHistogramOfAverageRoiOccupancy(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
sensorId |
string
|
|
|
|
roiId |
string
|
<optional>
<nullable>
|
null
|
|
fromTimestamp |
string
|
<optional>
|
|
Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present. |
toTimestamp |
string
|
<optional>
|
|
Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present. |
minutesAgo |
number
|
<optional>
|
|
minutesAgo must be an integer. Either fromTimestamp and toTimestamp should be present together or minutesAgo should be present. |
bucketCount |
number
|
<optional>
|
20
|
bucketCount must be an integer. |
objectType |
string
|
<optional>
<nullable>
|
null
|
|
|
Returns:
Histogram of Average Roi Occupancy is returned
-
Type
-
Promise.<Object>
(async) getOccupancyBasedOnTripwireEvents(documentDb, input) → {Promise.<Object>}
- Description:
- returns an object containing occupancy based on tripwire events.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {place: "building=abc/room=xyz", timestamp: "2023-01-12T11:20:10.000Z"};
let occupancyObject = new mdx.Metrics.Occupancy();
let occupancyResult = await occupancyObject.getOccupancyBasedOnTripwireEvents(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
place |
string
|
|
|
|
timestamp |
string
|
|
|
|
objectType |
string
|
<optional>
|
"Person"
|
|
|
Returns:
Occupancy based on tripwire events is returned
-
Type
-
Promise.<Object>
(async) getUniqueObjectCountInMutuallyExclusiveRois(documentDb, input) → {Promise.<Object>}
- Description:
- returns an object containing occupancy of a place which is calculated based on mutually exclusive rois.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {place: "building=abc/room=xyz"};
let occupancyObject = new mdx.Metrics.Occupancy();
let placeOccupancy = await occupancyObject.getUniqueObjectCountInMutuallyExclusiveRois(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
place |
string
|
|
|
|
timestamp |
string
|
<optional>
<nullable>
|
null
|
|
objectType |
string
|
<optional>
|
"Person"
|
|
objectDetails |
boolean
|
<optional>
|
false
|
|
timestampDelayInSec |
number
|
<optional>
|
3
|
timestampDelayInSec must be an integer. |
timeWindowInMs |
number
|
<optional>
|
2000
|
timeWindowInMs must be an integer. |
|
Returns:
Occupancy of a place which is calculated based on mutually exclusive rois is returned
-
Type
-
Promise.<Object>
(async) resetOccupancy(documentDb, input) → {Promise.<Object>}
- Description:
- returns a success message if reset value was inserted successfully.
- Source:
Example
const mdx = require("@nvidia-mdx/web-api-core");
const elastic = new mdx.Utils.Elasticsearch({node: "elasticsearch-url"},databaseConfigMap);
let input = {place: "building=abc/room=xyz", timestamp: "2023-01-12T11:20:10.000Z", occupancyReset: 4};
let occupancyObject = new mdx.Metrics.Occupancy();
let result = await occupancyObject.resetOccupancy(elastic,input);
Parameters:
Name |
Type |
Description |
documentDb |
Database
|
Database Object |
input |
Object
|
Input object.
Properties
Name |
Type |
Attributes |
Default |
Description |
place |
string
|
|
|
|
timestamp |
string
|
|
|
|
occupancyReset |
number
|
|
|
occupancyReset must be an integer. |
objectType |
string
|
<optional>
|
"Person"
|
|
|
Returns:
A success message is returned
-
Type
-
Promise.<Object>