Skip to content

Commit

Permalink
perf-timing on date-now
Browse files Browse the repository at this point in the history
  • Loading branch information
a-matyukh committed Jun 30, 2023
1 parent 9ad9b80 commit bda4154
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Detector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Detector {
}
}
async detect(buffer) {
console.time("detection")
// console.time("detection")
const prev = Date.now()
const ww_detections = await this.model.w.exec(buffer) // YoloDetection[]
const window_detection = ww_detections.find(d => d.class === 'window' && d.score > 0.5 && withinWorkspace(d.bbox, [1600, 900]))
const worker_detection = ww_detections.find(d => d.class === 'worker' && d.score > 0.5)
Expand All @@ -41,7 +42,9 @@ class Detector {
action_detection = wo_detections[0]
}
}
console.timeEnd("detection")
const now = Date.now()
console.log(`detection - ${now - prev}ms`)
// console.timeEnd("detection")
this.detections = {
window_detection,
worker_detection,
Expand Down

0 comments on commit bda4154

Please sign in to comment.