private void Worker()
 {
     while (!CancelThreads.Token.IsCancellationRequested && PathImages.TryDequeue(out string image))
     {
         ResultClassification result = Model.PredictModel(image);
         Result.Enqueue(result);
         ImageRecognitionCompleted(result);
     }
 }
        public ResultClassification Post([FromBody] ImageString obj)
        {
            ResultClassification result;

            OnnxClassifier.OnnxClassifier onnxModel;

            using (var db = new ApplicationContext())
            {
                result = db.FindInDataBase(obj);
                if (result != null)
                {
                    return(result);
                }
                onnxModel = new OnnxClassifier.OnnxClassifier();
                result    = onnxModel.PredictModel(obj.path);

                obj.path        = result._PathImage;
                obj.Probability = result._Probability;
                obj.ClassImage  = result._ClassImage;
                db.AddToDataBase(obj);
            }
            return(result);
        }