Scripts2026年4月14日·1 分钟阅读

PhotoPrism — AI-Powered Photo Management for the Self-Hosted Era

PhotoPrism organizes your photo library using AI-powered tagging, face recognition, and location clustering. A polished Google Photos alternative that keeps your photos on your own server.

Introduction

PhotoPrism is the premier open-source alternative to Google Photos and Apple iCloud Photos. It indexes your photo + video library with AI (labels, face recognition, places), provides fast browsing + search, and handles RAW + HEIC + live photos + videos — all self-hosted, with no analytics.

With over 39,000 GitHub stars, PhotoPrism is the go-to choice for photographers and privacy-conscious users. It scales from a Raspberry Pi with a family library to a multi-TB server hosting a studio archive.

What PhotoPrism Does

PhotoPrism watches a folder of original photos, runs AI-powered tagging (TensorFlow models for labels, faces, nsfw detection), extracts EXIF + IPTC + XMP metadata, and builds a searchable index in MariaDB. The web UI lets you browse by date, map, albums, labels, and people. Mobile apps (via PWA) give you a Google Photos-like experience.

Architecture Overview

[Originals folder] <-- immutable photo files
       |
[PhotoPrism Go service]
   Indexer: metadata + AI tagging
       |
[TensorFlow models]
  labels (1,000+ categories)
  face detection + clustering
  nsfw detection
       |
[MariaDB]
   metadata, albums, labels, faces
       |
[Storage folder]
   thumbs (generated sizes)
   sidecars (metadata backups)
       |
[Web UI / PWA]
   browse, search, albums, face tagging, map

Self-Hosting & Configuration

# docker-compose.yml (excerpt)
services:
  photoprism:
    image: photoprism/photoprism:latest
    restart: unless-stopped
    stop_grace_period: 10s
    depends_on: [mariadb]
    environment:
      PHOTOPRISM_ADMIN_PASSWORD: "change-me"
      PHOTOPRISM_SITE_URL: "https://photos.example.com"
      PHOTOPRISM_DISABLE_TLS: "true"                 # behind reverse proxy
      PHOTOPRISM_ORIGINALS_LIMIT: 5000               # per indexing run
      PHOTOPRISM_DETECT_NSFW: "false"
      PHOTOPRISM_UPLOAD_NSFW: "true"
      PHOTOPRISM_DATABASE_DRIVER: "mysql"
      PHOTOPRISM_DATABASE_SERVER: "mariadb:3306"
      PHOTOPRISM_DATABASE_NAME: "photoprism"
      PHOTOPRISM_DATABASE_USER: "photoprism"
      PHOTOPRISM_DATABASE_PASSWORD: "insecure"
    volumes:
      - "./photos:/photoprism/originals"
      - "./storage:/photoprism/storage"
      - "./import:/photoprism/import"
    ports:
      - "2342:2342"

  mariadb:
    image: mariadb:11
    environment:
      MARIADB_AUTO_UPGRADE: "1"
      MARIADB_INITDB_SKIP_TZINFO: "1"
      MARIADB_DATABASE: "photoprism"
      MARIADB_USER: "photoprism"
      MARIADB_PASSWORD: "insecure"
      MARIADB_ROOT_PASSWORD: "insecure"
    volumes:
      - "./db:/var/lib/mysql"
# Trigger re-indexing
docker compose exec photoprism photoprism index --rescan

# CLI bulk operations
docker compose exec photoprism photoprism faces recognize
docker compose exec photoprism photoprism photos rescan
docker compose exec photoprism photoprism backup --all

Key Features

  • AI tagging — auto-classify 1,000+ labels (beach, sunset, cat, pizza, etc.)
  • Face recognition — detect + cluster faces, manual tagging for identity
  • RAW + HEIC support — processes modern camera + iPhone formats
  • Live photos + videos — preserve motion, browse alongside stills
  • Map view — pin photos by EXIF geolocation
  • Albums + smart albums — saved searches for dynamic collections
  • PWA — install on phone for a Google Photos-like app
  • Immutable originals — strict read-only mode for original files

Comparison with Similar Tools

Feature PhotoPrism Immich Lychee Librephotos Pigallery2
AI tagging Yes (TF) Yes (ML) No Yes (PhotoSync) Partial
Face recognition Yes Yes No Yes (strong) No
Video support Yes Yes (best) Limited Yes Limited
Mobile upload PWA only Native iOS/Android PWA Native PWA
Maturity Mature Newer (fast-moving) Mature Moderate Mature
Best For Photo archives + AI iPhone/Android users Simple gallery Self-host w/ face tagging Read-only gallery

FAQ

Q: PhotoPrism vs Immich? A: Both excellent. Immich has better mobile apps (native iOS + Android with backup). PhotoPrism has more mature AI tagging and better handling of existing libraries. Many users install both and compare.

Q: Can it handle 500K photos? A: Yes with the right hardware — indexing takes hours the first time (AI models run on each photo), subsequent updates are fast. 4GB RAM + SSD storage is the rough minimum for large libraries.

Q: Does it sync with my existing folder structure? A: Yes. PhotoPrism reads your originals folder exactly as it is. Metadata goes to MariaDB; your file layout stays untouched (unless you enable "move imports").

Q: Is it really free? A: Yes, AGPL-3.0 for the open-source edition. PhotoPrism Plus (paid membership) unlocks additional features (e.g., legacy face recognition model, early access) and supports development.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产