Offline Usage
To enable LibrePhotos to work completely offline by manually downloading and placing the required machine learning models, you can follow the steps outlined below. This guide assumes that you have access to the Internet initially to download the models and then configure LibrePhotos to run in an offline environment.
Step 1: Download the Models Manuallyโ
Manually download the necessary models from their respective URLs. Below is a list of models used by LibrePhotos, along with their download links:
- im2txt (Captioning)
- URL:
https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt.tar.gz
- URL:
- clip-embeddings (CLIP)
- URL:
https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/clip-embeddings.tar.gz
- URL:
- places365 (Categories)
- URL:
https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/places365.tar.gz
- URL:
- resnet18 (Categories)
- URL:
https://download.pytorch.org/models/resnet18-5c106cde.pth
- URL:
- im2txt_onnx (Captioning)
- URL:
https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt_onnx.tar.gz
- URL:
- blip_base_capfilt_large (Captioning) (optional)
- URL:
https://huggingface.co/derneuere/librephotos_models/resolve/main/blip_large.tar.gz?download=true
- URL:
- mistral-7b-v0.1.Q5_K_M (LLM) (optional)
- URL:
https://huggingface.co/TheBloke/Mistral-7B-v0.1-GGUF/resolve/main/mistral-7b-v0.1.Q5_K_M.gguf?download=true
- URL:
- mistral-7b-instruct-v0.2.Q5_K_M (LLM) (optional)
- URL:
https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q5_K_M.gguf?download=true
- URL:
- siglip2 (Tagging) (optional โ only if using SigLIP 2 tagging model)
- Vision model:
https://huggingface.co/onnx-community/siglip2-base-patch16-384-ONNX/resolve/main/onnx/vision_model.onnx - Text model:
https://huggingface.co/onnx-community/siglip2-base-patch16-384-ONNX/resolve/main/onnx/text_model.onnx - Tokenizer:
https://huggingface.co/onnx-community/siglip2-base-patch16-384-ONNX/resolve/main/tokenizer.model
- Vision model:
- buffalo_sc (Face recognition โ default model)
- URL:
https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_sc.zip - Only download the model selected in Site Settings โ Face Recognition Model. The other options use the same release, e.g.
buffalo_s.zip,buffalo_m.zip,buffalo_l.zip,antelopev2.zip.
- URL:
Step 2: Place the Models in the Correct Locationโ
Once the models are downloaded, place them in the following directory:
<LibrePhotos Media Root Directory>/data_models/
For example, if your MEDIA_ROOT is set to /var/lib/librephotos, then the models should be placed in /var/lib/librephotos/data_models/.
- im2txt.tar.gz -> Unpack into
<MEDIA_ROOT>/data_models/im2txt/ - clip-embeddings.tar.gz -> Unpack into
<MEDIA_ROOT>/data_models/clip-embeddings/ - places365.tar.gz -> Unpack into
<MEDIA_ROOT>/data_models/places365/ - resnet18-5c106cde.pth -> Place directly as
<MEDIA_ROOT>/data_models/resnet18-5c106cde.pth - im2txt_onnx.tar.gz -> Unpack into
<MEDIA_ROOT>/data_models/im2txt_onnx/ - blip_large.tar.gz -> Unpack into
<MEDIA_ROOT>/data_models/blip/ - mistral-7b-v0.1.Q5_K_M.gguf -> Place directly as
<MEDIA_ROOT>/data_models/mistral-7b-v0.1.Q5_K_M.gguf - mistral-7b-instruct-v0.2.Q5_K_M.gguf -> Place directly as
<MEDIA_ROOT>/data_models/mistral-7b-instruct-v0.2.Q5_K_M.gguf - siglip2 vision_model.onnx -> Place as
<MEDIA_ROOT>/data_models/siglip2/vision_model.onnx - siglip2 text_model.onnx -> Place as
<MEDIA_ROOT>/data_models/siglip2/text_model.onnx - siglip2 tokenizer.model -> Place as
<MEDIA_ROOT>/data_models/siglip2/tokenizer.model - buffalo_sc.zip -> Unpack into
<MEDIA_ROOT>/data_models/face_recognition/models/buffalo_sc/(the folder should contain the.onnxfiles)
Step 3: Verify Model Placementโ
Ensure that all models are correctly placed and unpacked in their respective directories. The structure should look something like this:
data_models/
โโโ im2txt/
โโโ clip-embeddings/
โโโ places365/
โโโ resnet18-5c106cde.pth
โโโ im2txt_onnx/
โโโ blip/
โโโ mistral-7b-v0.1.Q5_K_M.gguf
โโโ mistral-7b-instruct-v0.2.Q5_K_M.gguf
โโโ siglip2/
โ โโโ vision_model.onnx
โ โโโ text_model.onnx
โ โโโ tokenizer.model
โโโ face_recognition/
โโโ models/
โโโ buffalo_sc/
Step 4: Run LibrePhotosโ
You can now run LibrePhotos without an active Internet connection. The application will use the models you manually downloaded and placed in the data_models directory.