Console #180 - Interview with Niaz of LibrePhotos - self-hosted open source photo management service
Featuring LinkWarden, Free certifications, and LibrePhotos
🤝 Sponsor
This space is reserved for sponsors that support us to keep the newsletter going! Want to support Console? Send us a note at osh@codesee.io
🏗️ Projects
Browse through open source projects on OpenSourceHub.io, add your project to get more exposure and connect with other maintainers and contributors!
LinkWarden
LinkWarden is a self-hosted, open-source collaborative bookmark manager to collect, organize, and archive webpages.
language: TypeScript stars: 2835 last commit: 2 days
repo: github.com/linkwarden/linkwarden
site: linkwarden.app
Free Certifications
A curated list of free courses & certifications by the cloud study network.
stars: 10391 last commit: today
repo: github.com/cloudcommunity/Free-Certifications
LibrePhotos
A self-hosted open source photo management service.
language: Python stars: 5999 last commit: last week
repo: github.com/LibrePhotos/librephotos
🎙️ Interview With Niaz of LibrePhotos: self-hosted open source photo management service
Hey Niaz! Thanks for joining us! Let us start with your background.
Hello! Thank you for this interview. Let me tell you a bit about myself.
I was born in Germany, and I've primarily worked at the "Amt für Statistik Berlin-Brandenburg" (Office for Statistics Berlin-Brandenburg) throughout my career. We are a german government entity and create all the statistics about Berlin, and it’s surrounding areas. At the moment, I'm actively involved in maintaining their website, which you can find at statistik-berlin-brandenburg.de.
My journey into the world of programming began when I was quite young. As a kid, I was obsessed by the game "Age of Empires 2", which sparked in becoming a game developer.
Since then, I pretty much knew I wanted to learn to program, so I picked a high school which offered me the opportunity to do so.
I continued to learn programming by pursuing a formal education in computer science. I did a bachelor's degree in computer science at university, and am currently in the process of completing my master's thesis with the title ”Image Captioning in Personal Photo Management: A Comparative Study of Different Techniques” in the field of media and computer science.
Who or what are your biggest influences as a developer?
At this point, one of my most significant influences is Andreas Kling, the maintainer of Serenity OS. I find his approach to development truly inspiring. What stands out to me is his belief in the idea that "you can develop everything yourself." This perspective has had a profound impact on how I view technical complexity in software development.
For example, many people believe that it is impossible to write a browser from scratch. The Serenity OS project did it anyway, and the hand-made browser Ladybird is just very impressive and already supports a ton of websites.
Why was LibrePhotos started?
The inception of LibrePhotos is an interesting story that came about somewhat unexpectedly. It all began when I faced a challenging experience – a rejection from a job interview. To provide some background, I had applied for a TypeScript backend role after having already been a Java developer for two years. I had no prior experience in TypeScript at that point, but I had a referral at that company who encouraged me to apply anyway.
After successfully completing the technical interview, I then got rejected after I talked to the product manager. What made this rejection stand out was not the typical "not a good fit" reason, but rather that I was considered "too junior" for the role.
In response to this situation, I decided to channel my energy and anger into something constructive. I took a chance and decided to dive into working with Ownphotos, the precursor of LibrePhotos, with the intention of fixing a small bug to show to myself that I am by no means a developer who is too junior to dive into a complex codebase.
As I made progress and successfully fixed the bug, I shared my achievement with the Ownphotos community on Discord. To my surprise, my contribution and enthusiasm sparked a wave of excitement within the Ownphotos community. People were genuinely excited about the work I was doing. This outpouring of support and enthusiasm from the community ultimately led to the birth of LibrePhotos. Since the fork, we added way more features than the original project and have built a community around it.
So, in a way, LibrePhotos was born out of a desire to turn a setback into an opportunity and a small bug fix into a community-driven project.
How does LibrePhotos work?
Here's a behind-the-scenes technical overview:
The web frontend of LibrePhotos is written in React in combination with Redux Toolkit, and we leverage Mantine as a component library.
There is a proof of concept app written in React Native and at some point we want to share the state management between the app and the web frontend.
Both frontends communicate over a REST API, with the backend.
The REST API also enable third party app developers to create their own apps. For example, UhuruPhotos, which is a native android application.
The core of LibrePhotos, the backend, is built using Python and leverages the Django web framework. We use it in combination with the Django Rest Framework (DRF) to create RESTful APIs.
PyTorch, a deep learning framework, plays a significant role in LibrePhotos for various machine learning tasks.
For background job processing, LibrePhotos relies on Django Q2. This library provides a framework for handling asynchronous tasks.
How does LibrePhotos handle face recognition and other AI tasks? Does it do it locally?
It's all done locally, which means all the models and infrastructure are shipped too. It's a tricky thing to do as we have a wide variety of users. On the one hand, we have people on low-end devices with no computer science background, and on the other hand, there are Sys Admins running actual servers with Kubernetes. The one side complains about processing speed and the other side wants more accuracy and scaling options. We usually pick a default configuration, which works on most systems, while we hide more advanced options in the settings. As I will examine different image captioning models for my master thesis, I will implement a more modular architecture for shipping the models, which should help with that problem. The user can then choose the best model for their system, including quantized models for the very low end and state-of-the-art models for the high end.
Are there any overarching goals of LibrePhotos that drive design or implementation? If so, what trade-offs have been made in LibrePhotos as a consequence of these goals?
We are trying to solve to answer the w4 questions (what, where, when and who) for each image automatically or semiautomatically, as this is how people interact with a photo library.
For example, we have reverse geocoding, which turns coordinates into places you can search for, object detectors to find out what's in the image, semantic image search which helps you find phrases which match images, face clustering to find out who is in the image and a pretty complex engine to determine the correct timestamp.
We have a clear preference to implement an automated system first, which leads to a not so great experience if you prefer manual editing of metadata.
Are there any projects similar to LibrePhotos? If so, what were they lacking that made you consider building something new?
A lot of people have the idea that LibrePhotos is something new, but actually if you take into account that it is a fork of Ownphotos, we are the oldest one. Ownphotos was started in 2017 and Photoprism for example was started in 2018.
The biggest difference between us and Photoprism is, that our scope is bigger. We want to handle uploading / backing up images, and we want to ship apps in the future.
Immich is also a great option, but it does run a pretty complicated architecture and prefers importing into its own file structure over scanning existing galleries.
What was the most surprising thing you learned while working on LibrePhotos?
Before taking over as the maintainer, I only had development experience. Managing an open source project on the other hand needs a more diverse skill set. I am still learning how to do that.
It broadened my understanding why companies rely so much on telemetry these days. It was very surprising to me that power users who want new features are way more vocal than users who want less bugs. Also, users that donate money or pay money are usually in the later part, which makes estimating the impact of a feature vs a bug fix complicated.
What do you think about the state of self-hosting?
It is definitely growing a lot, but the biggest issue is still sustainability. While there is now a new model for open source called commercial open source software, it’s not yet clear how it will play out.
VCs have figured out, that acquiring users by open sourcing the core product to compete with existing SaaS offerings can work out great. This leads to way more funding, which leads to more software, which is self-hostable. The goal at the moment is not revenue or profitability, which means in the short term we will have a lot of great software which is free and open source.
After a couple of years, however, these solutions will get monetized to justify the investments, which will put features behind paywalls, closing the source code or changing the license.
How popular is LibrePhotos?
We do not track anything, but Docker, Discord and GitHub do. We have 2.3 million docker pulls, ~1600 members on discord and ~6000 GitHub stars.
Is LibrePhotos intended to eventually be monetized? If so, how?
We will continue to only monetize by donations. I haven’t found a good way to monetize it in another way yet. SaaS does not make sense as this is pretty much the same business model as the big players and managed hosting does not seem to be that popular in the consumer space.
I applied for a grant from the Prototype fund in Germany, which would provide me with half a year of funding, but I did not get selected yet. Maybe research is another option, but I haven't found a concrete way to do this.
There is also not that much money in the space. The most monetized FOSS solution Photoprism and my estimation is that they make around 5k€ a month. Donations in FOSS also seem to be a winner takes all phenomenon, which means smaller project get exponentially less.
What are you most proud of?
I am very proud that LibrePhotos made it into an Ars Technica article and that this project was in a popular Hacker News post. The only thing that is missing is a high ranking place on ProductHunt, and then I have all the essential nerd bragging rights haha
How do you balance your work on open-source with your day job and other responsibilities?
My job is pretty chill, so it’s easy to do some work in my free time. My studies however need more alignment. I usually pick courses where I can continue to work on LibrePhotos. Uploading and adding backing up images in the proof of concept was for example work I did for a course and my master thesis right now is about improving the automatic image captioning capabilities of LibrePhotos.
Have you ever experienced burnout? How did you deal with it?
Yes, for a while I had the ambition to do this full time after my studies. However, last year it became clear to me, that this is not an option based on the current trajectory.
I took a break for a bit, while I recalibrated how I align myself better with the project. Doing this as part of my studies was part of the solution, but I also switched to a more relaxed release schedule, gave myself more permission to not respond immediately to issues or pull request and scaled down the amount of public relation work I did.
Where do you see the project heading next?
There will be a new and novel way to do automatic image captioning in LibrePhotos. I will probably combine Blip with LLAMA 2 and see how many use cases it can cover and what will be possible with it. It's kind of experimental, but I am excited where this will lead. This is all part of my master thesis, which means I will definitely do it, I even got a deadline when I have to hand it in and everything.
Otherwise, I will merge the pull requests contributors submit. If you want something added to LibrePhotos, you can anytime open one up. I am pretty open about new features and am not too strict about it as long as it improves the core product.
Where do you see software development heading next?
To me, it looks like the stack changes less often than it did in the past. We now have a lot of well established open source languages and frameworks. This means we will find less new ways of doing things and will focus more on more performant solutions and an ecosystem, where you can do everything in the language you like. Good examples of this are JavaScript and Python.
While LLMs seem to be helpful when coding, they still need a lot of human supervision. Programmers will get a bit more productive, but it will not be anything game-changing.
Interested in sponsoring the newsletter or know of any cool projects or interesting developers you want us to interview? Reach out at osh@codesee.io or mention us @ConsoleWeekly!