moved generating refimgs to once per import dir, rather than once per file (duh), and fixed BUG-18 (file counting wrong in ProcessAI)
This commit is contained in:
1
BUGs
1
BUGs
@@ -1,4 +1,3 @@
|
|||||||
### Next: 19
|
### Next: 19
|
||||||
BUG-16: now we dont do dir level optimising for genfiledetails, need to stat the file / check dates that way to optimise
|
BUG-16: now we dont do dir level optimising for genfiledetails, need to stat the file / check dates that way to optimise
|
||||||
BUG-17: I think it won't handle me deleting files after scan
|
BUG-17: I think it won't handle me deleting files after scan
|
||||||
BUG-18: ProcessAI not counting files properly
|
|
||||||
|
|||||||
@@ -486,6 +486,11 @@ def JobProcessAI(job):
|
|||||||
path = SymlinkName(path, '/')
|
path = SymlinkName(path, '/')
|
||||||
d=session.query(Dir).filter(Dir.path_prefix==path).first()
|
d=session.query(Dir).filter(Dir.path_prefix==path).first()
|
||||||
job.num_files=d.num_files
|
job.num_files=d.num_files
|
||||||
|
|
||||||
|
people = session.query(Person).all()
|
||||||
|
for person in people:
|
||||||
|
generateKnownEncodings(person)
|
||||||
|
|
||||||
for e in FilesInDir( path ):
|
for e in FilesInDir( path ):
|
||||||
ProcessFilesInDir(job, e, ProcessAI)
|
ProcessFilesInDir(job, e, ProcessAI)
|
||||||
FinishJob(job, "Finished Processesing AI")
|
FinishJob(job, "Finished Processesing AI")
|
||||||
@@ -508,13 +513,9 @@ def GenHashAndThumb(job, e):
|
|||||||
def ProcessAI(job, e):
|
def ProcessAI(job, e):
|
||||||
if e.type.name != 'Image':
|
if e.type.name != 'Image':
|
||||||
job.current_file_num+=1
|
job.current_file_num+=1
|
||||||
|
print("DDP: ProcessAI: adding 1 to current_file_num as we have a non-image file")
|
||||||
return
|
return
|
||||||
|
|
||||||
people = session.query(Person).all()
|
|
||||||
for person in people:
|
|
||||||
generateKnownEncodings(person)
|
|
||||||
|
|
||||||
|
|
||||||
file = e.in_dir[0].path_prefix + '/' + e.name
|
file = e.in_dir[0].path_prefix + '/' + e.name
|
||||||
stat = os.stat(file)
|
stat = os.stat(file)
|
||||||
# only find faces if we have not already OR file is newer than when we found faces before
|
# only find faces if we have not already OR file is newer than when we found faces before
|
||||||
@@ -530,10 +531,12 @@ def ProcessAI(job, e):
|
|||||||
e.file_details[0].faces = flat_faces.tobytes()
|
e.file_details[0].faces = flat_faces.tobytes()
|
||||||
else:
|
else:
|
||||||
e.file_details[0].faces = None
|
e.file_details[0].faces = None
|
||||||
|
job.current_file_num+=1
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
if not e.file_details[0].faces:
|
if not e.file_details[0].faces:
|
||||||
print("OPTIM: This image has no faces, skip it")
|
print("OPTIM: This image has no faces, skip it")
|
||||||
|
job.current_file_num+=1
|
||||||
return
|
return
|
||||||
recover=numpy.frombuffer(e.file_details[0].faces,dtype=numpy.float64)
|
recover=numpy.frombuffer(e.file_details[0].faces,dtype=numpy.float64)
|
||||||
real_recover=numpy.reshape(recover,(-1,128))
|
real_recover=numpy.reshape(recover,(-1,128))
|
||||||
@@ -541,6 +544,7 @@ def ProcessAI(job, e):
|
|||||||
for el in real_recover:
|
for el in real_recover:
|
||||||
l.append(numpy.array(el))
|
l.append(numpy.array(el))
|
||||||
faces = l
|
faces = l
|
||||||
|
people = session.query(Person).all()
|
||||||
for unknown_encoding in faces:
|
for unknown_encoding in faces:
|
||||||
for person in people:
|
for person in people:
|
||||||
lookForPersonInImage(job, person, unknown_encoding, e)
|
lookForPersonInImage(job, person, unknown_encoding, e)
|
||||||
|
|||||||
Reference in New Issue
Block a user