summaryrefslogtreecommitdiff
path: root/megapixels/app/settings/app_cfg.py
diff options
context:
space:
mode:
Diffstat (limited to 'megapixels/app/settings/app_cfg.py')
-rw-r--r--megapixels/app/settings/app_cfg.py90
1 files changed, 90 insertions, 0 deletions
diff --git a/megapixels/app/settings/app_cfg.py b/megapixels/app/settings/app_cfg.py
new file mode 100644
index 00000000..739ddce2
--- /dev/null
+++ b/megapixels/app/settings/app_cfg.py
@@ -0,0 +1,90 @@
+import os
+from os.path import join
+import logging
+import collections
+
+import cv2 as cv
+
+from app.settings import types
+from app.utils import click_utils
+
+
+# -----------------------------------------------------------------------------
+# Enun lists used for custom Click Params
+# -----------------------------------------------------------------------------
+
+FaceDetectNetVar = click_utils.ParamVar(types.FaceDetectNet)
+
+LogLevelVar = click_utils.ParamVar(types.LogLevel)
+
+# # data_store
+DATA_STORE = '/data_store_hdd/'
+DIR_DATASETS = join(DATA_STORE,'datasets')
+DIR_APPS = join(DATA_STORE,'apps')
+DIR_APP = join(DIR_APPS,'megapixels')
+DIR_MODELS = join(DIR_APP,'models')
+
+# # Frameworks
+DIR_MODELS_CAFFE = join(DIR_MODELS,'caffe')
+DIR_MODELS_DARKNET = join(DIR_MODELS,'darknet')
+DIR_MODELS_DARKNET_PJREDDIE = join(DIR_MODELS_DARKNET, 'pjreddie')
+DIR_MODELS_PYTORCH = join(DIR_MODELS,'pytorch')
+DIR_MODELS_TORCH = join(DIR_MODELS,'torch')
+DIR_MODELS_MXNET = join(DIR_MODELS,'mxnet')
+DIR_MODELS_TF = join(DIR_MODELS,'tensorflow')
+DIR_MODELS_DLIB = join(DIR_MODELS,'dlib')
+DIR_MODELS_DLIB_CNN = join(DIR_MODELS_DLIB, 'mmod_human_face_detector.dat')
+DIR_MODELS_DLIB_5PT = join(DIR_MODELS_DLIB, 'shape_predictor_5_face_landmarks.dat')
+DIR_MODELS_DLIB_68PT = join(DIR_MODELS_DLIB, 'shape_predictor_68_face_landmarks.dat')
+
+
+# Test images
+DIR_TEST_IMAGES = join(DIR_APP, 'test', 'images')
+
+# -----------------------------------------------------------------------------
+# Drawing, GUI settings
+# -----------------------------------------------------------------------------
+DIR_ASSETS = join(DIR_APP, 'assets')
+FP_FONT = join(DIR_ASSETS, 'font')
+
+
+# -----------------------------------------------------------------------------
+# click chair settings
+# -----------------------------------------------------------------------------
+DIR_COMMANDS_PROCESSOR_ADMIN = 'admin/commands'
+DIR_COMMANDS_PROCESSOR_DATASETS = 'datasets/commands'
+
+# -----------------------------------------------------------------------------
+# Filesystem settings
+# hash trees enforce a maximum number of directories per directory
+# -----------------------------------------------------------------------------
+ZERO_PADDING = 6 # padding for enumerated image filenames
+#FRAME_NAME_ZERO_PADDING = 6 # is this active??
+CKPT_ZERO_PADDING = 9
+HASH_TREE_DEPTH = 3
+HASH_BRANCH_SIZE = 3
+
+# -----------------------------------------------------------------------------
+# Logging options exposed for custom click Params
+# -----------------------------------------------------------------------------
+LOGGER_NAME = 'app'
+LOGLEVELS = {
+ types.LogLevel.DEBUG: logging.DEBUG,
+ types.LogLevel.INFO: logging.INFO,
+ types.LogLevel.WARN: logging.WARN,
+ types.LogLevel.ERROR: logging.ERROR,
+ types.LogLevel.CRITICAL: logging.CRITICAL
+}
+LOGLEVEL_OPT_DEFAULT = types.LogLevel.DEBUG.name
+#LOGFILE_FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
+#LOGFILE_FORMAT = "%(levelname)s:%(name)s: %(message)s"
+#LOGFILE_FORMAT = "%(levelname)s: %(message)s"
+#LOGFILE_FORMAT = "%(filename)s:%(lineno)s %(funcName)s() %(message)s"
+# colored logs
+"""
+black, red, green, yellow, blue, purple, cyan and white.
+{color}, fg_{color}, bg_{color}: Foreground and background colors.
+bold, bold_{color}, fg_bold_{color}, bg_bold_{color}: Bold/bright colors.
+reset: Clear all formatting (both foreground and background colors).
+"""
+LOGFILE_FORMAT = "%(log_color)s%(levelname)-8s%(reset)s %(cyan)s%(filename)s:%(lineno)s:%(bold_cyan)s%(funcName)s() %(reset)s%(message)s" \ No newline at end of file