started hooking up right-click menu for Dir and Files all the way through to calling the new ScanFileForPerson() - which is still incomplete but does use the new Faces DB linkages and functions
This commit is contained in:
22
ai.py
22
ai.py
@@ -10,6 +10,9 @@ from person import Person, PersonRefimgLink
|
||||
from refimg import Refimg
|
||||
from flask_login import login_required, current_user
|
||||
|
||||
from job import Job, JobExtra, Joblog, NewJob
|
||||
|
||||
|
||||
# pylint: disable=no-member
|
||||
|
||||
################################################################################
|
||||
@@ -28,3 +31,22 @@ def aistats():
|
||||
last_fname = e.name
|
||||
entry['people'].append( { 'tag': p.tag } )
|
||||
return render_template("aistats.html", page_title='Placeholder', entries=entries)
|
||||
|
||||
|
||||
################################################################################
|
||||
# /run_ai_on -> CAM: needs more thought (what actual params, e.g list of file -
|
||||
# tick, but which face or faces? are we forcing a re-finding of unknown faces
|
||||
# or just looking for matches? (maybe in the long run there are different
|
||||
# routes, not params - stuff we will work out as we go)
|
||||
################################################################################
|
||||
@app.route("/run_ai_on", methods=["POST"])
|
||||
@login_required
|
||||
def run_ai_on():
|
||||
jex=[]
|
||||
for el in request.form:
|
||||
jex.append( JobExtra( name=f"{el}", value=request.form[el] ) )
|
||||
print( f"would create new job with extras={jex}" )
|
||||
job=NewJob( "run_ai_on", 0, None, jex )
|
||||
st.SetAlert("success")
|
||||
st.SetMessage( f"Created <a href=/job/{job.id}>Job #{job.id}</a> to Look for face(s) in selected file(s)")
|
||||
return render_template("base.html")
|
||||
|
||||
Reference in New Issue
Block a user