-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
32 lines (21 loc) · 905 Bytes
/
main.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
from data_land_marker import LandMarker
from image_classifier import Classifier
from camera_classifier import CameraClassifier
IMAGES_DIR = 'data/images/'
PREDICTOR_PATH = 'shape_predictor_68_face_landmarks.dat'
INITIAL_CSV = 'data/csvs/ds_original.csv'
FINAL_CSV = 'data/csvs/ds_classes_equalized.csv'
def main():
land_marker = LandMarker(landmark_predictor_path=PREDICTOR_PATH)
rf_classifier = Classifier(csv_path=FINAL_CSV, algorithm='SVM', land_marker=land_marker)
"""
from data_preparer import PreProcessor, DatasetBuilder
# Pre-process data
PreProcessor(data_dir=IMAGES_DIR).preprocess()
# Build dataset as csv
DatasetBuilder(data_dir=IMAGES_DIR, class_feature='emotion', landmarker=landmarker).build(target=INITIAL_CSV)
"""
CameraClassifier(classifier_model=rf_classifier).execute()
if __name__ == "__main__":
main()
print('success')