Lots of edits
Signed-off-by: James P. Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
parent
4a900d408b
commit
8c83eceefa
@ -206,7 +206,7 @@ with conn:
|
|||||||
for i, row in enumerate(rows):
|
for i, row in enumerate(rows):
|
||||||
photoId, photoFaces, albumPath, photoFilename = row
|
photoId, photoFaces, albumPath, photoFilename = row
|
||||||
img_path = f'{base}{albumPath}{photoFilename}'
|
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:
|
try:
|
||||||
img = Image.open(img_path)
|
img = Image.open(img_path)
|
||||||
img = ImageOps.exif_transpose(img) # auto-rotate if needed
|
img = ImageOps.exif_transpose(img) # auto-rotate if needed
|
||||||
@ -244,6 +244,8 @@ with conn:
|
|||||||
'descriptorId': faceDescriptorId,
|
'descriptorId': faceDescriptorId,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
print(f'Face added to database with faceId = {faceId}')
|
||||||
|
|
||||||
path = f'{faces_path}/{"{:02d}".format(faceId % 100)}'
|
path = f'{faces_path}/{"{:02d}".format(faceId % 100)}'
|
||||||
try:
|
try:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
|
@ -7,10 +7,18 @@ import uu
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from ketrface.util import *
|
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])
|
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')
|
img = Image.open(f'{path}/{faceId}.jpg')
|
||||||
exif_dict = piexif.load(img.info["exif"])
|
exif_dict = piexif.load(img.info["exif"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user