  import operator
  import numpy as np
  import cv2
  from tqdm import tqdm
  import face_recognition
  from shutil import copyfile
  import json
  import re
  
  
 
</s> remove from threading import Lock
 </s> add import threading  </s> remove         import tensorflow as tf
        from keras.backend.tensorflow_backend import set_session
 </s> add         import_tensorflow_keras() </s> remove         from lib import FaceLandmarksExtractor
 </s> add         import_FaceLandmarksExtractor() </s> remove         from lib import FaceLandmarksExtractor
 </s> add         import_FaceLandmarksExtractor()
  import operator
  import numpy as np
  import cv2
  from tqdm import tqdm

  from shutil import copyfile
  import json
  import re
  
  
keep keep keep keep replace keep keep keep keep keep
 Only import DLIB related modules when required and minor import relocations (#315)

* Move imports to top and add conditions to load modules requiring GPU

* Fix type

* Fix typo

* Import relocation and dlib import on demand

* refactor to remove extra code lines

* remove unnecessary sys import 
tools/sort.py