importing all modules at the beginning is ~40% faster
This commit is contained in:
parent
4f11da686f
commit
7aac419bd7
1 changed files with 3 additions and 5 deletions
|
|
@ -10,12 +10,14 @@ timings = {
|
|||
}
|
||||
|
||||
# Import required modules
|
||||
import cv2
|
||||
import sys
|
||||
import os
|
||||
import json
|
||||
import configparser
|
||||
from threading import Thread
|
||||
import cv2
|
||||
import dlib
|
||||
import numpy as np
|
||||
|
||||
# Get the absolute path to the current directory
|
||||
PATH = os.path.abspath(__file__ + '/..')
|
||||
|
|
@ -90,10 +92,6 @@ timings['ic'] = time.time() - timings['ic']
|
|||
|
||||
timings['ll'] = time.time()
|
||||
|
||||
# Import face recognition, takes some time
|
||||
import dlib
|
||||
import numpy as np
|
||||
|
||||
face_detector = None
|
||||
pose_predictor = None
|
||||
face_encoder = None
|
||||
|
|
|
|||
Loading…
Reference in a new issue