              # but spawned processes will load this module, so we need to dummy in a queue
              self.manager = mp
          self.shutdown = self.manager.Event()
          self.queues = dict()
          # Despite launching a subprocess, the scripts still want to access the same logging
          # queue as the GUI, so make sure the GUI gets it's own queue
          self._log_queue = self.manager.Queue() if "gui" not in sys.argv else mp.Queue()
          logger.debug("Initialized %s", self.__class__.__name__)
  
      def add_queue(self, name, maxsize=0, multiprocessing_queue=True):
          """ Add a queue to the manager
  
 
</s> remove         # Hacky fix to stop multiprocessing spawning managers in child processes
        if mp.current_process().name == "MainProcess":
            # Use a Multiprocessing manager in main process
            self.manager = mp.Manager()
        else:
            # Use a standard mp.queue in child process. NB: This will never be used
            # but spawned processes will load this module, so we need to dummy in a queue
            self.manager = mp
        self.shutdown = self.manager.Event()
 </s> add         self.shutdown = threading.Event() </s> remove     def add_queue(self, name, maxsize=0, multiprocessing_queue=True):
 </s> add     def add_queue(self, name, maxsize=0): </s> remove     def get_queue(self, name, maxsize=0, multiprocessing_queue=True):
 </s> add     def get_queue(self, name, maxsize=0): </s> remove         """ Return the correct input queue depending on the current phase """
        if self.is_parallel or self.phase == "detect":
 </s> add         """ queue: Return the correct input queue depending on the current phase

        The input queue is the entry point into the extraction pipeline. A ``dict`` should
        be put to the queue in the following format(s):

        For detect/single phase operations:

        >>> {'filename': <path to the source image that is to be extracted from>,
        >>>  'image': <the source image as a numpy.array in BGR color format>}

        For align (2nd pass operations):

        >>> {'filename': <path to the source image that is to be extracted from>,
        >>>  'image': <the source image as a numpy.array in BGR color format>,
        >>>  'detected_faces: [<list of DetectedFace objects as generated from detect>]}

        """
        if self._is_parallel or self.phase == "detect": </s> remove         self.align_faces(detector, aligner, loglevel, multiprocess)
 </s> add         # TODO Revert face-filter to use the selected detector and aligner.
        # Currently Tensorflow does not release vram after it has been allocated
        # Whilst this vram can still be used, the pipeline for the extraction process can't see
        # it so thinks there is not enough vram available.
        # Either the pipeline will need to be changed to be re-usable by face-filter and extraction
        # Or another vram measurement technique will need to be implemented to for when TF has
        # already performed allocation. For now we force CPU detectors.

        # self.align_faces(detector, aligner, multiprocess)
        self.align_faces("cv2-dnn", "cv2-dnn", multiprocess)


              # but spawned processes will load this module, so we need to dummy in a queue
              self.manager = mp
          self.shutdown = self.manager.Event()
          self.queues = dict()



          logger.debug("Initialized %s", self.__class__.__name__)
  
      def add_queue(self, name, maxsize=0, multiprocessing_queue=True):
          """ Add a queue to the manager
  
keep keep keep keep replace replace replace keep keep keep keep keep
 De-Multiprocess Extract (#871)

* requirements.txt: - Pin opencv to 4.1.1 (fixes cv2-dnn error)

* lib.face_detect.DetectedFace: change LandmarksXY to landmarks_xy. Add left, right, top, bottom attributes

* lib.model.session: Session manager for loading models into different graphs (for Nvidia + CPU)

* plugins.extract._base: New parent class for all extract plugins

* plugins.extract.pipeline. Remove MultiProcessing. Dynamically limit batchsize for Nvidia cards. Remove loglevel input

* S3FD + FAN plugins. Standardise to Keras version for all backends

* Standardize all extract plugins to new threaded codebase

* Documentation. Start implementing Numpy style docstrings for Sphinx Documentation

* Remove s3fd_amd. Change convert OTF to expect DetectedFace object

* faces_detect - clean up and documentation

* Remove PoolProcess

* Migrate manual tool to new extract workflow

* Remove AMD specific extractor code from cli and plugins

* Sort tool to new extract workflow

* Remove multiprocessing from project

* Remove multiprocessing queues from QueueManager

* Remove multiprocessing support from logger

* Move face_filter to new extraction pipeline

* Alignments landmarksXY > landmarks_xy and legacy handling

* Intercept get_backend for sphinx doc build

# Add Sphinx documentation 
lib/queue_manager.py