      NB: Keep this in it's own module! If it gets loaded from
      a multiprocess on a Windows System it will break Faceswap"""
  
  import logging
  import multiprocessing as mp
  import sys
  import threading
  
  from queue import Queue, Empty as QueueEmpty  # pylint: disable=unused-import; # noqa
  from time import sleep
  
 
</s> remove import multiprocessing as mp
from multiprocessing.sharedctypes import RawArray
from ctypes import c_float
 </s> add from multiprocessing import cpu_count </s> remove import os
 </s> add  </s> remove from lib.logger import LOG_QUEUE, set_root_logger
 </s> add  </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 from time import sleep
 </s> add 
      NB: Keep this in it's own module! If it gets loaded from
      a multiprocess on a Windows System it will break Faceswap"""
  
  import logging


  import threading
  
  from queue import Queue, Empty as QueueEmpty  # pylint: disable=unused-import; # noqa
  from time import sleep
  
keep keep keep keep 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