Skip to content

Commit

Permalink
Changed bulk_color_analysis.py to only analyze files specified in the…
Browse files Browse the repository at this point in the history
… styles dataframe ♻️
  • Loading branch information
soon-dubu committed Dec 6, 2024
1 parent a5010a5 commit c28a662
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions color_analysis/bulk_color_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit c28a662

Please sign in to comment.