Photo collection

Machine Learning in Linux: PhotoPrism – AI-Powered Photos App

Machine Learning is the practice of using algorithms to parse data, learn insights from that data, and then make a determination or prediction. The machine is ‘trained’ using huge amounts of data.

An important feature of machine learning is the ability to scour data at speed and scale far outclassing human analysts. This enables the discovery of patterns or anomalies to derive cogent insights and automate all kinds of laborious or mundane tasks that humans used to have to perform manually.

While AI falls short of human intelligence in many applications, there are areas where it vastly outshines. Machines can identify trends and patterns hidden across millions of documents, and this ability improves over time. Machines also behave consistently, in an unbiased fashion, without committing the kinds of mistakes that humans inevitably make.

PhotoPrism is an AI-powered photos app for the decentralized web. It uses modern technologies to tag and find pictures. The software can be run at home, on a private server, or in the cloud. It’s free and open source software.

Installation

We’re testing PhotoPrism using Manjaro, an Arch-based distro. The exact steps to follow will vary depending on the distro used, but this walkthrough gives a broad overview of the steps needed.

1) You’ll need Docker installed on your system. On Manjaro, there’s a package for Docker in the Official Repositories. We’ll also be using docker-compose (a tool for defining and running multi-container Docker applications), so let’s install them together.

$ sudo pacman -S docker docker-compose

The Docker daemon binds to a Unix socket and by default the root user owns the Unix socket. As we don’t want to preface the docker command with sudo, we’ll add a user to the docker group. (On Manjaro we don’t need to create a group for docker as that’s already been created). We add the username sde to the docker group with the command:

$ sudo usermod -aG docker sde

Log out and log back in so that the group membership is re-evaluated. We can check the user has been added to the docker group with the command id -Gn:

[sde@linuxlinks docker]$ id -Gn
sde network power docker users storage lp input audio wheel

2) Download the Example Docker Compose config file for PhotoPrism. We’ll use the ubiquitous wget utility.

$ wget https://dl.photoprism.app/docker/docker-compose.yml

3) Edit the docker-compose.yml file

This step is not optional. You should read the project’s documentation. At the minimum you’ll need to change the PHOTOPRISM_ADMIN_PASSWORD so that the app starts with a secure initial password, the site URL, define the location of your pictures, and more.

4) Start the Docker service

$ systemctl start docker

Let’s make Docker run as a system startup service. This means that Docker will start itself after a reboot.

$ systemctl enable docker.service

5) Start the Example Docker Compose

Open a terminal and change to the folder in which the docker-compose.yml file has been saved. Run this command to start the application and database services in the background:

$ docker-compose up -d # On your system this command may be $ docker compose up -d

The very first time you run this command the container images are downloaded, and the containers started. The image below shows the download in action.

Images are being downloaded

Point your web browser to the address you defined for PHOTOPRISM_SITE_URL: in docker-compose.yml. We’re using PHOTOPRISM_SITE_URL: “http://localhost:2342/”.

Enter the username and password you set in docker-compose.yml.

Next page: Page 2 – In Operation

Pages in this article:
Page 1 – Introduction / Installation
Page 2 – In Operation
Page 3 – Facial Recognition
Page 4 – Places
Page 5 – Summary

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

5 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Mo T
Mo T
9 months ago

There’s a package for PhotoPrism in the AUR. Is that an easier install?

Luke Baker
Luke Baker
9 months ago

Steve, maybe worth adding PhotoPrism to the Google Photos alternatives?