Skip to content

Instantly share code, notes, and snippets.

View pmmistry's full-sized avatar

Pooja Mistry pmmistry

View GitHub Profile
@pmmistry
pmmistry / raspberry-pi-object-detection-node-red-flow.json
Created September 20, 2019 22:46
Raspberry Pi Object Detection Node-RED flow
[{"id":"d7ec3041.ef1a7","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"1e2f8497.0f0bb3","type":"http in","z":"d7ec3041.ef1a7","name":"","url":"/dashboard","method":"get","upload":false,"swaggerDoc":"","x":160,"y":260,"wires":[["e63ccee5.1b84a8"]]},{"id":"e63ccee5.1b84a8","type":"template","z":"d7ec3041.ef1a7","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!DOCTYPE html>\n<html>\n<meta charset=\"utf-8\" />\n<body>\n<canvas id=\"video-canvas\" style=\"position: fixed; top: 0; left: 0;\"></canvas>\n<canvas id=\"draw-canvas\" style=\"position: fixed; top: 0; left: 0;\"></canvas>\n<script src=\"https://cdn.jsdelivr.net/npm/@cloud-annotations/object-detection@0.0.8\"></script>\n<script>\n\nconst renderPredictions = predictions => {\n const canvas = document.getElementById('draw-canvas')\n const videoCanvas = document.getElementById('video-canvas')\n canvas.width = videoCanvas.width\n canvas.height = videoCanvas.height\n const ctx