public async Task <ActionResult> Trainstatus() { IFacesTrainApi facesTrainApi = new FacesTrainApi(); TrainStatus status = await facesTrainApi.TrainStatusAsync(); return(View("Trainstatus", status)); }
public ActionResult StartTrain() { IFacesTrainApi facesTrainApi = new FacesTrainApi(); facesTrainApi.TrainFaces(); return(RedirectToRoute("/Home/Trainstatus")); }
public async Task <ActionResult> Train() { IFacesTrainApi facesTrainApi = new FacesTrainApi(); var trainModel = new TrainModel() { Persons = await facesTrainApi.GetPersonsMetaDataAsync() }; return(View("Train", trainModel)); }
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)); }