                  loss[side] = batcher.train_one_batch(do_preview)
                  if not do_preview and not do_timelapse:
                      continue
                  if do_preview:
                      self.samples.images[side] = batcher.compile_sample(None)
                  if do_timelapse:
                      self.timelapse.get_sample(side, timelapse_kwargs)
  
              self.model.state.increment_iterations()
  
 
</s> remove                 loss[side] = batcher.train_one_batch(do_preview)
 </s> add                 loss[side] = batcher.train_one_batch() </s> remove                     self.timelapse.get_sample(side, timelapse_kwargs)
 </s> add                     self._timelapse.get_sample(side, timelapse_kwargs) </s> remove             self.model.state.increment_iterations()
 </s> add             self._model.state.increment_iterations() </s> remove             for side, batcher in self.batchers.items():
                if self.pingpong.active and side != self.pingpong.side:
 </s> add             for side, batcher in self._batchers.items():
                if self._pingpong.active and side != self._pingpong.side: </s> remove                 samples = self.samples.show_sample()
 </s> add                 samples = self._samples.show_sample()
                    batcher.generate_preview(do_preview)
                    self._samples.images[side] = batcher.compile_sample(None)
                  loss[side] = batcher.train_one_batch(do_preview)
                  if not do_preview and not do_timelapse:
                      continue
                  if do_preview:
                    batcher.generate_preview(do_preview)
                    self._samples.images[side] = batcher.compile_sample(None)
                  if do_timelapse:
                      self.timelapse.get_sample(side, timelapse_kwargs)
  
              self.model.state.increment_iterations()
  
keep keep keep keep replace keep keep keep keep keep
 Smart Masks - Training Implementation (#914)

* Smart Masks - Training

- Reinstate smart mask training code
- Reinstate mask_type back to model.config
- change 'replicate_input_mask to 'learn_mask'
- Add learn mask option
- Add mask loading from alignments to plugins.train.trainer
- Add mask_blur and mask threshold options
- _base.py - Pass mask options through training_opts dict
- plugins.train.model - check for mask_type not None for learn_mask and penalized_mask_loss
- Limit alignments loading to just those faces that appear in the training folder
- Raise error if not all training images have an alignment, and alignment file is required
- lib.training_data - Mask generation code
- lib.faces_detect - cv2 dimension stripping bugfix
- Remove cv2 linting code

* Update mask helptext in cli.py

* Fix Warp to Landmarks
Remove SHA1 hashing from training data

* Update mask training config

* Capture missing masks at training init

* lib.image.read_image_batch - Return filenames with batch for ordering

* scripts.train - Documentation

* plugins.train.trainer - documentation

* Ensure backward compatibility.
Fix convert for new predicted masks

* Update removed masks to components for legacy models. 
plugins/train/trainer/_base.py