Skip to content

Conversation

@Goulartvic
Copy link
Contributor

✨ New Feature

  • Emmit roi rect at onFaceDetected
  • Create min/max face size check
  • Create roi out of roi check
  • Changed onFaceUndetected to onMessage

Create getMessage for invalid capture inputs
Changed onFaceUndetected to onMessage
@Goulartvic Goulartvic added the enhancement New feature or request label Feb 24, 2021
Copy link
Contributor

@TeruyaHaroldo TeruyaHaroldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It is missing the on face undetected handling. Right?

facefyController.detect(image, onFaceDetected, onFaceUndetected)
var roiEnable: Boolean = FacefyOptions.faceROI.enable
set(value) {
FacefyOptions.faceROI.enable = value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to change the faceROI to roi?


var roiRect: RectF = FacefyOptions.faceROI.rectOffset
set(value) {
FacefyOptions.faceROI.rectOffset = value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to change the faceROI to roi?


var roiDetectMinSize: Float = FacefyOptions.faceROI.minimumSize
set(value) {
FacefyOptions.faceROI.minimumSize = value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to change the faceROI to roi?


var detectMinSize: Float = FacefyOptions.faceCaptureMinSize
set(value) {
FacefyOptions.faceCaptureMinSize = value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change faceCaptureMinSize to detectMinSize .


var detectMaxSize: Float = FacefyOptions.faceCaptureMaxSize
set(value) {
FacefyOptions.faceCaptureMaxSize = value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change faceCaptureMaxSize to detectMaxSize .

* This variable is the face detection box percentage in relation with the UI graphic view.
* The value must be between 0 and 1.
*/
var faceCaptureMaxSize: Float = 1.0f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change faceCaptureMaxSize to detectMaxSize.

Comment on lines 3 to 15
object Message {
// Face width percentage in relation of the screen width is less than the CaptureOptions.faceCaptureMinSize
const val INVALID_CAPTURE_FACE_MIN_SIZE = "INVALID_CAPTURE_FACE_MIN_SIZE"

// Face width percentage in relation of the screen width is more than the CaptureOptions.faceCaptureMinSize
const val INVALID_CAPTURE_FACE_MAX_SIZE = "INVALID_CAPTURE_FACE_MAX_SIZE"

// Face bounding box is out of the setted region of interest.
const val INVALID_CAPTURE_FACE_OUT_OF_ROI = "INVALID_CAPTURE_FACE_OUT_OF_ROI"

// Face width percentage in relation of the screen width is less than the CaptureOptions.FaceROI.minimumSize.
const val INVALID_CAPTURE_FACE_ROI_MIN_SIZE = "INVALID_CAPTURE_FACE_ROI_MIN_SIZE"
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. All comments is referencing the CaptureOptions;
  2. Is it not missing the message for face undetected?

@@ -0,0 +1,49 @@
package ai.cyberlabs.yoonit.facefy.model

import android.graphics.Color
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import.

Comment on lines 68 to 69
val rect = Rect(1,2,4,5)
rect.top = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Comment on lines +81 to +86
val message = this.getMessage(boundingBox, inputImage.width, inputImage.height)

if (message.isNotEmpty()) {
onMessage(message)
return@addOnSuccessListener
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(In first place, this is self criticism)

We must change, don't you agree?

  • getMessage is not a good function name for handling the face bounding box verifications;
  • The face bounding box verification is not explicit;
  • We (that includes me) can do it much better, right?

closestFace?.let { face ->

val faceContours = mutableListOf<PointF>()
var roi = Rect()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to change from roi to roiRect, because this is coordinates converted in pixel. Right?

var contours: MutableList<PointF> = mutableListOf(),
var boundingBox: Rect
var boundingBox: Rect,
var roi: Rect
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think to change from roi to roiRect, because this is coordinates converted in pixel. Right?

Change roi to roiRect at onFaceDetected
Base automatically changed from development to master March 2, 2021 19:48
@luiguild
Copy link
Member

luiguild commented Oct 6, 2021

This PR is from master or development?

@luiguild
Copy link
Member

This still make sense? Can we fix this conflicts to merge? @Goulartvic @TeruyaHaroldo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants