diff --git a/ketrface/detect.py b/ketrface/detect.py index fd6b2aa..4ee8b8d 100644 --- a/ketrface/detect.py +++ b/ketrface/detect.py @@ -206,7 +206,7 @@ with conn: for i, row in enumerate(rows): photoId, photoFaces, albumPath, photoFilename = row img_path = f'{base}{albumPath}{photoFilename}' - print(f'Processing {i+1}/{count}: {img_path}') + print(f'Processing {i+1}/{count}: photoId = {photoId}: {img_path}') try: img = Image.open(img_path) img = ImageOps.exif_transpose(img) # auto-rotate if needed @@ -244,6 +244,8 @@ with conn: 'descriptorId': faceDescriptorId, }) + print(f'Face added to database with faceId = {faceId}') + path = f'{faces_path}/{"{:02d}".format(faceId % 100)}' try: os.makedirs(path) diff --git a/ketrface/headers.py b/ketrface/headers.py index 2beeb0c..afe6b2d 100644 --- a/ketrface/headers.py +++ b/ketrface/headers.py @@ -7,10 +7,18 @@ import uu from io import BytesIO from ketrface.util import * +from ketrface.config import * + +config = read_config() + +html_path = merge_config_path(config['path'], 'frontend') +pictures_path = merge_config_path(config['path'], config['picturesPath']) +faces_path = merge_config_path(config['path'], config['facesPath']) +db_path = merge_config_path(config['path'], config["db"]["photos"]["host"]) +html_base = config['basePath'] -face_base = "../" faceId = int(sys.argv[1]) -path = f'{face_base}faces/{"{:02d}".format(faceId % 10)}' +path = f'{faces_path}/{"{:02d}".format(faceId % 100)}' img = Image.open(f'{path}/{faceId}.jpg') exif_dict = piexif.load(img.info["exif"])