quick fix/hack for unmatched faces
This commit is contained in:
35
TODO
35
TODO
@@ -1,34 +1,31 @@
|
|||||||
## GENERAL
|
## GENERAL
|
||||||
* on viewer:
|
* on viewer:
|
||||||
- allow face to be used to:
|
- allow face to be used to:
|
||||||
[DONE] - create person
|
[DONE] - create person
|
||||||
[DONE] - add to existing person
|
[DONE] - add to existing person
|
||||||
--> still need to consider whether we trigger an AI search immediately (for these 2 options)
|
--> still need to consider whether we trigger an AI search immediately (for these 2 options)
|
||||||
[DONE] - ignore/not a face/too young
|
[DONE] - ignore/not a face/too young
|
||||||
[DONE] - redraw 'ignore's as a greyed out box?
|
[DONE] - redraw 'ignore's as a greyed out box?
|
||||||
[DONE] - menu should only allow override IF we have put override on...
|
[DONE] - menu should only allow override IF we have put override on...
|
||||||
all NMO's need to handle delete data and rebuild / allow recreation of content form FS (not just test, it causes a bug now / db constraint violation)
|
all NMO's need to handle delete data and rebuild / allow recreation of content form FS (not just test, it causes a bug now / db constraint violation)
|
||||||
--> need to test the 'override' when we re-ai-match (AFTER re-build from FS)
|
--> need to test the 'override' when we re-ai-match (AFTER re-build from FS)
|
||||||
|
|
||||||
* capture pa_job_manager logs in prod
|
* capture pa_job_manager logs in prod
|
||||||
- redir'd to /var/log/pa* but NO content, seems wrong
|
- redir'd to /var/log/pa* but NO content, seems wrong
|
||||||
|
|
||||||
* should I change the rotation code to use that jpeg util to reduce/remove compression loss?
|
* should I change the rotation code to use that jpeg util to reduce/remove compression loss?
|
||||||
|
|
||||||
* should allow context menu from View thumbs (particularly useful on search) to show other files around this one by date (maybe that folder or something?)
|
* should allow context menu from View thumbs (particularly useful on search) to show other files around this one by date (maybe that folder or something?)
|
||||||
|
|
||||||
* re-think unmatched faces...
|
|
||||||
(the view needs a orig_url and pa_user_state to support viewer for current)
|
|
||||||
|
|
||||||
* could get better AI optim, by keeping track of just new files since scan (even if we did this from the DB),
|
* could get better AI optim, by keeping track of just new files since scan (even if we did this from the DB),
|
||||||
then we could just feed those eid's explicitly into a 'run_ai_on_new_files' :) -- maybe particularly
|
then we could just feed those eid's explicitly into a 'run_ai_on_new_files' :) -- maybe particularly
|
||||||
if count('new files') < say 1000 do eids, otherwise do path AND no new refimgs
|
if count('new files') < say 1000 do eids, otherwise do path AND no new refimgs
|
||||||
|
|
||||||
* does search of matching dirname give all entries of subdirs of subdirs, etc. (think not) -- maybe a TODO?
|
* does search of matching dirname give all entries of subdirs of subdirs, etc. (think not) -- maybe a TODO?
|
||||||
|
|
||||||
* video player cannot handle non mp4 formats... do I care? (could just offer a download link and hope the client deals with it)
|
* video player cannot handle non mp4 formats... do I care? (could just offer a download link and hope the client deals with it)
|
||||||
--> OR? https://jsmpeg.com/
|
--> OR? https://jsmpeg.com/
|
||||||
--> OR? convert all videos to mp4/webm
|
--> OR? convert all videos to mp4/webm
|
||||||
|
|
||||||
* delete folder
|
* delete folder
|
||||||
|
|
||||||
@@ -50,7 +47,7 @@
|
|||||||
- searched for text overlaps buttons above and below
|
- searched for text overlaps buttons above and below
|
||||||
- < 10 files > is subsequently not centered
|
- < 10 files > is subsequently not centered
|
||||||
- the folder/bin icons might be best below search then? (and on same line as XS/S, etc.)
|
- the folder/bin icons might be best below search then? (and on same line as XS/S, etc.)
|
||||||
* on phone login page, job* pages, etc. are all squished
|
* on phone login page, job* pages, etc. are all squished
|
||||||
* when search, have a way to hide deleted files
|
* when search, have a way to hide deleted files
|
||||||
-> not sure where to put this on GUI, its so busy...
|
-> not sure where to put this on GUI, its so busy...
|
||||||
|
|
||||||
@@ -73,13 +70,13 @@
|
|||||||
https://www.pyimagesearch.com/2018/07/09/face-clustering-with-python/
|
https://www.pyimagesearch.com/2018/07/09/face-clustering-with-python/
|
||||||
|
|
||||||
* fix up logging in general
|
* fix up logging in general
|
||||||
ProcessFileForJob --> really need to better handle log levels and counting
|
ProcessFileForJob --> really need to better handle log levels and counting
|
||||||
|
|
||||||
* support animated gifs in html5 canvas
|
* support animated gifs in html5 canvas
|
||||||
|
|
||||||
* think about security - in job_mgr anywhere I can os.replace/remove NEED to protect, etc
|
* think about security - in job_mgr anywhere I can os.replace/remove NEED to protect, etc
|
||||||
|
|
||||||
## DB
|
## DB
|
||||||
* Dir can have date in the DB, so we can do Oldest/Newest dirs in Folder view
|
* Dir can have date in the DB, so we can do Oldest/Newest dirs in Folder view
|
||||||
|
|
||||||
### BACKEND
|
### BACKEND
|
||||||
@@ -118,8 +115,8 @@
|
|||||||
|
|
||||||
|
|
||||||
### SORTER
|
### SORTER
|
||||||
* exif processing?
|
* exif processing?
|
||||||
* location stuff - test a new photo from my camera out
|
* location stuff - test a new photo from my camera out
|
||||||
-- image is in dir, need to look at exifread output
|
-- image is in dir, need to look at exifread output
|
||||||
|
|
||||||
### FUTURE:
|
### FUTURE:
|
||||||
|
|||||||
11
ai.py
11
ai.py
@@ -87,14 +87,15 @@ def unmatched_faces():
|
|||||||
faces=Face.query.join(FaceFileLink).join(FaceRefimgLink, isouter=True).filter(FaceRefimgLink.refimg_id==None).order_by(Face.h.desc()).limit(10).all()
|
faces=Face.query.join(FaceFileLink).join(FaceRefimgLink, isouter=True).filter(FaceRefimgLink.refimg_id==None).order_by(Face.h.desc()).limit(10).all()
|
||||||
imgs={}
|
imgs={}
|
||||||
for face in faces:
|
for face in faces:
|
||||||
tmp_locn=json.loads(face.locn)
|
face.tmp_locn=json.loads(face.locn)
|
||||||
f = Entry.query.join(File).join(FaceFileLink).filter(FaceFileLink.face_id==face.id).first()
|
f = Entry.query.join(File).join(FaceFileLink).filter(FaceFileLink.face_id==face.id).first()
|
||||||
face.file_eid=f.id
|
face.file_eid=f.id
|
||||||
face.url=f.FullPathOnFS()
|
face.url=f.FullPathOnFS()
|
||||||
x=tmp_locn[3]*0.95
|
face.filename=f.name
|
||||||
y=tmp_locn[0]*0.95
|
x=face.tmp_locn[3]*0.95
|
||||||
x2=tmp_locn[1]*1.05
|
y=face.tmp_locn[0]*0.95
|
||||||
y2=tmp_locn[2]*1.05
|
x2=face.tmp_locn[1]*1.05
|
||||||
|
y2=face.tmp_locn[2]*1.05
|
||||||
|
|
||||||
im = Image.open(f.FullPathOnFS())
|
im = Image.open(f.FullPathOnFS())
|
||||||
region = im.crop((x, y, x2, y2))
|
region = im.crop((x, y, x2, y2))
|
||||||
|
|||||||
@@ -7,9 +7,7 @@
|
|||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
{% for f in faces %}
|
{% for f in faces %}
|
||||||
<div id="F{{f.id}}" class="col col-auto mt-3 pr-1">
|
<div id="F{{f.id}}" class="col col-auto mt-3 pr-1">
|
||||||
<form id="_fm" method="POST" action="/view/{{f.file_eid}}">
|
<form id="_fm" method="POST" action="/search/{{f.filename}}">
|
||||||
<input type="hidden" name="eids" value="{{f.file_eid}},">
|
|
||||||
<input type="hidden" name="orig_url" value="/files_ip">
|
|
||||||
<figure id="fig_{{f.id}}" class="mb-0">
|
<figure id="fig_{{f.id}}" class="mb-0">
|
||||||
<div style="position:relative">
|
<div style="position:relative">
|
||||||
<canvas id="c_{{f.id}}" height="128"></canvas>
|
<canvas id="c_{{f.id}}" height="128"></canvas>
|
||||||
@@ -19,12 +17,12 @@
|
|||||||
fig_{{f.id}}=$('#fig_{{f.id}}')
|
fig_{{f.id}}=$('#fig_{{f.id}}')
|
||||||
// store this stuff in an javascript Object to use when document is ready event is triggered
|
// store this stuff in an javascript Object to use when document is ready event is triggered
|
||||||
var orig_face_{{f.id}}=new Object;
|
var orig_face_{{f.id}}=new Object;
|
||||||
orig_face_{{f.id}}.x = (({{f.locn[1]}}*1.05 - {{f.locn[3]}}*.95) - {{f.w}}) / 2
|
orig_face_{{f.id}}.x = (({{f.tmp_locn[1]}}*1.05 - {{f.tmp_locn[3]}}*.95) - {{f.w}}) / 2
|
||||||
orig_face_{{f.id}}.y = (({{f.locn[2]}}*1.05 - {{f.locn[0]}}*.95) - {{f.h}}) / 2
|
orig_face_{{f.id}}.y = (({{f.tmp_locn[2]}}*1.05 - {{f.tmp_locn[0]}}*.95) - {{f.h}}) / 2
|
||||||
orig_face_{{f.id}}.w = {{f.w}}
|
orig_face_{{f.id}}.w = {{f.w}}
|
||||||
orig_face_{{f.id}}.h = {{f.h}}
|
orig_face_{{f.id}}.h = {{f.h}}
|
||||||
orig_face_{{f.id}}.orig_w = {{f.locn[1]}}*1.05 - {{f.locn[3]}}*.95
|
orig_face_{{f.id}}.orig_w = {{f.tmp_locn[1]}}*1.05 - {{f.tmp_locn[3]}}*.95
|
||||||
orig_face_{{f.id}}.orig_h = {{f.locn[2]}}*1.05 - {{f.locn[0]}}*.95
|
orig_face_{{f.id}}.orig_h = {{f.tmp_locn[2]}}*1.05 - {{f.tmp_locn[0]}}*.95
|
||||||
|
|
||||||
//console.log( orig_face_{{f.id}} )
|
//console.log( orig_face_{{f.id}} )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user