New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 673075 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

DetectedFace idl is not used, FaceDetector returning incorrect data type

Project Member Reported by mcasas@chromium.org, Dec 10 2016

Issue description

FaceDetector.detect() returns a sequence<DetectedObject> [1],
but DetectedObject doesn't exist, and it should return DetectedFace
instead [2,3]. DetectedFace is not used at the moment. FaceDetector 
goes around this issue by returning DOMRects directly [4].

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl?q=FaceDetector.idl&sq=package:chromium&dr&l=13 
[2] https://wicg.github.io/shape-detection-api/#face-detection-api
[3] https://wicg.github.io/shape-detection-api/#face-detection
[4] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp?dr&sq=package:chromium&l=60
 

Comment 1 by mcasas@chromium.org, Dec 10 2016

Solution: make FaceDetector return a sequence<DetectedFace> instead.

https://codereview.chromium.org/2564123003

Note that this will break examples and demos: where now we have:
faceDetector.detect()
  .then((faces) => { 
     for(var i = 0; i < faces.length; i++) {
       console.log(
         '(' + faces[i].x + ',' + faces[i].y + '), size ' + faces[i].width + 'x' + faces[i].height + '</li>');
     }
  });

Now we should do:
faceDetector.detect()
  .then((faces) => { 
     for(var i = 0; i < faces.length; i++) {
       
       const boundingBox = faces[i].boundingBox;  // !!!!

       console.log(
         '(' + boundingBox.x + ',' + boundingBox.y + '), size ' + boundingBox.width + 'x' + boundingBox.height + '</li>');
     }
  });

Essentially doing what we do for barcode detection.

Project Member

Comment 2 by bugdroid1@chromium.org, Dec 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2

commit f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2
Author: mcasas <mcasas@chromium.org>
Date: Sun Dec 11 17:41:04 2016

Face Detection: Use DetectedFace in FaceDetector.cpp iso DOMRect

FaceDetector.detect() in ToT returns a sequence<DetectedObject>,
but DetectedObject doesn't exist, and it should return DetectedFace
instead according to the Spec. Also, DetectedFace is not used at the
moment (FaceDetector  goes around this issue by returning DOMRects
directly).

This CL sorts that out by returning DetectedFaces directly.

BUG= 673075 

Review-Url: https://codereview.chromium.org/2564123003
Cr-Commit-Position: refs/heads/master@{#437794}

[modify] https://crrev.com/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2/content/test/data/media/face_detection_test.html
[modify] https://crrev.com/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2/third_party/WebKit/Source/modules/shapedetection/DetectedBarcode.h
[modify] https://crrev.com/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2/third_party/WebKit/Source/modules/shapedetection/DetectedFace.cpp
[modify] https://crrev.com/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2/third_party/WebKit/Source/modules/shapedetection/DetectedFace.h
[modify] https://crrev.com/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2/third_party/WebKit/Source/modules/shapedetection/DetectedFace.idl
[modify] https://crrev.com/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
[modify] https://crrev.com/f1f5959ffc84ab6069c0a1b4cd0c784b24c996d2/third_party/WebKit/Source/modules/shapedetection/FaceDetector.idl

Comment 3 by mcasas@chromium.org, Dec 12 2016

Status: Fixed (was: Started)

Sign in to add a comment