remove half-baked object detection schema

I want to release schema version 6 now, with the fully developed pieces.
This commit is contained in:
Scott Lamb 2020-12-22 19:50:51 -08:00
parent 99ef052f80
commit b078851ad7
4 changed files with 0 additions and 72 deletions

View File

@ -271,12 +271,6 @@ pub(crate) fn delete_recordings(tx: &rusqlite::Transaction, sample_file_dir_id:
:start <= composite_id and :start <= composite_id and
composite_id < :end composite_id < :end
"#)?; "#)?;
let mut del_detection = tx.prepare_cached(r#"
delete from recording_object_detection
where
:start <= composite_id and
composite_id < :end
"#)?;
let mut del_main = tx.prepare_cached(r#" let mut del_main = tx.prepare_cached(r#"
delete from recording delete from recording
where where
@ -300,9 +294,6 @@ pub(crate) fn delete_recordings(tx: &rusqlite::Transaction, sample_file_dir_id:
if n_integrity > n { // fewer is okay; recording_integrity is optional. if n_integrity > n { // fewer is okay; recording_integrity is optional.
bail!("inserted {} garbage rows but deleted {} recording_integrity rows!", n, n_integrity); bail!("inserted {} garbage rows but deleted {} recording_integrity rows!", n, n_integrity);
} }
// Any number of object detection rows is okay, as there can be zero or more models per
// recording.
del_detection.execute_named(p)?;
let n_main = del_main.execute_named(p)?; let n_main = del_main.execute_named(p)?;
if n_main != n { if n_main != n {
bail!("inserted {} garbage rows but deleted {} recording rows!", n, n_main); bail!("inserted {} garbage rows but deleted {} recording rows!", n, n_main);

View File

@ -519,45 +519,5 @@ create table signal_change (
changes blob not null changes blob not null
); );
create table object_detection_model (
id integer primary key,
uuid blob unique not null check (length(uuid) = 16),
name text not null,
-- The actual model and label mappings, in a tbd protocol buffer message
-- format.
data blob
);
-- An entry for every supported label in any model. (E.g., there is one row
-- for "person" even if there are many models that support detecting people.)
create table object_detection_label (
id integer primary key,
uuid blob unique not null check (length(uuid) = 16),
name text unique not null,
color text
);
create table recording_object_detection (
composite_id integer not null references recording (composite_id),
model_id integer not null references object_detection_model (id),
-- repeated:
-- * frame delta unsigned varint
-- * label unsigned varint
-- * xmin, xmax, ymin, ymax as fixed 8-bit numbers
-- (any value from knowing xmin <= xmax, ymin <= ymax?
-- probably not a whole byte anyway.)
-- although 256/300 or 256/320 is not super clean. awkward.
-- * score/probability/whatever-it's-called as fixed 8-bit number
-- linear scale?
frame_data blob not null,
-- Operations are almost always done on a bounded set of recordings, so
-- and perhaps on all models. Use composite_id as the prefix of the primary
-- key to make these efficient.
primary key (composite_id, model_id)
);
insert into version (id, unix_time, notes) insert into version (id, unix_time, notes)
values (6, cast(strftime('%s', 'now') as int), 'db creation'); values (6, cast(strftime('%s', 'now') as int), 'db creation');

View File

@ -328,27 +328,6 @@ pub fn run(_args: &super::Args, tx: &rusqlite::Transaction) -> Result<(), Error>
revocation_reason_detail = 'Blake2b->Blake3 upgrade' revocation_reason_detail = 'Blake2b->Blake3 upgrade'
where where
revocation_reason is null; revocation_reason is null;
create table object_detection_model (
id integer primary key,
uuid blob unique not null check (length(uuid) = 16),
name text not null,
data blob
);
create table object_detection_label (
id integer primary key,
uuid blob unique not null check (length(uuid) = 16),
name text unique not null,
color text
);
create table recording_object_detection (
composite_id integer not null references recording (composite_id),
model_id integer not null references object_detection_model (id),
frame_data blob not null,
primary key (composite_id, model_id)
);
"#)?; "#)?;
Ok(()) Ok(())
} }

View File

@ -252,8 +252,6 @@ Version 6 adds over version 5:
streams. streams.
* hashes in Blake3 rather than older SHA-1 (for file integrity checksums) * hashes in Blake3 rather than older SHA-1 (for file integrity checksums)
or Blake2b (for sessions). or Blake2b (for sessions).
* a preliminary schema for [object
detection](https://en.wikipedia.org/wiki/Object_detection).
* for each recording row, the cumulative total duration and "runs" recorded * for each recording row, the cumulative total duration and "runs" recorded
before it on that stream. This is useful for MediaSourceExtension-based before it on that stream. This is useful for MediaSourceExtension-based
web browser UIs when setting timestamps of video segments in the web browser UIs when setting timestamps of video segments in the