From c28a662c511f1183b623498e9da0478928185693 Mon Sep 17 00:00:00 2001 From: soon-dubu Date: Thu, 5 Dec 2024 16:02:29 -0800 Subject: [PATCH] =?UTF-8?q?Changed=20bulk=5Fcolor=5Fanalysis.py=20to=20onl?= =?UTF-8?q?y=20analyze=20files=20specified=20in=20the=20styles=20dataframe?= =?UTF-8?q?=20=E2=99=BB=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- color_analysis/bulk_color_analysis.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/color_analysis/bulk_color_analysis.py b/color_analysis/bulk_color_analysis.py index 4252d993..3ccc371b 100644 --- a/color_analysis/bulk_color_analysis.py +++ b/color_analysis/bulk_color_analysis.py @@ -54,8 +54,11 @@ def run_color_analysis(dir: str, styles_dir): style_table = pd.read_csv(styles_dir, index_col=0, on_bad_lines="warn") print(style_table.head()) # get all files in dir - files = [join(dir, f) for f in listdir(dir) if isfile(join(dir, f))] - season_dist = {} + files = list(map(lambda x: f'{dir}/{x}.jpg', style_table.index.values.tolist())) + # print(files) + # return + # files = [join(dir, f) for f in listdir(dir) if isfile(join(dir, f))] + # season_dist = {} # create color palettes for each season first summer_palette = extract_colors(image="nonspecific-season-palettes/summer-palette.jpg", palette_size=144, sort_mode="luminance") @@ -64,7 +67,6 @@ def run_color_analysis(dir: str, styles_dir): autumn_palette = extract_colors(image="nonspecific-season-palettes/autumn-palette.jpg", palette_size=144, sort_mode="luminance") for file in tqdm(files): - # for file in files: # Get season try: season = color_analysis(file, spring_palette, summer_palette, winter_palette, autumn_palette)