Update config/app_config.py
Browse files- config/app_config.py +14 -0
config/app_config.py
CHANGED
|
@@ -94,6 +94,13 @@ class ProcessingConfig:
|
|
| 94 |
hard_high: float = float(os.getenv('HARD_HIGH', '0.8'))
|
| 95 |
hard_threshold: float = float(os.getenv('HARD_THRESHOLD', '0.5'))
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
# Output settings
|
| 98 |
output_dir: str = os.getenv('OUTPUT_DIR', 'outputs')
|
| 99 |
output_format: str = os.getenv('OUTPUT_FORMAT', 'mp4')
|
|
@@ -215,6 +222,13 @@ def _validate_config(self):
|
|
| 215 |
self.hard_high = max(0.0, min(1.0, self.hard_high))
|
| 216 |
self.hard_threshold = max(0.0, min(1.0, self.hard_threshold))
|
| 217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
# Validate output settings
|
| 219 |
valid_formats = ['mp4', 'avi', 'mov', 'webm', 'mkv']
|
| 220 |
if self.output_format not in valid_formats:
|
|
|
|
| 94 |
hard_high: float = float(os.getenv('HARD_HIGH', '0.8'))
|
| 95 |
hard_threshold: float = float(os.getenv('HARD_THRESHOLD', '0.5'))
|
| 96 |
|
| 97 |
+
# Morphological operations for mask processing (ADDED)
|
| 98 |
+
dilate_px: int = int(os.getenv('DILATE_PX', '0'))
|
| 99 |
+
erode_px: int = int(os.getenv('ERODE_PX', '0'))
|
| 100 |
+
open_px: int = int(os.getenv('OPEN_PX', '0'))
|
| 101 |
+
close_px: int = int(os.getenv('CLOSE_PX', '0'))
|
| 102 |
+
morph_iterations: int = int(os.getenv('MORPH_ITERATIONS', '1'))
|
| 103 |
+
|
| 104 |
# Output settings
|
| 105 |
output_dir: str = os.getenv('OUTPUT_DIR', 'outputs')
|
| 106 |
output_format: str = os.getenv('OUTPUT_FORMAT', 'mp4')
|
|
|
|
| 222 |
self.hard_high = max(0.0, min(1.0, self.hard_high))
|
| 223 |
self.hard_threshold = max(0.0, min(1.0, self.hard_threshold))
|
| 224 |
|
| 225 |
+
# Validate morphological operations (ADDED)
|
| 226 |
+
self.dilate_px = max(0, min(20, self.dilate_px))
|
| 227 |
+
self.erode_px = max(0, min(20, self.erode_px))
|
| 228 |
+
self.open_px = max(0, min(20, self.open_px))
|
| 229 |
+
self.close_px = max(0, min(20, self.close_px))
|
| 230 |
+
self.morph_iterations = max(1, min(10, self.morph_iterations))
|
| 231 |
+
|
| 232 |
# Validate output settings
|
| 233 |
valid_formats = ['mp4', 'avi', 'mov', 'webm', 'mkv']
|
| 234 |
if self.output_format not in valid_formats:
|