Files
WhatIDo/public/photos.html
T
dev 0356fd4e02 add face library: face recognition, student refs, manual assign
Сервис face-id (insightface/ArcFace) ищет лица на фото групп и записей,
сравнивает их с эталонными фото учеников и предлагает привязки по
процентам косинусного сходства.

- face-id/: FastAPI-сервис /detect, /compare, /health, ленивая загрузка модели
- таблицы photo_faces + student_face_refs, face_scanned_at в фото групп и записей
- настройки: face_id_enabled, face_scan_on_upload, face_id_threshold
- пересчёт привязок по всем фото rematchFaces(): считает по сохранённым
  эмбеддингам, сервис face-id не нужен; автозапуск после добавления эталона
  плюс кнопка в настройках
- просмотрщик фото: рамки с процентом сходства, подсказка-кандидат,
  ручная привязка по всем группам
- бэкап/restore, sweep сиротских файлов, удаление лиц вместе с фото
2026-10-10 12:26:35 +03:00

52 lines
2.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Фото — Админ-панель</title>
<link rel="stylesheet" href="admin.css">
<style>
.ph-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.ph-card{background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;display:flex;flex-direction:column;min-width:0}
.ph-card img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;cursor:zoom-in;background:var(--bg);transition:opacity .15s}
.ph-card:hover img{opacity:.9}
.ph-card .ph-body{padding:10px 12px;display:flex;flex-direction:column;gap:4px;min-width:0}
.ph-badge{align-self:flex-start;background:var(--bg);border:1px solid var(--border);color:var(--muted);border-radius:999px;padding:2px 8px;font-size:.68rem;font-weight:700}
.ph-title{font-size:.82rem;font-weight:600;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word}
.ph-meta{font-size:.72rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ph-time{font-size:.7rem;color:var(--muted)}
.ph-link{font-size:.72rem;color:var(--accent);text-decoration:none}
.ph-link:hover{text-decoration:underline}
</style>
</head>
<body data-page="photos">
<div class="layout">
<div class="sidebar" id="sidebar"></div>
<div class="main">
<h2>Фото</h2>
<div class="filters">
<div><label>Поиск</label><input type="text" id="searchInput" class="search-input" placeholder="Описание или имя"></div>
<div><label>Ученик</label><input type="text" id="studentFilter" list="studentFilterList" placeholder="Все / введите имя..."><datalist id="studentFilterList"></datalist></div>
<div><label>По лицам</label><select id="faceStudentFilter"><option value="">Без фильтра</option><option value="__unassigned__">Неопознанные лица</option></select></div>
<div><label>Группа</label><select id="groupFilter"><option value="">Все группы</option></select></div>
<div><label>Источник</label><select id="sourceFilter"><option value="">Все источники</option></select></div>
<div><label>С</label><input type="date" id="dateFrom"></div>
<div><label>По</label><input type="date" id="dateTo"></div>
</div>
<div class="ph-grid" id="grid"><div class="empty" style="grid-column:1/-1">Загрузка...</div></div>
<div class="pager" id="pager"></div>
</div>
</div>
<div class="modal-overlay" id="imgModal">
<img id="imgModalSrc">
</div>
<div class="toast" id="toast"></div>
<script src="vendor/lucide.min.js"></script>
<script src="js/datetime.js"></script>
<script src="admin.js"></script>
<script src="js/photos.js"></script>
</body>
</html>