Lots of edits

Signed-off-by: James P. Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
James P. Ketrenos 2023-01-15 15:54:37 -08:00
parent 4a900d408b
commit 8c83eceefa
2 changed files with 13 additions and 3 deletions

View File

@ -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)

View File

@ -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"])