From 9d92ed0858c28dfad228cd81f913b24d5ee6db77 Mon Sep 17 00:00:00 2001 From: Christian Krinitsin Date: Wed, 4 Jun 2025 21:59:15 +0200 Subject: rename script --- classification/tools/parse_categories.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100755 classification/tools/parse_categories.py (limited to 'classification/tools/parse_categories.py') diff --git a/classification/tools/parse_categories.py b/classification/tools/parse_categories.py deleted file mode 100755 index c57c45e6..00000000 --- a/classification/tools/parse_categories.py +++ /dev/null @@ -1,29 +0,0 @@ -from os import listdir, path - -root_directory = "../../results/classifier/" - -def parse_iteration(directory): - dictionary = {} - - for entry in listdir(directory): - full_path = path.join(directory, entry) - if path.isdir(full_path): - dictionary[entry] = len([name for name in listdir(full_path)]) - - return dictionary - -def output_csv(dictionary, full_path): - with open(path.join(full_path, 'categories.csv'), "w") as file: - file.write("category, count\n") - for key, value in dictionary.items(): - file.write(f"{key}, {value}\n") - -def main(): - for entry in listdir(root_directory): - full_path = path.join(root_directory, entry) - if path.isdir(full_path): - dictionary = parse_iteration(full_path) - output_csv(dictionary, full_path) - -if __name__ == "__main__": - main() -- cgit 1.4.1