Adding files

This commit is contained in:
alexmr09
2024-07-19 13:30:31 +03:00
commit 08fb8ef728
7245 changed files with 3055662 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import os
import warnings
import argparse
def positive_float(value):
f_value = float(value)
if f_value < 0:
raise argparse.ArgumentTypeError(f"{value} is not a positive float value")
return f_value
def get_args():
parser = argparse.ArgumentParser(description = 'Run elderly fall detection script.')
parser.add_argument('--max_acc_drop', type = positive_float, default = None,
help = 'Maximum accuracy drop (default: None)')
parser.add_argument('--device', type = str, choices = ['cpu', 'cuda'], default = 'cpu',
help = 'Device to run the model on (default: cpu)')
return parser.parse_args()
def initialize_environment(file_name):
# Suppress specific warnings
warnings.filterwarnings("ignore",
message="Named tensors and all their associated APIs are an experimental feature and subject to change.")
# Get the file name without extension
file_name = os.path.basename(file_name)
name = file_name.split(".")[0]
return name