Note

This Python sample is available only with our Professional plan.

Convert Bbox from a Sequential Text to NPY

This Python script allows you to convert annotated bounding boxes (Bbox) from a custom text format to Numpy array (NPY).

Expected Output

Converted Bbox in EventBbox format.

Setup & requirements

You will need to provide the following input:

  • a text file input : a custom text file containing a list of sequential actions on the annotated bounding bounding boxes.

    • The text file should include 9 columns without headers

    • The 9 columns are: timestamp(ts), Object ID, Command action, Class_ID, X Coordinate, Y Coordinate, Width, Height, Detection Confidence (p)

    • There are 5 types of command actions: BB_CREAT, BB_MOVE, BB_RESIZE, BB_MOVE_AND_RESIZE, BB_DELETE.

How to start

To run the script:

Linux

python3 bbox_txt2npy.py -i /path/to/input.txt -o /path/to/output.npy

Windows

python bbox_txt2npy.py -i /path/to/input.txt -o /path/to/output.npy

To find the full list of options, run:

Linux

python3 bbox_txt2npy.py -h

Windows

python bbox_txt2npy.py -h