示例#1
0
        public string getNext()
        {
            Console.WriteLine("getnext");
            var img = nm.DbProvider.getNextImage();
            var b64 = Convert.ToBase64String(img.Bitmap.Blob);
            var ext = Path.GetExtension(img.FullName);
            var rr  = new API.Image()
            {
                Filename    = img.FullName, Class = img.Class,
                Probability = img.Probability, Blob = b64, Extension = ext
            };

            return(JsonConvert.SerializeObject(rr));
        }
示例#2
0
        public string handler(int idx = -1, string _class = "empty")
        {
            Console.WriteLine("getimg");
            Console.WriteLine(idx + " " + _class);
            if (idx < 0 || _class == "empty")
            {
                return(null);
            }
            var img = nm.DbProvider.cant_name_it(_class, idx);
            var b64 = Convert.ToBase64String(img.Bitmap.Blob);
            var ext = Path.GetExtension(img.FullName);
            var ret = new API.Image()
            {
                Filename = img.FullName, Class = img.Class, Blob = b64, Extension = ext, Probability = img.Probability
            };

            return(JsonConvert.SerializeObject(ret));
        }