Ejemplo n.º 1
0
        public static MobileNet GetMobileNetV2(float multiplier, bool pretrained = false, Context ctx = null,
                                               string root = "", int classes = 1000, string prefix = null, ParameterDict @params = null)
        {
            var net = new MobileNet(multiplier, classes, prefix, @params);

            if (pretrained)
            {
                net.LoadParameters(ModelStore.GetModelFile($"mobilenetv2_{multiplier}"), ctx);
            }

            return(net);
        }
Ejemplo n.º 2
0
        public static MobileNet GetMobileNet(float multiplier, bool pretrained = false, Context ctx = null,
                                             string root = "", int classes = 1000, string prefix = "", ParameterDict @params = null)
        {
            var net = new MobileNet(multiplier, classes, prefix, @params);

            var version_suffix = string.Format("{0:0.00}", multiplier);

            if (version_suffix == "1.00" || version_suffix == "0.50")
            {
                version_suffix = version_suffix.Substring(0, 3);
            }

            if (pretrained)
            {
                net.LoadParameters(ModelStore.GetModelFile($"mobilenet{version_suffix}"), ctx);
            }

            return(net);
        }