fix for face crop when mesh is disabled

pull/280/head
Vladimir Mandic 2021-11-12 15:17:08 -05:00
parent eaa691f252
commit ee2deb88dc
3 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,10 @@
## 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 faceid demo

View File

@ -46,6 +46,7 @@ New:
- new optional model `liveness`
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
- new face masking option in `face.config.detector.mask`
Other:
- Improved **Safari** compatibility

View File

@ -66,7 +66,8 @@ export async function predict(input: Tensor, config: Config): Promise<FaceResult
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) {
const equilized = await histogramEqualization(face.tensor as Tensor);
tf.dispose(face.tensor);