add inference time to yolo plugin
parent
9cd9446800
commit
0dc4b7afd2
|
|
@ -27,6 +27,7 @@ var yolo = require('node-yolo-shinobi');//this is @vapi/node-yolo@1.2.4 without
|
|||
// var yolo = require('@vapi/node-yolo');
|
||||
var detector = new yolo(__dirname + "/models", "cfg/coco.data", "cfg/yolov3.cfg", "yolov3.weights");
|
||||
s.detectObject=function(buffer,d,tx,frameLocation){
|
||||
var timeStart = new Date()
|
||||
var detectStuff = function(frame,callback){
|
||||
detector.detect(frame)
|
||||
.then(detections => {
|
||||
|
|
@ -52,7 +53,8 @@ s.detectObject=function(buffer,d,tx,frameLocation){
|
|||
reason:'object',
|
||||
matrices:matrices,
|
||||
imgHeight:parseFloat(d.mon.detector_scale_y),
|
||||
imgWidth:parseFloat(d.mon.detector_scale_x)
|
||||
imgWidth:parseFloat(d.mon.detector_scale_x),
|
||||
time: (new Date()) - timeStart
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue