đź’š End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Initial spec and ideas
laurenspriem65de0c8eb01d
diff --git a/mobile/apps/photos/.docs/ente_wrapped_2025_spec.md b/mobile/apps/photos/.docs/ente_wrapped_2025_spec.mdnew file mode 100644index 0000000000..b4870f4af3--- /dev/null+++ b/mobile/apps/photos/.docs/ente_wrapped_2025_spec.md@@ -0,0 +1,287 @@+# Ente Wrapped 2025 — Product Spec (Codex)++## Summary++- Year-end, auto‑curated, story‑style recap generated fully on‑device from the user’s 2025 photos, using the metadata and ML indices (faces, CLIP, time, and location).+- Goals: delight, reflection, and effortless sharing, while preserving Ente’s privacy and zero‑knowledge principles.+- Format: a lean, autoplay “story” with minimal swiping, tight, fun copy, and selectable share cards. One fun, personalized badge crowns the finale.++## Objectives & Success++- Delight: users watch end‑to‑end without friction; feel recognized and surprised.+- Share: users easily share 1–3 highlights as images or short grids.+- Privacy: compute on‑device, never exfiltrate private content or names.++Success signals (local, privacy‑friendly)++- Story completion rate+- Shares initiated per user (share intent button taps)+- Card saves/exports per user+- Clicks into related surfaces (People, Locations, Albums, Favorites)++## Guardrails (Privacy & UX)++- On‑device only; no remote inference. Use existing local ML DBs (CLIP, face clusters) and EXIF/location.+- Gate content by confidence and data sufficiency; gracefully skip sparse sections.+- Single, tasteful brand style; no noisy charts unless they read clean in 1–2s.+- The cards can be dynamic through animations, but not statefull/interactive.++## User Experience++- Entry points+ - Home banner on top of home gallery: “Your 2025 Wrapped is ready” (if eligibility met and calculations done).+ - Disappears after the user has seen the wrapped completely, or partially multiple times+ - After the home banner disappears, the Wrapped is added as a separate section to the discovery tab, right below locations.+ - It stays there for another month.+ - Notifications (local): “We made you a 2025 recap.”+ - Put all entry points initially behind a feature flag that points to `internalUsers`+- Flow+ - Intro title card → short “chapters” → finale badge → call‑to‑action.+ - Autoplay with progress bar; Tap sides to skip/rewind; pause on touch.+ - Each card has a compact “Share” action that exports a designed image.+- Sharing+ - Export single cards as images (1080×1920 portrait).+ - Optional “Save All Cards” to an album of images in Ente.++## Content Architecture (Chapters)++Wrapped assembles a diverse subset of the following, tuned per user:++1. Stats & Rhythm++- Totals: photos, videos, storage captured.+- GitHub like contribution-graph based on photo capture dates+- Velocity: avg/day; busiest month; contribution heatmap (compact).+- Busiest day; longest streak; longest gap.++2. People++- Most photographed person; top 3 collage; group vs solo; “new faces met”.++3. Places++- New places count; top cities; most‑visited spot; optional “Then & Now”.++4. Aesthetics & Scenes++- Year‑in‑color palette; monochrome moments; panoramas; biggest shot; “Top 9 wow”.++5. Technique & Habits++- New device; live/motion photos rate; front vs rear; bursts; hour‑of‑day.++6. Curation & Collaboration++- Favorites count; albums created; share activity highlights.++7. Narrative Finale++- Top 3 events (time+place clusters) and a “Best of 25” micro‑reel.++8. Badge++- A single, fun persona badge; exportable as a share card.++Cards are short, legible, and visually anchored by 1–9 photos. Avoid textual overload.+A standard card has one image with a fun descriptive text about the statistic. If we don't know what image to take then we can just use a colourful one and blurhash it. And if we know what image to use and+more images are appropriate then we can add more. But the basic card is one image and a nice text.++## Eligibility & Fallbacks++- ML enabled+- Minimum: ≥ 200 photos with ≥ 60% CLIP+face coverage.+- If sparse: reduce chapters, use a card only if possible; prefer Stats + Top 9 + Favorites + Badge.+- If ML disabled or coverage < 25%: show a teaser (“Enable ML to see your 2025”).++## Data Sources (Existing Infra)++- CLIP image embeddings: `lib/db/ml/schema.dart` (`clip` table), vector DB `ClipVectorDB`.+- CLIP text embeddings: on‑device encoder `ClipTextEncoder` with cached results (`text_embeddings_cache`).+- Faces & clusters: `faces`, `face_clusters`, `cluster_person` with blur scores; `PersonService` for named people.+- Time & event clustering: existing “smart memories” pipelines (`SmartMemoriesService`).+- EXIF, GPS, motion, panorama: `exif_util.dart` + `location_service.dart` (world cities matching).+- Favorites, albums, shares: `FavoritesService`, albums/sharing services.++## Algorithms & Computation++All heavy work runs on isolates (reuse the Computer pool) and caches results.+Use the `SmartMemoriesService` as reference for how to do it.++General selection framework++- Generate candidate cards per category with a score = impact × confidence × novelty.+- Enforce diversity with category caps and “no‑overlap” constraints on media sets.+- Target 12–18 cards total; max 2–3 per chapter.++Stats (fast, deterministic)++- Totals, velocity, busiest day/month, streaks/gaps from creation timestamps.+- Contribution heatmap: 7×53 bitmap grid (year calendar), low‑ink style.++People++- Most photographed: named person with most photos in 2025.+- Top 3 collage: three named persons with most 2025 appearances.+- Group vs solo: faces/photo threshold (≥3 = group).+- New faces: clusters with first appearance in 2025 (min size ≥10).+- Confidence: require named clusters for “Most/Top 3”, else fall back to “Loved ones moments.”++Places++- New places: unique city/country via `LocationService` circle‑match; dedupe by distance.+- Top cities: top 3 by count.+- Most‑visited spot: densest 100m geohash bucket (approx via distance threshold clustering).+- Then & Now: same city radius, years differ ±30 days; pick best visual pair.++Aesthetics & Scenes++- Year in Color: use CLIP queries “strongly red/blue/green…” with tight thresholds to curate swatches.+- Monochrome: CLIP text query “black‑and‑white photo”.+- Panoramas: EXIF `CustomRendered == 6` or aspect ratio > 2.2.+- Biggest shot: max resolution still.+- Top 9 wow: CLIP positive prompt intersections (multiple curated queries) with diversity constraints; 3×3.++Technique & Habits++- New device: first‑seen camera model in 2025 (if available in metadata).+- Live/Motion: XMP/motion tags.+- Front vs rear: EXIF camera facing heuristics.+- Bursts: near‑duplicate sequences within ~1s with similar EXIF.+- Hour‑of‑day: distribution; “Golden hour chaser” via hour buckets (fallback): 5–8am, 4–7pm; “Blue hour” 6–7am, 6–8pm, tuned by latitude bands when GPS present.++Curation & Collaboration++- Favorites: count; top month.+- Albums: created count; most‑filled.+- Sharing: shared albums created or contributors added.++Narrative++- Top 3 events: time+place clustering (reuse SmartMemories trip/event clustering), rank by density and variety.+- Best of 25: select across year using CLIP similarity + faces of named persons + diversity + favorites; autoplay grid or quick reel.++## Ideas Evaluation (from `.docs/ente_wrapped_ideas.md`)++Doable now (green)++- Totals, velocity, busiest day/month, streaks/gaps, distributions (hour/day/season approx)+- Most photographed person; Top 3 collage; group vs solo; new faces+- New places; top cities; most‑visited spot; Then & Now (approx by city radius)+- Year in color; monochrome; panoramas; biggest shot; Top 9 wow+- New device; live/motion rate; front vs rear; bursts (heuristic)+- Pets; foodie via CLIP queries; favorites; albums; best‑of reel; top 3 events++With caveats (amber)++- Golden vs Blue hour: without exact sunrise/sunset, use hour buckets or coarse lat‑band rules; annotate “approximate”.+- Altitude range: only if GPS exif with altitude exists; otherwise skip.++Defer (red)++- Full reverse‑geocoding by address names: avoid external network; stick to cities list.+- Auto‑generated video with music: heavy; follow‑up phase after MVP.++## Badge System (share‑first)++Assign exactly one persona using mutually exclusive rules, with tie‑breakers:++- Traveler: ≥ 6 new cities or ≥ 2 new countries; trips present+- People Person: top person appears in ≥ 25% of 2025 photos and group photos ≥ 35%+- Pet Parent: pet photos ≥ 5% of 2025; CLIP cat/dog high confidence+- Foodie: food photos ≥ 5% and ≥ 50 photos total+- Golden Hour Hunter: golden/blue hour ≥ 30% of 2025 captures (approx)+- Night Owl: ≥ 20% photos between 22:00–02:00+- Curator: favorites ratio ≥ 10% and ≥ 100 favorites in 2025+- Panorama Pro: ≥ 30 panoramas or ≥ 2% panoramas+- Marathoner: longest streak ≥ 30 days+- Minimalist Shooter: total photos low but high favorites ratio (e.g., <1k photos, >15% favorites)+- Sports photographer: many burst photos+- Group photographer: relatively many photos shared with other people and/or many other people in photos++Badge card shows badge name, short line of copy, and 1–4 representative thumbnails. Always exportable.++## Card Design System++- Visuals+ - Dark background, brand accent; large numerals where applicable.+ - Use 1–9 image grids; prefer human faces when copy references people.+- Copy style+ - Short, upbeat, human..+ - Examples:+ - “You captured 12,345 moments.”+ - “Longest streak: 42 days — the lens never slept.”+ - “{Name} starred in your year.” (only if named)+- Formats+ - Portrait 1080×1920 (story), Square 1080×1080 (feeds).+ - Local export as PNG; optional album save.++## Engineering Plan++Phase 0 — Infra harness (reuse where possible)++- Add a `WrappedEngine` that builds candidate cards from the year’s files, using:+ - CLIP embeddings via `MLDataDB` + `ClipVectorDB`+ - Face clusters via `MLDataDB` + `PersonService`+ - Time/event clustering via `SmartMemoriesService`+ - Location clustering via `LocationService`+- Cache: persist per‑year results; recalc on ML index updates.++Phase 1 — MVP (ship‑ready)++- Chapters: Stats, People, Places, Top 9 wow, Favorites, Best‑of 25, Badge.+- Share cards for each; for the story viewer use `FullScreenMemory` mechanic for reference.+- Gating + fallbacks.++Phase 2 — Depth & polish++- Add Then & Now, live/motion, front vs rear, bursts, golden/blue hour.+- Year‑in‑color palette generation and contribution heatmap card.+- More badges; improved diversity and scoring.++Phase 3 — Advanced++- Optional video export for “Best of 25”.++## Technical Notes++- Performance: do all scoring and selection on isolates; batch vector ops with `ClipVectorDB.computeBulkSimilarities`.+- Diversity: maintain a UsedMediaSet; avoid repeating the same file across multiple cards unless intentional (finale reel exception).+- Confidence thresholds+ - CLIP similarity ≥ 0.25 for broad classes; tighter for palette/mono.+ - Faces: min cluster size; prefer low blur.+- Accessibility: large fonts, high contrast; no dense charts without labels.++## Open Questions and answers behind it++- Music or sound? Likely no for MVP.+- Opt‑in for showing person names on share cards? No, sharing itself is already opt-in, so not needed. Just always show names.+- Should we let users edit badge if they disagree? No. we can offer “See more badges you earned” as fun alternative. But let's not add that in the MVP. The idea should be that any badge is nice, so the user will never disagree. It's a fine balance, but possible.+- Do we surface cross‑year comparisons (“+X% vs 2024”) broadly or only in stats? Only in stats, if at all.++## Risks & Mitigations++- Sparse data → Show fewer but stronger cards. We don't need to show a card if it doesn't work for the library.+- Wrong inferences → Keep copy soft; only show high‑confidence items.+- Performance → Precompute in single big isolate call and cache.++## Analytics (Privacy‑friendly, local)++- Log only local counters and timestamps; no content.+- Surface these in a local debug screen; do not transmit remotely by default.++## QA Checklist (per device)++- ML enabled, indexed library vs sparse library+- Named people vs unnamed faces+- Location‑rich vs no‑GPS libraries+- Performance on low‑end devices+- Share card rendering correctness (all locales)++## Deliverables++- Story experience with 12–18 cards per eligible user.+- Exportable share cards (portrait + square) for each shown item.+- Badge system and finale.++—+This spec is grounded in existing code paths for CLIP, faces, locations, and memories. It prioritizes on‑device computation, small‑copy visuals, and share‑first moments while keeping overlap low via candidate scoring and diversity constraints.diff --git a/mobile/apps/photos/.docs/ente_wrapped_ideas.md b/mobile/apps/photos/.docs/ente_wrapped_ideas.mdnew file mode 100644index 0000000000..8cf2328c0d--- /dev/null+++ b/mobile/apps/photos/.docs/ente_wrapped_ideas.md@@ -0,0 +1,141 @@+Photos taken statistics:++- Total photos clicked. "If printed, your photos would make a stack X meters tall"+- Total videos clicked+- Storage: you captured X GB of memories .+- Photo velocity: average photos per day, with your most and least active months+- GitHub like contribution-graph based on photo capture dates+- portrait vs. landscape+- monthly timeline+- distribution across 24 hours ("afternoon is your time")+- distribution across weekdays+- distribution across seasons+- Longest photo streak+ - _Compute:_ consecutive days with ≥1 capture.+ - _Copy:_ “You kept the lens alive for **{N} days** straight.”+- Biggest photo day+ - _Compute:_ max photos on a single calendar day; show date + cluster preview.+ - _Copy:_ “**{Date}** was your most snapped day.”+- Longest no‑photo gap+ - Compute: max gap between capture datetimes.+ - Copy: “You took a breather for {N} days.”+- Photos vs last year+ - Compute: % change.+ - Copy: “Up {+X%} from 2024, you're becoming a photographer pro” / " {+X%} less than 2024, you're becoming zen!”+- Month‑over‑month “most improved”+ - Compute: MoM % changes; highlight top jump.+ - Copy: “{Month} was your comeback month.”+- Golden vs Blue hour+ - Compute: classify captures vs local sunrise/sunset (approx by location; fallback to hour buckets).+ - Copy: “A golden hour chaser: {X}% of your shots.”+- Burst moments+ - Compute: detect sequences within ~1s with similar EXIF.+ - Copy: “{N} bursts—you don’t miss the action.”+- Front vs rear camera (selfie tendency)+ - Compute: EXIF lens/camera facing or focal metadata heuristics.+ - Copy: “{X}% were front‑camera moments.”++Quick stories:++- First photo of the year+-++People and relationships:++- Most photographed person (if one person named)+ - Compute: largest face cluster this year.+ - Copy: “{Name} starred in your year.”+- Your 3 top most photographed persons (if at least 3 people named)+ - Make into a new collage of the three+- Captured N moments with your loved ones!+ - Compute: number of photos containing named persons (that aren't (only) the user)+- New faces met+ - Compute: face clusters (minimum size of 10 photos) appearing first time in 2025.+ - Copy: “{N} new faces joined your story.”+- Group vs solo+ - Compute: faces per photo threshold (≥3 = group).+ - Copy: “{X}% group photos—memories shared.”+-++Places and movement:++- - **“Then & Now” re‑shoots**+ - Compute: same location cluster across years ±30 days; pick best pair.+ - Copy: “Same spot, new story.”+- New places count+ - Compute: unique city/country from clustered GPS; mark first‑ever for library.+ - Copy: “You explored {N} new places.”+- Top photo cities+ - Compute: reverse‑geocode clusters; top 3.+ - Copy: “Your camera loved {City 1}, {City 2}, {City 3}.”+- Most photogenic spot+ - Compute: densest 100m geohash block; show map dot & micro‑gallery.+ - Copy: “You kept returning to {Spot}.”+- Altitude range: highest and lowest elevation photos (if GPS data available)++Visual styles and aesthetics:++- Showing some blurry imperfect photos+ - Use the blurry scores of faces+ - Preferably use named persons+- Your year in color+ - Use CLIP embeddings of "Photo strongly coloured X" and search with tight threshold+ - Copy: “2025 looked like this” (show swatches strip).+- Monochrome moments+ - Use CLIP embeddings again+ - Copy: “{N} black‑and‑white frames.”+- Panorama love+ - Compute: aspect ratio > ~2.2 or iOS pano flag.+ - Copy: “{N} wide‑as‑the-sky panoramas.”+- Biggest shot+ - Highest resolution shot+ - Copy: “Your biggest click.”+- Aesthetic top picks+ - Run multiple CLIP embeddings with different positive text queries. Take the intersection of the ones with highest similarity+ - Copy: “Your top 9 by pure wow.”++Camera & technique:++- New device added (if applicable only)+ - Compute: first‑seen camera model in 2025.+ - Copy: “Hello, {Model}—first light on {Date}.”+- Live Photo / Motion Photo rate (if present)+ - Compute: vendor tags.+ - Copy: “{X}% of your photos move.”++Content & Scenes++- Pet index (cats/dogs)+ - Compute using CLIP embeddings; counts & top months.+ - Copy: “{N} pet portraits - {type of pet} is your favorite+- Foodie score+ - Compute: food classifier.+ - Copy: “{N} delicious plates captured.”++Curation & organization:++- Favorites you marked+ - Compute: count & top month.+ - Copy: “You starred {N} favorites.”+- Albums created / most‑filled album+ - Compute: album stats.+ - Copy: “You created {N} new albums. Your busiest album: {Album}.”+- Edits made (crop/exposure/filters)+ - Compute: edit metadata count.+ - Copy: “{N} photos got a glow‑up.”+- Share & collaboration+ - Compute: shared albums created, contributors added.+ - Copy: “You shared {X} memories with {N} people.”+- Shared images versus own images+ - You shared way more with other than others shared with you: wow, you're really the photographer of the group!++Narrative moments:++- Top 3 events+ - Compute: time‑and‑place clustering; rank by density & variety.+ - Copy: “Your year’s big three.”+- “Best of” reel+ - Compute: combine high CLIP similarity to positive queries + high face scores of named persons + diversity (place/time/subject) + favorites (if applicable)+ - Copy: “Your top 25—sealed for 2025.”++End by giving everyone a badge/avatar of what they are based on (some statistic of) their photos. This should be fun and tempt the user to share.