              out_queue.put((item["filename"], image))
          logger.debug("Completed convert process")
  
      def patch_image(self, predicted):
          """ Patch the image """
          logger.trace("Patching image: '%s'", predicted["filename"])
          frame_size = (predicted["image"].shape[1], predicted["image"].shape[0])
          new_image = self.get_new_image(predicted, frame_size)
 
</s> remove     def process(self, in_queue, out_queue):
 </s> add     def process(self, in_queue, out_queue, completion_queue=None): </s> remove         logger.debug("Starting convert process. (in_queue: %s, out_queue: %s)",
                     in_queue, out_queue)
 </s> add         logger.debug("Starting convert process. (in_queue: %s, out_queue: %s, completion_queue: "
                     "%s)", in_queue, out_queue, completion_queue) </s> remove             retval = int(self.vid_cap.get(cv2.CAP_PROP_FRAME_COUNT))  # pylint: disable=no-member
 </s> add             retval = int(im_ffm.count_frames_and_secs(self.folder)[0]) </s> remove             cap = cv2.VideoCapture(self.args.input_dir)  # pylint: disable=no-member
            retval = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))  # pylint: disable=no-member
            cap.release()
 </s> add             retval = int(im_ffm.count_frames_and_secs(self.args.input_dir)[0])
        # Signal that this process has finished
        if completion_queue is not None:
            completion_queue.put(1)
              out_queue.put((item["filename"], image))
          logger.debug("Completed convert process")
        # Signal that this process has finished
        if completion_queue is not None:
            completion_queue.put(1)
  
      def patch_image(self, predicted):
          """ Patch the image """
          logger.trace("Patching image: '%s'", predicted["filename"])
          frame_size = (predicted["image"].shape[1], predicted["image"].shape[0])
          new_image = self.get_new_image(predicted, frame_size)
keep add keep keep keep keep keep keep
 bugfix: Stop convert hanging at the last few frames on some input videos 
lib/convert.py