Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,15 +850,19 @@ archivis settings set burst_gap 5 # frames up to 5 s apart form one burst
archivis settings set scene_gap 20 # shots up to 20 min apart are one scene (0-120, default 10)
archivis settings set stack_bursts off # show every shot on the Photos page
archivis settings set stack_hamming 6 # stack only shots more alike (0-16, default 10)
archivis settings set similar_clip 95 # stack only shots that look more alike (80-99, default 93; 0: off)
```

**Stacks.** On the Photos page, alike shots of one scene show as one card:
the best shot, with the number of shots on it. A scene is one camera's
shots, each taken within the scene gap (10 minutes) of the last, so a run
of shots of one view over several minutes, and the RAW and JPEG of each,
stack together, while a shot of something else in between stays apart. A
shot joins a stack when its perceptual hash is within `stack_hamming` bits
of the best shot's. The card's page lists the others. A filter that leaves
shot joins a stack when it looks like the best shot: their visual (CLIP)
embeddings are at least `similar_clip` percent alike (93 by default), which
a subject shot again a little reframed still is, or their perceptual hashes
are within `stack_hamming` bits (which also covers shots not yet visually
analysed). The card's page lists the others. A filter that leaves
out a stack's best shot shows the other shots that match. Text search
shows each stack once. Set `scene_gap 0` to stack only frames of one burst,
as before; turn stacking off on the Settings page, or with
Expand All @@ -868,7 +872,18 @@ Settings saved before scenes stacked kept the old similarity default, 6:
they now read as 10 until saved again. A similarity set to anything else
is kept.

### Bursts and identical images
### Bursts and duplicates

**Duplicates** are sets of the same picture: identical images (the same
perceptual hash) anywhere in the catalogue, and the highly similar shots of
one scene that stack (see Stacks above). An identical copy of a stacked shot
joins its stack's set. Each album has **Photos · Bursts · Duplicates** tabs:
the Bursts and Duplicates pages limited to that album and its subfolders,
with the album's filters.

After updating to this version, the groups are worked out again once, in
the background, by the new rule (as after changing a setting); until then
the pages show the previous grouping and say so.

The **Bursts** and **Duplicates** pages read groups that are worked out once
and stored, so they open quickly however large the catalogue. An index run
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ everything runs locally, nothing leaves your machine.
("worst first" for culling). The *Scores* page in the UI explains each
number.
* **Journalistic triage.** Bursts/sequences with the best frame first,
duplicate detection, zero-shot categories (protest, speech, sports, crowd,
duplicate detection (identical copies anywhere, and highly similar shots of
one scene by visual similarity; also per album), zero-shot categories (protest, speech, sports, crowd,
portrait, document/screenshot, …; editable), EXIF/camera/lens/date filters,
export of picks as symlinks or copies (e.g. to import into Lightroom).
Albums browse the indexed folders, with every Apple Photos library together
Expand Down
4 changes: 2 additions & 2 deletions cmd/archivis/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func runGroups(g *globals, args []string) error {
fs := newFlagSet("groups", `Bursts, stacks of alike shots, identical images, and the
fs := newFlagSet("groups", `Bursts, stacks of alike shots, duplicates, and the
folders Albums shows:
groups status whether they are up to date
groups rebuild work them out again now (index runs and the web
Expand Down Expand Up @@ -64,7 +64,7 @@ func regroup(ctx context.Context, dir string, st *store.Store) {
stats, ran, err := indexer.Regroup(ctx, dir, st, st.GroupOptions(), false)
switch {
case err != nil:
fmt.Fprintf(os.Stderr, "warning: working out bursts and identical images failed after %s: %v (the web interface retries; or run `archivis groups rebuild`)\n",
fmt.Fprintf(os.Stderr, "warning: working out bursts and duplicates failed after %s: %v (the web interface retries; or run `archivis groups rebuild`)\n",
time.Since(start).Round(time.Second), err)
case ran:
fmt.Fprintf(os.Stderr, "grouped: %s\n", stats)
Expand Down
2 changes: 1 addition & 1 deletion cmd/archivis/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Commands:
retag recompute category tags from stored embeddings
prune drop catalogue entries for files that no longer exist
stats catalogue summary
groups bursts, stacks, identical images and folders: status | rebuild
groups bursts, stacks, duplicates and folders: status | rebuild
roots the indexed folders Albums starts from: list | add | remove | name
errors show files that failed to index
inspect show what Archivis reads from photo files (camera, lens, preview, rotation)
Expand Down
3 changes: 3 additions & 0 deletions cmd/archivis/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Settings:
burst_gap most seconds between frames of one burst (1-60, default 3)
scene_gap most minutes between one camera's shots of one scene, whose
alike shots stack (0-120, default 10; 0: only bursts stack)
similar_clip how alike shots of one scene must look to stack and be
listed as duplicates: the percent similarity of their CLIP
embeddings (80-99, default 93; 0: perceptual hashes only)
stack_bursts show alike shots of one scene as one card on the Photos
page (on/off, default on)
stack_hamming how alike shots must be to stack: the most bits their
Expand Down
8 changes: 7 additions & 1 deletion cmd/archivis/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestSettingsCommand(t *testing.T) {
err := settingsCmd(st, args, &b)
return b.String(), err
}
if out, err := run(); err != nil || out != "burst_gap = 3\nscene_gap = 10\nstack_bursts = on\nstack_hamming = 10\n" {
if out, err := run(); err != nil || out != "burst_gap = 3\nscene_gap = 10\nsimilar_clip = 93\nstack_bursts = on\nstack_hamming = 10\n" {
t.Fatalf("list: %q %v", out, err)
}
if out, err := run("set", "burst_gap", "5"); err != nil || out != "burst_gap = 5\n" {
Expand All @@ -28,6 +28,12 @@ func TestSettingsCommand(t *testing.T) {
if out, _ := run("get", "burst_gap"); out != "5\n" {
t.Fatalf("get: %q", out)
}
if out, err := run("set", "similar_clip", "90"); err != nil || out != "similar_clip = 90\n" || st.GetSettings().SimilarCLIP != 90 {
t.Fatalf("set similar_clip: %q %v", out, err)
}
if _, err := run("set", "similar_clip", "70"); err == nil || st.GetSettings().SimilarCLIP != 90 {
t.Fatalf("similar_clip 70 accepted: %v", err)
}
for _, bad := range [][]string{{"set", "burst_gap", "0"}, {"set", "burst_gap", "x"}, {"get", "nope"}, {"set", "nope", "1"}, {"frob"}} {
if _, err := run(bad...); err == nil {
t.Errorf("%v accepted", bad)
Expand Down
Loading
Loading