Skip to content

calculateFaceLocation = (data) => {} doesnt give good results #1

@Jezonfdo

Description

@Jezonfdo
  calculateFaceLocation = (data) => {
    var clarifaiFace = data.outputs[0].data.regions[0].region_info.bounding_box;
    var image = document.getElementById('inputimage');
    var width = Number(image.width);
    var height = Number(image.height);
    console.log(clarifaiFace);
    return {
      leftCol: clarifaiFace.left_col * width,
      topRow: clarifaiFace.top_row * height,
      rightCol: width - (clarifaiFace.right_col * width),
      bottomRow: height - (clarifaiFace.bottom_row * height)
    }
  }

Even though I used it like this, the output is crazy

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions