fix for face crop when mesh is disabled

pull/293/head
Vladimir Mandic 2021-11-12 15:17:08 -05:00
parent 61a7de3c0f
commit 76830567f7
3 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,10 @@
## Changelog ## Changelog
### **HEAD -> main** 2021/11/11 mandic00@live.com ### **HEAD -> main** 2021/11/12 mandic00@live.com
### **origin/main** 2021/11/11 mandic00@live.com
- add similarity score range normalization - add similarity score range normalization
- add faceid demo - add faceid demo

View File

@ -46,6 +46,7 @@ New:
- new optional model `liveness` - new optional model `liveness`
checks if input appears to be a real-world live image or a recording checks if input appears to be a real-world live image or a recording
best used together with `antispoofing` that checks if input appears to have a realistic face best used together with `antispoofing` that checks if input appears to have a realistic face
- new face masking option in `face.config.detector.mask`
Other: Other:
- Improved **Safari** compatibility - Improved **Safari** compatibility

View File

@ -66,7 +66,8 @@ export async function predict(input: Tensor, config: Config): Promise<FaceResult
annotations: {}, annotations: {},
}; };
[angle, rotationMatrix, face.tensor] = util.correctFaceRotation(false && config.face.detector?.rotation, box, input, config.face.mesh?.enabled ? inputSize : blazeface.size()); // optional rotate based on detector data // optional rotation correction based on detector data only if mesh is disabled otherwise perform it later when we have more accurate mesh data. if no rotation correction this function performs crop
[angle, rotationMatrix, face.tensor] = util.correctFaceRotation(!config.face.mesh?.enabled && config.face.detector?.rotation, box, input, config.face.mesh?.enabled ? inputSize : blazeface.size());
if (config?.filter?.equalization) { if (config?.filter?.equalization) {
const equilized = await histogramEqualization(face.tensor as Tensor); const equilized = await histogramEqualization(face.tensor as Tensor);
tf.dispose(face.tensor); tf.dispose(face.tensor);