slightly improve ai stats
This commit is contained in:
13
ai.py
13
ai.py
@@ -23,7 +23,18 @@ from face import Face, FaceFileLink, FaceRefimgLink
|
|||||||
@login_required
|
@login_required
|
||||||
def aistats():
|
def aistats():
|
||||||
stats = db.session.execute( "select p.tag, count(f.id) from person p, face f, face_file_link ffl, face_refimg_link frl, person_refimg_link prl where p.id = prl.person_id and prl.refimg_id = frl.refimg_id and frl.face_id = ffl.face_id and ffl.face_id = f.id group by p.tag" )
|
stats = db.session.execute( "select p.tag, count(f.id) from person p, face f, face_file_link ffl, face_refimg_link frl, person_refimg_link prl where p.id = prl.person_id and prl.refimg_id = frl.refimg_id and frl.face_id = ffl.face_id and ffl.face_id = f.id group by p.tag" )
|
||||||
return render_template("aistats.html", page_title='AI Statistics', stats=stats)
|
fstats={}
|
||||||
|
fstats['files_with_a_face'] = db.session.execute( "select count(distinct file_eid) as count from face_file_link" ).first()[0]
|
||||||
|
fstats['files_with_a_match'] = db.session.execute( "select count(distinct ffl.file_eid) as count from face_file_link ffl, face_refimg_link frl where frl.face_id = ffl.face_id" ).first()[0]
|
||||||
|
fstats['files_with_missing_matches'] = db.session.execute( "select count(distinct ffl.file_eid) from face f left join face_refimg_link frl on f.id = frl.face_id join face_file_link ffl on f.id = ffl.face_id where frl.refimg_id is null" ).first()[0]
|
||||||
|
|
||||||
|
# files_with_no_matches?
|
||||||
|
|
||||||
|
fstats['all_faces'] = db.session.execute( "select count(distinct face_id) as count from face_file_link" ).first()[0]
|
||||||
|
fstats['all_matched_faces'] = db.session.execute( "select count(distinct face_id) as count from face_refimg_link" ).first()[0]
|
||||||
|
fstats['all_unmatched_faces'] = db.session.execute( "select count(f.id) from face f left join face_refimg_link frl on f.id = frl.face_id where frl.refimg_id is null" ).first()[0]
|
||||||
|
|
||||||
|
return render_template("aistats.html", page_title='AI Statistics', stats=stats, fstats=fstats )
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
@@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
{% block main_content %}
|
{% block main_content %}
|
||||||
<h3>Basic AI stats</h3>
|
<h3>Basic AI stats</h3>
|
||||||
|
<table class="table table-striped table-sm">
|
||||||
|
<tbody><thead class="thead-light"><tr><th>What</th><th>Amount</th></tr></thead>
|
||||||
|
<tr><td>Files with a face</td><td>{{fstats['files_with_a_face']}}</td></tr>
|
||||||
|
<tr><td>Files with a matched face</td><td>{{fstats['files_with_a_match']}}</td></tr>
|
||||||
|
<tr><td>Files with missing matches</td><td>{{fstats['files_with_missing_matches']}}</td></tr>
|
||||||
|
<tr><td>All faces found</td><td>{{fstats['all_faces']}}</td></tr>
|
||||||
|
<tr><td>All faces matched</td><td>{{fstats['all_matched_faces']}}</td></tr>
|
||||||
|
<tr><td>All faces unmatched</td><td>{{fstats['all_unmatched_faces']}}</td></tr>
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
<table class="table table-striped table-sm">
|
<table class="table table-striped table-sm">
|
||||||
<tbody><thead class="thead-light"><tr><th>Person (tag)</th><th>Number of files matched</th></thead>
|
<tbody><thead class="thead-light"><tr><th>Person (tag)</th><th>Number of files matched</th></thead>
|
||||||
{% for s in stats %}
|
{% for s in stats %}
|
||||||
|
|||||||
Reference in New Issue
Block a user