Skip to content

Instantly share code, notes, and snippets.

@ptitzler
Last active April 18, 2019 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptitzler/33d3214c1f5774009ffbc983c96f1594 to your computer and use it in GitHub Desktop.
Save ptitzler/33d3214c1f5774009ffbc983c96f1594 to your computer and use it in GitHub Desktop.
Localize and identify multiple objects in a single image

This flow uses the https://developer.ibm.com/exchanges/models/all/max-object-detector/ deep learning model from the Model Asset Exchange to localize and identify multiple objects in a single image. Refer to the documentation for information about the returned message.

Install the following three modules to run this example flow:

Note: The object-detector node has been pre-configured to use a hosted model evaluation instance. We recommend using your own local or cloud instance for purposes other than evaluation.

[
{
"id": "257b0fcf.c1302",
"type": "tab",
"label": "Object detection example flow",
"disabled": false,
"info": "This flow uses the https://developer.ibm.com/exchanges/models/all/max-object-detector/ deep learning model from the Model Asset Exchange to localize and identify multiple objects in a single image. Refer to the documentation for information about the returned message.\n\nInstall the following three modules to run this example flow:\n - [node-red-contrib-model-asset-exchange](https://www.npmjs.com/package/node-red-contrib-model-asset-exchange)\n - [node-red-contrib-browser-utils](https://www.npmjs.com/package/node-red-contrib-browser-utils)\n - [node-red-contrib-image-output](https://npmjs.org/package/node-red-contrib-image-output)\n \n> Note: The object-detector node has been pre-configured to use a hosted model evaluation instance. We recommend using your own local or cloud instance for purposes other than evaluation."
},
{
"id": "5680e5ee.1441cc",
"type": "debug",
"z": "257b0fcf.c1302",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 650,
"y": 120,
"wires": []
},
{
"id": "d266c943.67ce48",
"type": "object-detector",
"z": "257b0fcf.c1302",
"service": "96195b68.679e18",
"method": "predict",
"passthrough": false,
"annotated_input": true,
"predict_body": "",
"predict_bodyType": "str",
"predict_threshold": "0.7",
"predict_thresholdType": "str",
"name": "",
"x": 360,
"y": 120,
"wires": [
[
"5680e5ee.1441cc",
"9f36df26.ff3c9"
]
]
},
{
"id": "b20eb66e.1fa248",
"type": "fileinject",
"z": "257b0fcf.c1302",
"name": "",
"x": 140,
"y": 120,
"wires": [
[
"d266c943.67ce48"
]
]
},
{
"id": "520cd665.7725c8",
"type": "camera",
"z": "257b0fcf.c1302",
"name": "",
"x": 130,
"y": 178,
"wires": [
[
"d266c943.67ce48"
]
]
},
{
"id": "f124cc22.5c93a",
"type": "comment",
"z": "257b0fcf.c1302",
"name": "Localize and identify multiple objects in a single image, then display the output",
"info": "",
"x": 320,
"y": 40,
"wires": []
},
{
"id": "fd5d2cbc.ed717",
"type": "image",
"z": "257b0fcf.c1302",
"name": "",
"width": "300",
"x": 670.5,
"y": 178,
"wires": []
},
{
"id": "9f36df26.ff3c9",
"type": "function",
"z": "257b0fcf.c1302",
"name": "Extract Bounding Box Image Data",
"func": "// if the incoming message contains the annotated image\n// send it to the image output node to display\n\nmsg.payload = msg.annotatedInput;\nif (msg.payload) {\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"x": 419.5,
"y": 178,
"wires": [
[
"fd5d2cbc.ed717"
]
]
},
{
"id": "96195b68.679e18",
"type": "object-detector-service",
"z": "",
"host": "https://max-object-detector.max.us-south.containers.appdomain.cloud",
"name": "cloud"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment