public static List <PredResult> ImagenetTest(ImageNetModel model)
        {
            string   imagePath = string.Format("{0}images\\dog_cls.jpg", AppDomain.CurrentDomain.BaseDirectory);
            ImageNet app       = new ImageNet(model);

            app.LoadModel();
            return(app.Predict(imagePath));
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImageNet"/> class.
        /// </summary>
        /// <param name="model">The model to use. <see cref="ImageNetModel"/></param>
        public ImageNet(ImageNetModel model)
        {
            this.model   = model;
            actualValues = new Dictionary <int, string>();
            ExpandoObject jsonValues = Newtonsoft.Json.JsonConvert.DeserializeObject <ExpandoObject>(PredMap.ImageNet1K);

            foreach (var item in jsonValues)
            {
                actualValues.Add(Convert.ToInt32(item.Key), item.Value.ToString());
            }
        }