static void Main(string[] args) { var options = Options.InitializeOptions <TrainingOptions>(args); if (options == null) { return; } var trainingApi = new TrainingApi() { ApiKey = options.Trainingkey }; if (options.BaseUri != null) { Console.WriteLine($"The default base uri is {trainingApi.BaseUri}. Changed it to {options.BaseUri}."); trainingApi.BaseUri = options.BaseUri; } ProjectInfo project; if (options.ProjectId != Guid.Empty) { if (!trainingApi.CheckIfProjectExists(options.ProjectId)) { Console.WriteLine($"Cannot get the project with id {options.ProjectId}. Please check if the Guid is right."); return; } project = new ProjectInfo(trainingApi.GetProject(options.ProjectId)); } else { Console.WriteLine("ProjectId is not provided. Creating a new project..."); var projectInfo = ProjectInfo.ReadProjectInfo(options.WorkDir + options.ProjectInfoFileName); project = trainingApi.CreateProjectAsync(projectInfo).Result; } Console.WriteLine($"Project Id: {project.Id}"); if (options.ImageSource != "existing") { var uploadResult = trainingApi.ReadAndUploadImagesAsync(project, options, options.AllowedTagNames).Result; if (!uploadResult.IsBatchSuccessful) { Console.WriteLine("No image uploaded successfully. Please check if those images have been uploaded before."); return; } } trainingApi.TrainProject(project.Id); Console.WriteLine("The classifier is now training. You can check its status in the web portal.\nPress any key to exit."); Console.ReadKey(); }