              if is_have_alignments:
                  if self.have_face(filename):
                      faces = self.get_faces_alignments(filename, image)
                  else:
                      print ('no alignment found for {}, skipping'.format(os.path.basename(filename)))
                      continue
              else:
                  faces = self.get_faces(image)
              yield filename, image, faces
 
</s> remove     dir_scanned = list(scandir(directory))
 </s> add     dir_scanned = sorted(os.scandir(directory), key=lambda x: x.name)
                    tqdm.write ('no alignment found for {}, skipping'.format(os.path.basename(filename)))
              if is_have_alignments:
                  if self.have_face(filename):
                      faces = self.get_faces_alignments(filename, image)
                  else:
                    tqdm.write ('no alignment found for {}, skipping'.format(os.path.basename(filename)))
                      continue
              else:
                  faces = self.get_faces(image)
              yield filename, image, faces
keep keep keep keep replace keep keep keep keep
 Model backups before saving (#349)

* Sort images properly (to make the frame range parameter meaningfull)

* Add backup mechanism for model weights.

* Replace 'print' call by 'tqdm.write' call. 
scripts/convert.py