diff --git a/BUGs b/BUGs index f4baa85..c832378 100644 --- a/BUGs +++ b/BUGs @@ -1 +1,2 @@ ### Next: 100 +BUG-100: I managed to get 2 photos matching mich in the NOT_WORKING photo (probably dif refimgs but same p.tag?) diff --git a/TODO b/TODO index fe5fe13..7b80dd3 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,7 @@ - allow face to be used to: [DONE] - create person [DONE] - add to existing person - --> still need to consider whether we trigger an AI search immediately (for these 2 options) + [DONE] --> can choose to do AI search (for these 2 options) [DONE] - ignore/not a face/too young [DONE] - redraw 'ignore's as a greyed out box? [DONE] - menu should only allow override IF we have put override on... diff --git a/internal/js/view_support.js b/internal/js/view_support.js index afa3aca..1f2f159 100644 --- a/internal/js/view_support.js +++ b/internal/js/view_support.js @@ -309,9 +309,9 @@ function CreatePersonAndRefimg( key ) }) } -function AddRefImgTo( person_id, key ) +function AddRefimgTo( person_id, key, search ) { - d='&face_id='+item[key].id+'&person_id='+person_id+'&refimg_data='+item[key].refimg_data + d='&face_id='+item[key].id+'&person_id='+person_id+'&refimg_data='+item[key].refimg_data+'&search='+search $.ajax({ type: 'POST', data: d, url: '/add_refimg_to_person', success: function(data) { objs[current].faces[item[key].which_face].who=data.who @@ -328,21 +328,30 @@ function AddRefImgTo( person_id, key ) // and displays results in #search_person_results function SearchForPerson(content, key, face_id, face_pos, type_id) { - console.log( 'type_id=' + item[key].type_id ) // make URI safe who = encodeURIComponent( $('#stext').val() ) // call ajax to find ppl $.ajax({ type: 'POST', data: null, url: '/find_persons/'+ who, success: function(data) { for( var el in data ) { + content+='
' var person = data[el]; // NMO_1 is a non-match-override type_id==1 (or force match to existing person) if( key == "NMO_1" ) - content+= '' - +person.firstname+' '+person.surname+' ('+person.tag+')
' + { + func='OverrideForceMatch('+person.id+',\''+key+'\' )' + func_sn=func_func_ao=func + } if( key == 'no_match_new_refimg' ) - content+= '' - +person.firstname+' '+person.surname+' ('+person.tag+')
' + { + func='AddRefimgTo('+person.id+',\''+key+'\'' + func_sn=func+ ', true )' + func_ao=func+ ', false )' + } + content+= '
' + person.tag + ' (' + person.firstname+' '+person.surname+ ')
' + content+= '
' + content+='
' } $('#search_person_results').html( content ) } diff --git a/person.py b/person.py index 52d073c..ad6a49d 100644 --- a/person.py +++ b/person.py @@ -10,6 +10,9 @@ from flask_login import login_required, current_user from werkzeug.utils import secure_filename from shared import GenFace, GenThumb from face import Face, FaceRefimgLink, FaceOverrideType, FaceNoMatchOverride, FaceManualOverride +from path import Path, PathType +from job import JobExtra, NewJob + import os import json import time @@ -310,6 +313,21 @@ def add_refimg_to_person(): fname=TempRefimgFile( request.form['refimg_data'], p.tag ) AddRefimgToPerson( fname, p ) + if request.form['search'] == "true": + jex=[] + ptype=PathType.query.filter(PathType.name=='Import').first() + jex.append( JobExtra( name=f"person", value="all" ) ) + jex.append( JobExtra( name=f"path_type", value=ptype.id ) ) + job=NewJob( "run_ai_on_path", 0, None, jex ) + st.SetMessage( f"Created Job #{job.id} to Look for face(s) in import path(s)") + + jex=[] + ptype=PathType.query.filter(PathType.name=='Storage').first() + jex.append( JobExtra( name=f"person", value="all" ) ) + jex.append( JobExtra( name=f"path_type", value=ptype.id ) ) + job=NewJob( "run_ai_on_path", 0, None, jex ) + st.SetMessage( f"Created Job #{job.id} to Look for face(s) in storage path(s)") + resp['who']=p.tag resp['distance']='0.0' return resp