Skip to content

Commit

Permalink
Added example [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
RhetTbull committed Apr 6, 2024
1 parent 455f619 commit c617c44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import datetime
import json
import sqlite3
import sys
from typing import Any

Expand Down Expand Up @@ -72,14 +73,16 @@ def get_unnamed_person_photos(
photos_version = photosdb.photos_version
asset_table = _DB_TABLE_NAMES[photos_version]["ASSET"]
asset_fk = _DB_TABLE_NAMES[photos_version]["DETECTED_FACE_ASSET_FK"]
person_fk = _DB_TABLE_NAMES[photos_version]["DETECTED_FACE_PERSON_FK"]
results = photosdb.execute(
f""" SELECT {asset_table}.ZUUID
FROM {asset_table}
INNER JOIN ZDETECTEDFACE
ON {asset_table}.Z_PK = {asset_fk}
WHERE ZDETECTEDFACE.ZPERSON IS NULL;
WHERE {person_fk} IS NULL;
"""
).fetchall()

uuids = [r[0] for r in results]
unnamed_faces = photosdb.photos(uuid=uuids)
return unnamed_faces
Expand Down

0 comments on commit c617c44

Please sign in to comment.