-
Notifications
You must be signed in to change notification settings - Fork 0
/
initialization.py
77 lines (69 loc) · 2.32 KB
/
initialization.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -Import common packages-
import os
import cv2
import time
import numpy as np
import os
import os.path as osp
import sys
import tensorflow as tf
import streamlit as st
import pandas as pd
import time
# ------------
import Api_tools.IO_file as IO_file # import api_tools
from tools import * # import tools
# -Import Objects-
from Objects import config_
from Objects import inputSource_
from Objects import faceDetection_
from Objects import emotionDetection_
from Objects import face_landMarkDetection_
from Objects import control_
# INITIALIZE
def initialize_Config():
# Read config
print("Read config file ...",end=" ")
parsed_config = IO_file.read_config(osp.join(os.path.dirname(os.path.abspath(__file__)),"config.yml"))
config = config_.Config()
config = config.import_config(parsed_config)
print("Ok")
return config
def initialize_inputSource(config):
# Process source_video
print("Process input_source ...",end=" ")
inputSource = inputSource_.InputSource()
inputSource.process(config)
print("Ok")
return inputSource
def initialize_Control(config):
print("Process control ...",end=" ")
control = control_.Control()
control.process(config)
print("Ok")
return control
# INITIALIZE_TECHNIQUES
def initialize_faceDetector(config):
print("intialize faceDetector ...",end=" ")
faceDetector_Config = faceDetection_.FaceDetection()
faceDetector_Config.process(config)
faceDetector = faceDetector_Config.intialize()
print("OK")
return faceDetector_Config, faceDetector
def initialize_emotionDetector(config):
print("intialize emotionDetector ...",end=" ")
emotionDetector_Config = emotionDetection_.EmotionDetection()
emotionDetector_Config.process(config)
emotionDetector = emotionDetector_Config.intialize()
print("OK")
return emotionDetector_Config, emotionDetector
def initialize_face_landMarkDetector(config):
print("intialize face_landMarkDetector ...",end=" ")
face_landMarkDetection_Config = face_landMarkDetection_.Face_LandMarkDetection()
face_landMarkDetection_Config.process(config)
face_LandMarkDetector = face_landMarkDetection_Config.intialize()
print("OK")
return face_landMarkDetection_Config, face_LandMarkDetector
# INITIALIZE_INFORMATION
def initialize_random_student(faces):
pass