  
          batch = BackgroundGenerator(self.prepare_images(), 1)
          for item in batch.iterator():
              self.convert(converter, item)
  
      def convert(self, converter, item):
          try:
              (filename, image, faces) = item
 
</s> remove             for idx, face in faces:
                image = converter.patch_image(image, face)
 </s> add             skip = False
            try:
                if self.frame_ranges is not None:
                    # grab the index with last number regex
                    idx = int(self.imageidxre.findall(filename)[0])
                    # only skip if the current index is not between any of the frame ranges.
                    skip = not any(map(lambda b: b[0]<=idx<=b[1], self.frame_ranges))
            except:
                # if we error, dont skip
                skip = False

            if not skip: # process as normal
                for idx, face in faces:
                    image = converter.patch_image(image, face) </s> remove 
 </s> add import re
        # frame ranges stuff...
        self.frame_ranges = None
        # split out the frame ranges and parse out "min" and "max" values
        minmax = {
            "min": 0, # never any frames less than 0
            "max": float("inf")
        }
        if self.arguments.frame_ranges:
            self.frame_ranges = [tuple(map(lambda q: minmax[q] if q in minmax.keys() else int(q), v.split("-"))) for v in self.arguments.frame_ranges]

        # last number regex. I know regex is hacky, but its reliablyhacky(tm).
        self.imageidxre = re.compile(r'(\d+)(?!.*\d)')

  
          batch = BackgroundGenerator(self.prepare_images(), 1)
        # frame ranges stuff...
        self.frame_ranges = None
        # split out the frame ranges and parse out "min" and "max" values
        minmax = {
            "min": 0, # never any frames less than 0
            "max": float("inf")
        }
        if self.arguments.frame_ranges:
            self.frame_ranges = [tuple(map(lambda q: minmax[q] if q in minmax.keys() else int(q), v.split("-"))) for v in self.arguments.frame_ranges]

        # last number regex. I know regex is hacky, but its reliablyhacky(tm).
        self.imageidxre = re.compile(r'(\d+)(?!.*\d)')

          for item in batch.iterator():
              self.convert(converter, item)
  
      def convert(self, converter, item):
          try:
              (filename, image, faces) = item
keep add keep keep keep keep keep keep
 frame-range option for convert (#90)

* extended arguments for convert re https://github.com/deepfakes/faceswap/issues/85

* forgot to change helptext for extended arguments.

* Added -fr --frame-range argument to convert

accepts a list of frame ranges like `-fr 40-50 90-100`

still writes out frames that havent been converted.

* added --discard-frames argument

--discard-frames discards frames not included in --frame-range instead
of writing them out unchanged. 
scripts/convert.py