-
Notifications
You must be signed in to change notification settings - Fork 5
feature/region-of-interest #4
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
base: master
Are you sure you want to change the base?
Conversation
Create getMessage for invalid capture inputs Changed onFaceUndetected to onMessage
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change faceCaptureMaxSize to detectMaxSize.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- All comments is referencing the
CaptureOptions; - Is it not missing the message for face undetected?
| @@ -0,0 +1,49 @@ | |||
| package ai.cyberlabs.yoonit.facefy.model | |||
|
|
|||
| import android.graphics.Color | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import.
| val rect = Rect(1,2,4,5) | ||
| rect.top = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
| val message = this.getMessage(boundingBox, inputImage.width, inputImage.height) | ||
|
|
||
| if (message.isNotEmpty()) { | ||
| onMessage(message) | ||
| return@addOnSuccessListener | ||
| } |
There was a problem hiding this comment.
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?
getMessageis 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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
|
This PR is from master or development? |
|
This still make sense? Can we fix this conflicts to merge? @Goulartvic @TeruyaHaroldo |
✨ New Feature