diff options
| author | Ken D'Ambrosio <ken@jots.org> | 2026-06-08 19:00:02 +0000 |
|---|---|---|
| committer | Ken D'Ambrosio <ken@jots.org> | 2026-06-08 19:00:02 +0000 |
| commit | 01f52565f460a0107679999588b73b770f01a98c (patch) | |
| tree | 806c723ad62221f176fd97d5fdcaadac5d8da2d4 /views/person.erb | |
| parent | 625b3d5176f2c274e91fcf28bda8e45cc0477722 (diff) | |
Add people/face clustering feature
- scripts/cluster_faces.py: greedy centroid clustering (numpy) with 3
refinement passes; preserves existing UUID/name mappings across re-runs;
writes MEDIA_ROOT/people.json atomically.
- app.rb: GET /face/* serves cropped+padded face thumbnails (100x100,
cached under cache/faces/); GET|POST /admin/people for cluster
management; POST /admin/people/recluster runs cluster_faces.py as a
background job; POST /admin/people/:uuid saves names+slugs; GET /people
public grid of named people; GET /people/:slug photos for one person.
- views/admin/people.erb: lists all clusters (named first, then by size),
face crop samples, inline name form, re-cluster button with live log.
- views/people.erb: public grid of named people.
- views/person.erb: photo grid for one person, linking back to album
lightbox for each photo.
- views/layout.erb: People link in nav (conditional on FACES_ENABLED).
- public/css/style.css: styles for people admin list and public tiles.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'views/person.erb')
| -rw-r--r-- | views/person.erb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/views/person.erb b/views/person.erb new file mode 100644 index 0000000..1bb25e2 --- /dev/null +++ b/views/person.erb @@ -0,0 +1,26 @@ +<div class="album-header"> + <div class="breadcrumbs"> + <a href="/people">People</a> + <span class="sep">/</span> + <%= ERB::Util.html_escape(@person_name) %> + </div> + <h1><%= ERB::Util.html_escape(@person_name) %></h1> + <p class="album-desc"><%= @count %> photo<%= @count == 1 ? '' : 's' %></p> +</div> + +<% if @photos.empty? %> + <p class="empty-album">No photos found.</p> +<% else %> + <div class="grid"> + <% @photos.each do |photo| %> + <% album_url = photo[:dir_rel].empty? ? '/browse/' : "/browse/#{ERB::Util.html_escape(photo[:dir_rel])}" %> + <a href="<%= album_url %>?photo=<%= ERB::Util.url_encode(photo[:filename]) %>" + class="card" style="text-decoration:none"> + <div class="thumb-wrap"> + <img src="/thumb/<%= ERB::Util.html_escape(photo[:rel]) %>" + loading="lazy" alt="<%= ERB::Util.html_escape(photo[:filename]) %>"> + </div> + </a> + <% end %> + </div> +<% end %> |
