import pandas as pd
import os
from pathlib import Path

BASE_PATH = Path('static/images/')
image_labels = pd.read_csv('static/data/lfw_image_issues.csv')
image_labels['good_image'] = image_labels['KEEP_FINAL'] == "Yes"
bad_files = image_labels.query('~good_image')['Image Title'].tolist()
for file in bad_files:
    os.remove(BASE_PATH / file)
