no message

This commit is contained in:
Calvin 2022-11-01 16:59:43 +08:00
parent 8d30de3c53
commit 6850d3347b

View File

@ -77,7 +77,7 @@ public final class FaceDetection {
Shape shape = array.getShape();
array =
NDImageUtils.resize(array, (int) (shape.get(1) * shrink), (int) (shape.get(0) * shrink));
array = array.transpose(2, 0, 1).flip(0); // HWC -> CHW BGR -> RGB
array = array.transpose(2, 0, 1).flip(0); // HWC -> CHW RGB -> BGR
NDArray mean = manager.create(new float[] {104f, 117f, 123f}, new Shape(3, 1, 1));
array = array.sub(mean).mul(0.007843f); // normalization
array = array.expandDims(0); // make batch dimension