updated TODO to remove AI job count issues, and added optimised AI searching code to reduce DB queries on recursion into dirs

This commit is contained in:
2021-07-07 17:42:00 +10:00
parent 8b857bf994
commit fbd9e72f28
2 changed files with 15 additions and 17 deletions

16
TODO
View File

@@ -1,20 +1,22 @@
## GENERAL
* with any job, count logs, then commit per 100 log lines of a job (and then ditch the commit in import dir for this)
* refimg
- remove AI menu from top-level -> make a sub-of Person, and just have Match or AI
- store the face locations? (good for debugging later, and we calc them as part of GenFace anyway) ...
(really, doing this properly, we shoudl keep the face locns for ALL images)...
---> may well mean in a week or so, we move to the new DB structure, and START FORM SCRATCH)
* need AI job to:
log amount matched, amount comparing too -> count should actually be total files in 'entries' (as we can select random entries to check)
* with any job, count logs, then commit per 100 log lines of a job (and then ditch the commit in import dir for this)
* allow rotate of image (permanently on FS, so its right everywhere)
* improve photo browser -> view file, rather than just allowing browser to show image
* allow for threshold/settings to be tweaked from the GUI
- it would be good to then say, just run the scanner against this image or maybe this DIR, to see how it IDs ppl
---> settings for default value
---> override table to do per file combos?
* fix up logging in general
* comment your code
* more OO goodness :)
@@ -76,10 +78,6 @@
https://www.highcharts.com/demo/heatmap
https://www.highcharts.com/demo/packed-bubble-split
### AI
* allow for threshold/settings to be tweaked from the GUI
- it would be good to then say, just run the scanner against this image or maybe this DIR, to see how it IDs ppl
### SORTER
* exif processing?

View File

@@ -951,16 +951,12 @@ def JobProcessAI(job):
def WrapperForScanFileForPerson(job, entry):
which_person=[jex.value for jex in job.extra if jex.name == "person"][0]
if which_person == "all":
ppl=session.query(Person).all()
else:
ppl=session.query(Person).filter(Person.tag==which_person).all()
if entry.type.name == 'Image':
if DEBUG:
AddLogForJob( job, f'INFO: processing File: {entry.name}' )
for person in ppl:
ScanFileForPerson( job, entry, person.id, force=False)
for pid in job.ppl:
ScanFileForPerson( job, entry, pid, force=False)
# processed this file, add 1 to count
job.current_file_num+=1
return
@@ -992,9 +988,14 @@ def JobRunAIOn(job):
# update job, so file count UI progress bar will work
# remember that ProcessFilesInDir updates the current_file_num so zero it out so we can start again
job.current_file_num = 0
print( f"about to commit: {job}" )
session.commit()
ppl_lst=[]
for person in ppl:
ppl_lst.append(person.id)
job.ppl = ppl_lst
for jex in job.extra:
if 'eid-' in jex.name:
entry=session.query(Entry).get(jex.value)
@@ -1430,7 +1431,6 @@ def UnmatchedFacesForFile( eid ):
return rows
def ScanFileForPerson( job, e, person_id, force=False ):
# AddLogForJob( job, f'INFO: Looking for person: {person_id} in file: {e.name}' )
file_h = session.query(File).get( e.id )
# if we are forcing this, delete any old faces (this will also delete linked tables), and reset faces_created_on to None
if force: