How to get the bbox values from the object ? Dectection by Face api

25 Views Asked by At

Im trying face detection in Face api in browser using javascript .

code for the detection

video.addEventListener('play', () => {
  const canvas = faceapi.createCanvasFromMedia(video)
  document.body.append(canvas)
  const displaySize = { width: video.width, height: video.height }
  console.log(displaySize)
  console.log(canvas.width,canvas.height)
  faceapi.matchDimensions(canvas, displaySize)
  setInterval(async () => {
    const detections = await faceapi.detectAllFaces(video, new faceapi.TinyFaceDetectorOptions())
    const resizedDetections = faceapi.resizeResults(detections, displaySize)
    console.log(resizedDetections)
    canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height)
    faceapi.draw.drawDetections(canvas, resizedDetections)
  }, 100)
})

Below image shows the bbox coordinates , i want to make use of bbox coordinates for futher work .

enter image description here

How to extract the bbox values from it ? it is of object type .

for further clarifications , kindly comment

0

There are 0 best solutions below