FaceStore

Faces found in photos and the people they're grouped into. Same lifecycle as EmbeddingStore: app-private, not backed up. People carry what the user decides (names, merges, hidden), so grouping only ever adds faces to people; it never moves a face that already has one.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val databaseName: String?
Link copied to clipboard
Link copied to clipboard

Bumped on every write, so screens know to reload.

Link copied to clipboard

Functions

Link copied to clipboard
fun assign(joins: Map<Long, Long>, newPeople: List<List<Long>>)

Saves grouping: faces joining existing people, and new people with their first faces.

Link copied to clipboard
open fun close()
Link copied to clipboard
fun count(): Int
Link copied to clipboard
fun crop(faceId: Long): File

Where a video face's crop is saved (photos' faces are cut from the photo when shown).

Link copied to clipboard
fun faces(): List<Face>

Every face, newest row last.

Link copied to clipboard
fun indexed(): Map<Long, Long>

Item id → the modified it was looked at.

Link copied to clipboard
fun merge(keep: Long, gone: Long)

Makes gone part of keep: its faces, and its name if keep has none. Faces told they aren't gone aren't keep either.

Link copied to clipboard
fun notThisPerson(person: Long, mediaIds: Collection<Long>)

Not This Person: person's faces in these photos leave them for good; an emptied person goes.

Link copied to clipboard
Link copied to clipboard
open override fun onCreate(db: SQLiteDatabase)
Link copied to clipboard
open fun onDowngrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int)
Link copied to clipboard
open fun onOpen(db: SQLiteDatabase?)
Link copied to clipboard
open override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int)
Link copied to clipboard

Every person with at least one face, most photos first.

Link copied to clipboard
Link copied to clipboard
fun peopleIn(mediaId: Long): List<Pair<Long, Long?>>

The people in one photo or video, biggest face first, each with the moment they first show (videos; null for photos).

Link copied to clipboard
fun put(mediaId: Long, modified: Long, faces: List<NewFace>): List<Long>

Replaces mediaId's faces (an edited photo is looked at again); returns the new faces' ids.

Link copied to clipboard
Link copied to clipboard
fun rename(person: Long, name: String)

Names a person; blank clears the name.

Link copied to clipboard
fun setCover(person: Long, mediaId: Long)

Make Person Cover: person's face in this photo or video (the biggest, if several).

Link copied to clipboard
fun setHidden(person: Long, hidden: Boolean)
Link copied to clipboard
open fun setIdleConnectionTimeout(idleConnectionTimeoutMs: Long)
Link copied to clipboard
open fun setLookasideConfig(slotSize: Int, slotCount: Int)
Link copied to clipboard
Link copied to clipboard