Video-Summary/Application/Config.py

32 lines
814 B
Python
Raw Normal View History

class Config:
c = {
2022-01-09 19:25:44 +00:00
"min_area": 100,
"max_area": 900000,
"threashold": 7,
"resizeWidth": 500,
"inputPath": None,
2020-10-11 15:09:49 +00:00
"outputPath": None,
2022-01-09 19:25:44 +00:00
"maxLayerLength": 5000,
"minLayerLength": 40,
2020-12-18 20:27:19 +00:00
"tolerance": 20,
"maxLength": None,
2020-12-22 12:58:47 +00:00
"ttolerance": 60,
"videoBufferLength": 250,
2020-12-18 20:27:19 +00:00
"LayersPerContour": 220,
2022-01-09 19:25:44 +00:00
"avgNum": 10,
}
2020-10-11 15:09:49 +00:00
def __init__(self):
2022-01-09 19:25:44 +00:00
"""This is basically just a wrapper for a json / python dict"""
2020-11-08 15:28:47 +00:00
print("Current Config:")
for key, value in self.c.items():
print(f"{key}:\t\t{value}")
2022-01-09 19:25:44 +00:00
def __getitem__(self, key):
2020-10-16 08:36:52 +00:00
if key not in self.c:
return None
2022-01-09 19:25:44 +00:00
return self.c[key]
def __setitem__(self, key, value):
2020-10-11 15:09:49 +00:00
self.c[key] = value