Пример #1
0
        public async Task <ActionResult> Trainstatus()
        {
            IFacesTrainApi facesTrainApi = new FacesTrainApi();
            TrainStatus    status        = await facesTrainApi.TrainStatusAsync();

            return(View("Trainstatus", status));
        }
Пример #2
0
        public ActionResult StartTrain()
        {
            IFacesTrainApi facesTrainApi = new FacesTrainApi();

            facesTrainApi.TrainFaces();
            return(RedirectToRoute("/Home/Trainstatus"));
        }
Пример #3
0
        public async Task <ActionResult> Train()
        {
            IFacesTrainApi facesTrainApi = new FacesTrainApi();
            var            trainModel    = new TrainModel()
            {
                Persons = await facesTrainApi.GetPersonsMetaDataAsync()
            };

            return(View("Train", trainModel));
        }
Пример #4
0
        public async Task <ActionResult> Train(HttpPostedFileBase file, string personId, string personName)
        {
            IFacesTrainApi facesTrainApi = new FacesTrainApi();

            var trainModel = new TrainModel();

            if (file != null)
            {
                await facesTrainApi.AddFaceAsync(file, personId, personName);

                trainModel.Result = "File uploaded";
            }
            else
            {
                trainModel.Result = "No file uploaded";
            }
            trainModel.Persons = await facesTrainApi.GetPersonsMetaDataAsync();

            return(View("Train", trainModel));
        }