Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. for (int i = 1; i < trainingImages.ToArray().Length + 1; i++)
  2. {
  3. trainingImages.ToArray()[i - 1].Save(Application.StartupPath + "/TrainedFaces/eladena/face" + i + ".bmp");
  4. File.AppendAllText(Application.StartupPath + "/TrainedFaces/TrainedLabels.txt", labels.ToArray()[i - 1] + "%");
  5. }
  6. MessageBox.Show(textBox1.Text + "´s face detected and added :)", "Training OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
  7.  
  8. string[] filePaths = Directory.GetFiles(Application.StartupPath + "/TrainedFaces/", "*.bmp");
  9. foreach (string filePath in filePaths)
  10. {
  11. if (filePath.Contains(".bmp"))
  12. File.Delete(filePath);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement