Skip to content

Commit

Permalink
add default values for environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Aug 10, 2024
1 parent a1a70e5 commit 479f5f5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions utils/VariableClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,20 @@ def __init__(self):
self.MAX_CLUSTERS = int(os.getenv("MAX_CLUSTERS"))

# Classification parameters
self.CLASSIFICATION_FPS = int(os.getenv("CLASSIFICATION_FPS"))
self.CLASSIFICATION_FPS = int(os.getenv("CLASSIFICATION_FPS", "15"))
self.CLASSIFICATION_THRESHOLD = float(
os.getenv("CLASSIFICATION_THRESHOLD"))
if os.getenv("MAX_NUMBER_OF_PREDICTIONS") is not None:
self.MAX_NUMBER_OF_PREDICTIONS = int(
os.getenv("MAX_NUMBER_OF_PREDICTIONS"))
os.getenv("MAX_NUMBER_OF_PREDICTIONS", "50"))
if os.getenv("MIN_DISTANCE") is not None:
self.MIN_DISTANCE = int(os.getenv("MIN_DISTANCE"))
self.MIN_DISTANCE = int(os.getenv("MIN_DISTANCE", "500"))
if os.getenv("MIN_STATIC_DISTANCE") is not None:
self.MIN_STATIC_DISTANCE = int(os.getenv("MIN_DISTANCE"))
self.MIN_STATIC_DISTANCE = int(
os.getenv("MIN_STATIC_DISTANCE", "100"))
if os.getenv("MIN_DETECTIONS") is not None:
self.MIN_DETECTIONS = int(os.getenv("MIN_DETECTIONS"))
self.MIN_DETECTIONS = int(os.getenv("MIN_DETECTIONS", "5"))

ALLOWED_CLASSIFICATIONS_STR = os.getenv("ALLOWED_CLASSIFICATIONS")
self.ALLOWED_CLASSIFICATIONS = [
int(item.strip()) for item in ALLOWED_CLASSIFICATIONS_STR.split(',')]
Expand Down

0 comments on commit 479f5f5

Please sign in to comment.