All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bigml.mimir.image.SkewedCenteringReader Maven / Gradle / Ivy

There is a newer version: 0.8.3
Show newest version
package org.bigml.mimir.image;

import java.io.Serializable;

import org.bigml.mimir.deepnet.network.ImageNetworkMetadata;

/**
 * Image preprocessing specific to mobilenetv2, which normalizes pixels from -1
 * to a number slightly less than 1.
 *
 * @author [email protected]
 *
 */
public class SkewedCenteringReader extends ImageReader implements Serializable {

    public SkewedCenteringReader() {}

    public SkewedCenteringReader(int[] shape) {
        super(shape);
    }

    public SkewedCenteringReader(int maxPixels) {
        super(maxPixels);
    }

    public SkewedCenteringReader(ImageNetworkMetadata metadata) {
        super(metadata);
    }

    @Override
    protected double convert(double value, int depth) {
        return (value / 128) - 1.;
    }

    private static final long serialVersionUID = 1L;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy