UNPKG

rbflurry-node-red-contrib-bounding-box

Version:
47 lines (37 loc) 1.52 kB
# node-red-contrib-post-object-detection This is a custom Node-RED node that draws bounding boxes from an Object Detection model. ## Installation ### Prerequisite ``` This custom Node-RED node leverages the `node-canvas` npm package to draw the bounding boxes on a image. Please make sure the platform running Node-RED fulfills the prerequisites listed [here](https://www.npmjs.com/package/canvas#compiling). For example, while using Ubuntu, you need to run the following command to install the dependencies: ``` sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev ``` ### Install this module: Once you install the peer dependency and the prerequisites, you can install this module: ``` npm install node-red-contrib-post-object-detection ``` ## Usage There are two custom Node-RED nodes in this package: - `bbox-image`: This is used to annotate an input original image with bounding boxes. ### `bbox-image` node The `msg.payload` passed to this node should be an object containing these two properties: - `image`: The image data in `Buffer` data type - `objects`: An object array containing a list of detected objects. Each object has the following information: ``` { bbox: [x, y, w, h], className: string, score: number } ``` This node annotates the image by drawing the bounding boxes of detected objects onto it. This annotated image is then output as a `Buffer` for the next node.