Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove score when drawing the face detection ? #913

Open
MathieuCesbron opened this issue Jul 7, 2023 · 3 comments
Open

How to remove score when drawing the face detection ? #913

MathieuCesbron opened this issue Jul 7, 2023 · 3 comments

Comments

@MathieuCesbron
Copy link

Hello and thanks for the great work,

I have this in my code:
faceapi.draw.drawDetections(canvasDraw, resizedDetections);

It works but I would like to remove the score on the top of the rectangle, I cannot find where to pass the options.

May be it is something like this ?
faceapi.draw.drawDetections(canvasDraw, resizedDetections, {withScore: false});

Have a good day,

@kamal-vcloudx
Copy link

@justadudewhohacks can you please provide an option to remove score from top of the detection rectangle.
Thanks!

@AndreyTepaykin
Copy link

Need to customize method drawDetections. In face-api.js find function drawDetections and add options={withScore:true} as third argument. Than inside this function change row var label = score ? "" + round(score) : undefined; to var label = options.withScore && score ? "" + round(score) : undefined;
After these changes call faceapi.draw.drawDetections with third argument {withScore: false}

@borihan-p
Copy link

drawDetections won't draw score if we provide IRect object. The code below works for me

          const box: IRect = {
            x: resizedDetections.detection.box.left,
            y: resizedDetections.detection.box.top,
            width: resizedDetections.detection.box.width,
            height: resizedDetections.detection.box.height,
          };
          faceapi.draw.drawDetections(canvasDraw, box);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants