-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
68 lines (57 loc) · 2.43 KB
/
config.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
import pdb
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
"""Class that stores conifguration information for default gesture recognition application"""
DB_HOST = 'localhost' #database when running in docker; localhost when running locally;
DB_USER = 'postgres'
DB_PASS = 'temporary_password'
DB_NAME = 'postgres'
DEBUG = False
TESTING = False
IMAGE_DIRECTORY = os.path.join(basedir, 'images')
MODEL_PATH = os.path.join(basedir, 'gesture_recognition', 'current_model.h5')
GESTURES_MAP_PATH = os.path.join(basedir, 'gesture_recognition', 'gestures_map.json')
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', f'postgresql://{DB_USER}:{DB_PASS}@{DB_HOST}/{DB_NAME}')
SQLALCHEMY_TRACK_MODIFICATIONS = False
# celery
CELERY_CONFIG = {}
SOCKETIO_MESSAGE_QUEUE = os.environ.get('SOCKETIO_MESSAGE_QUEUE', os.environ.get('CELERY_BROKER_URL','redis://'))
# tells orchestrator where to look for featurizer.py
FEATURIZER_DIRECTORY = os.path.join(os.path.abspath(os.path.dirname(__file__)),'gesture_recognition', 'featurizer.py')
# information for monitoring.py
FIGURE_DIRECTORY = os.path.join(basedir, 'gesture_recognition', 'figures')
STATS_MESSAGE_PATH = os.path.join(FIGURE_DIRECTORY, 'stats_message.txt')
UPDATE_STATS_SECS = 15
CR_FIGURE_NAMES = (
"top_classification_report",
"middle_classification_report",
"bottom_classification_report",
)
CM_FIGURE_NAMES = (
"top_confusion_matrix",
"middle_confusion_matrix",
"bottom_confusion_matrix",
)
OTHER_FIGURE_NAMES = (
"todays_user_activity",
"gesture_prediction_accuracy_by_date",
"total_user_usage_time_by_date",
"true_gesture_counts_by_date",
)
class DevelopmentConfig(Config):
"""Class that stores conifguration information for developing gesture recognition application"""
DEBUG = True
class ProductionConfig(Config):
"""Class that stores conifguration information for deploying gesture recognition application"""
pass
class TestingConfig(Config):
"""Class that stores conifguration information for testing gesture recognition application"""
TESTING = True
CELERY_CONFIG = {'CELERY_ALWAYS_EAGER': True}
SOCKETIO_MESSAGE_QUEUE = None
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'testing': TestingConfig
}