Skip to content

Commit 3e4b580

Browse files
authored
Merge pull request #6 from lstein/docs/rename-photomap
Rename PhotoMap in docs
2 parents 33e2368 + 0a68ae2 commit 3e4b580

13 files changed

Lines changed: 167 additions & 117 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ test_scripts/test_pick_from_image.py
9797

9898
# Directories used for testing
9999
icloudpd
100+
scripts
100101

101102
# Cache directories for mkdocs etc
102103
site

INSTALL/install_linux_mac.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Version=1.0
8181
Type=Application
8282
Name=PhotoMap
8383
Comment=AI-based image clustering and exploration tool
84-
Exec=$install_path/bin/start_photomap
84+
Exec=$install_path/bin/start_photomapai
8585
Icon=image-x-generic
8686
Terminal=true
8787
Categories=Graphics;Photography;
@@ -110,7 +110,7 @@ create_mac_launcher() {
110110
<key>CFBundleExecutable</key>
111111
<string>PhotoMap</string>
112112
<key>CFBundleIdentifier</key>
113-
<string>com.lincolnstein.photomap</string>
113+
<string>com.lincolnstein.photomapai</string>
114114
<key>CFBundleName</key>
115115
<string>PhotoMap</string>
116116
<key>CFBundleVersion</key>
@@ -126,7 +126,7 @@ EOF
126126
# Create launcher script that opens Terminal
127127
cat > "$app_dir/Contents/MacOS/PhotoMap" << EOF
128128
#!/bin/bash
129-
osascript -e "tell application \"Terminal\" to do script \"cd '$install_path' && source bin/activate && start_photomap\""
129+
osascript -e "tell application \"Terminal\" to do script \"cd '$install_path' && source bin/activate && start_photomapai\""
130130
EOF
131131

132132
chmod +x "$app_dir/Contents/MacOS/PhotoMap"
@@ -152,7 +152,7 @@ main() {
152152
print_info "Detected OS: $os_type"
153153

154154
# Step 3: Ask for installation directory
155-
local default_install="$HOME/photomap"
155+
local default_install="$HOME/photomapai"
156156
echo
157157
read -p "Where would you like to install PhotoMap? [$default_install]: " install_path
158158
install_path="${install_path:-$default_install}"
@@ -174,7 +174,7 @@ main() {
174174
rm -rf "$install_path"
175175
fi
176176

177-
python3 -m venv "$install_path" --prompt photomap
177+
python3 -m venv "$install_path" --prompt photomapai
178178

179179
# Activate virtual environment
180180
source "$install_path/bin/activate"
@@ -195,9 +195,9 @@ main() {
195195
print_info "Installation completed successfully!"
196196
print_info "To start PhotoMap:"
197197
print_info " 1. Activate the environment: source $install_path/bin/activate"
198-
print_info " 2. Run: start_photomap"
198+
print_info " 2. Run: start_photomapai"
199199
print_info ""
200-
print_info "Or use the desktop launcher that was created."
200+
print_info "Or use the desktop launcher that was created just now."
201201
}
202202

203203
# Error handling

INSTALL/install_windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@echo off
2-
echo Installing PhotoMap...
2+
echo Installing PhotoMapAI...
33
powershell -ExecutionPolicy Bypass -File "%~dp0lib\windows.ps1"
44
pause

INSTALL/lib/windows.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Set-Location $installDir
6060

6161
# 3. Create virtual environment in the installdir
6262
Write-Host "Creating virtual environment in $installDir ..."
63-
python -m venv . --prompt "photomap"
63+
python -m venv . --prompt "photomapai"
6464

6565
# 4. Activate virtual environment and install PhotoMap
6666
$venvActivate = ".\Scripts\Activate.ps1"
@@ -109,8 +109,8 @@ pip install "$PSScriptRoot\..\.."
109109
# Write-Host "`n $installDir\Scripts\start_photomap.exe`n" -ForegroundColor Cyan
110110

111111
# 6. Create a batch script to start the slideshow
112-
$batPath = Join-Path $env:USERPROFILE "Desktop\start_photomap.bat"
113-
$exePath = "$installDir\Scripts\start_photomap.exe"
112+
$batPath = Join-Path $env:USERPROFILE "Desktop\start_photomapai.bat"
113+
$exePath = "$installDir\Scripts\start_photomapai.exe"
114114

115115
$batContent = @"
116116
@echo off

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
Rediscover your photo collection!
44

5-
PhotoMap is a fast, modern image browser and search tool for large photo collections. It supports text and image-based search, semantic clustering, and interactive slideshows with a responsive web interface. Its unique feature is a "semantic map" that clusters and visualizes your images by their content. Browse the semantic map to find and explore thematically-related groups of photos, or use text and/or image similarity search to find specific people, places, events, styles and themes.
5+
PhotoMapAI is a fast, modern image browser and search tool for large photo collections. It uses the CLIP computer vision model to enable text and image-based search, image clustering, and interactive slideshows with a responsive web interface. Its unique feature is a "semantic map" that clusters and visualizes your images by their content. Browse the semantic map to find and explore thematically-related groups of photos, or use text and/or image similarity search to find specific people, places, events, styles and themes.
66

77
<img src="docs/img/photomap_slide_with_semantic_map.png" alt="PhotoMap main display showing the semantic map of the user's photo album">
88

9-
109
## Features
1110
- Fast browsing of large image collections
1211
- AI-based text and image similarity search

cleanup/remove_duplicates.pl

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Rediscover your photo collection!
44

5-
PhotoMapAI is a fast, modern image browser and search tool for large photo collections. It supports text and image-based search, semantic clustering, and interactive slideshows with a responsive web interface. Its unique feature is a "semantic map" that clusters and visualizes your images by their content. Browse the semantic map to find and explore thematically-related groups of photos, or use text and/or image similarity search to find specific people, places, events, styles and themes.
5+
PhotoMapAI is a fast, modern image browser and search tool for large photo collections. It uses the CLIP computer vision model to enable text and image-based search, image clustering, and interactive slideshows with a responsive web interface. Its unique feature is a "semantic map" that clusters and visualizes your images by their content. Browse the semantic map to find and explore thematically-related groups of photos, or use text and/or image similarity search to find specific people, places, events, styles and themes.
66

77
<div class="photomap-overlay-container">
88
<img src="img/photomap_slide_with_semantic_map_base.png" width="480" class="photomap-base" alt="Base image">

docs/troubleshooting.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#Troubleshooting
2+
3+
Here are some frequently-encountered issues and their resolutions.
4+
5+
## No images are showing up in my display
6+
7+
Make sure that you have configured and indexed a [photo album](user-guide/albums.md), that the directory(s) associated with the album contain valid images (JPEG, PNG, HEIC), and that the images are readable by your user account. Scroll to the album in question using the [Album Manager](user-guide/albums.md#managing-albums) and make sure that it has been indexed and that at least two images exist in the album. If necessary, reindex using the **Index** button.
8+
9+
If these attempts fail, send a bug report to the [PhotoMap Issues](https://github.com/lstein/PhotoMapAI/issues) page, copying any error messages you see in the browser's JavaScript console and the PhotoMapAI launch script window.
10+
11+
## Copy-and-Paste isn't working
12+
13+
When you try to copy some text from the image metadata drawer, you get a message that says "Clipboard API not available due to browser security restrictions. Please copy manually."
14+
15+
When a site is running under http (not https), browsers prevent the site's scripts from copying information into the system clipboard. You can fix this by running PhotoMapAI as an https service, either using self-signed certificates or behind an https-enabled reverse proxy as described in [Running PhotoMapAI under HTTPS](user-guide/configuration.md#running-photomapai-under-https)
16+
17+
## The semantic map is showing no clusters or too many clusters
18+
19+
This may be caused by two different issues:
20+
21+
### 1. The map is zoomed out too far
22+
23+
When first opened, the semantic map scales to show the positions of 98% of the images. If your photos/images are too diverse, this may end up squeezing the majority of images into a small central group. Try zooming into the group to see the fine-structured detail.
24+
25+
### 2. The clustering EPS needs to be tweaked
26+
27+
If even after zooming in you see either a handful of large clusters, or many small clusters and lots of unclustered (grey) dots, you may need to adjust the EPS (epsilon) parameter. Open the map window and find the EPS field. If you have too many clusters then increase the EPS value. This makes clustering more aggressive creating a smaller number of larger clusters. Alternatively, if you have too few clusters (or too many unclustered images), try lowering EPS.
28+
29+
It takes a moment for changes to EPS to take effect. The best strategy is to adjust it by small increments. For more information, see [Semantic Map](user-guide/semantic-map.md).

docs/user-guide/configuration.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Configuration
2+
3+
PhotoMapAI is primarily configured through the web interface as described in [Basic Usage](user-guide/basic-usage.md#changing-settings) and [Albums](user-guide/albums.md). However, there are a number of runtime parameters that control how the web service behaves.
4+
5+
## Changing the Web Host and Port
6+
7+
By default, PhotoMapAI runs its web service on port 8050 and only accepts connections on the local machine (`localhost`). These can be changed on the command line used to launch the application using the `--port` and `--host` options:
8+
9+
start_photomap --port 8000 --host 0.0.0.0
10+
11+
This command changes the port to port 8000, and allows PhotoMapAI to listen for connections on the wildcard IP address `0.0.0.0`, meaning that it will accept connections for any network-accessible location.
12+
13+
If you are using a launcher script to start PhotoMapAI (e.g. `start_photomap.bat`) you can change these values by opening the script in a text editor (`Notepad` on Windows), finding the line containing `start_photomap`, and adding the options as shown above.
14+
15+
Alternatively, you can change the port and host interface by setting two environment variables prior to launching PhotoMapAI. These are:
16+
17+
* `PHOTOMAP_HOST` - the host interface to accept connections from
18+
* `PHOTOMAP_PORT` - the listen port
19+
20+
On Linux and Macintosh systems, you can set these environment variables on the command line like so:
21+
22+
```bash
23+
PHOTOMAP_HOST="0.0.0.0" PHOTOMAP_PORT="8000" start_photomap
24+
```
25+
26+
Or you can permanently fix these environment variables by setting them in your shell's profile, e.g. `.bashrc`.
27+
28+
On Windows systems, setting environment variables can be done through the GUI as well as on the command line. See [How to Set Environment Variables in Windows](https://phoenixnap.com/kb/windows-set-environment-variable) for a good walkthrough.
29+
30+
## Running PhotoMapAI Under HTTPS
31+
32+
By default, PhotoMapAI runs as a non-secure `HTTP` service. This generates a warning icon in some browsers, but more seriously prevents cut and paste between the PhotoMapAI tab and browser tabs and desktop applications.
33+
34+
There are several ways to enable HTTP for PhotoMapAI:
35+
36+
### Install a Self-Signed SSL Certificate
37+
38+
In this method, you generate self-signed encryption certificate and
39+
private key files and point PhotoMapAI to them using its `--cert` and
40+
`--key` command-line options.
41+
42+
Guides to generating and installing self-signed certificates:
43+
44+
- [Creating Self-Signed Certificates with Windows PowerShell](https://learn.microsoft.com/en-us/entra/identity-platform/howto-create-self-signed-certificate). Please apply the arguments to create .crt and .pem files.
45+
46+
- [Creating Self-Signed Certificates with OpenSSL (Mac/Linux)](https://gist.github.com/elklein96/a15090f35a41e16bdc8574a7fb81e119)
47+
48+
These methods will leave you with two files, a .crt certificate file,
49+
and a .pem key file. Relaunch the PhotoMapAI server using `--cert
50+
/path/to/.crt file` and `--key /path/to/.pem file`. If you are using
51+
the desktop launcher to start the server, simply open the launcher
52+
file with a text editor, and add the `--cert` and `--key` options to
53+
the end of the line that ends with `start_photomap`.
54+
55+
After installing the certificate/key pair and relaunching the server,
56+
you will be able to access the PhotoMapAI server using the https://
57+
URL. Your browser will complain about an unknown certificate authority
58+
when you first load the URL and ask you to confirm that you trust the site.
59+
60+
### Use Certbot
61+
62+
The [Certbot](https://certbot.eff.org/) tool provides public certificates that
63+
browsers automatically trust. It is very easy to use, but it requires that you
64+
have a web running on port 80 that accepts incoming HTTP connections.
65+
66+
Once the Certbot certificate and keyfile are generated, follow the
67+
directions in the previous section to configure PhotoMapAI to use them.
68+
69+
70+
### Use a Reverse Proxy
71+
72+
A final option is to keep PhotoMapAI running on HTTP, but use a reverse
73+
proxy from a running web server to translate HTTPS requests on the
74+
reverse proxy into HTTP requests to PhotoMapAI. The main advantage of this
75+
is that you get the additional benefit of all the web server's configuration
76+
controls, such as the ability to add password protection.
77+
78+
Here are some guides for setting up reverse proxies. The first is a
79+
general guide for configuring a reverse proxy with the popular Nginx
80+
web server. The second features a Windows-specific walkthrough.
81+
82+
- [NGINX Reverse Proxy](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/)
83+
- [NGINX Reverse Proxy on Windows](https://virendra.dev/blog/setting-up-nginx-as-a-reverse-proxy-on-windows)
84+
85+
You will need to install encryption certificates for the Nginx server using [Certbot](https://certbot.eff.org/). The final configuration of the proxy server will look something like this:
86+
87+
location /photomap/ {
88+
proxy_pass http://localhost:8050/;
89+
90+
This is saying that when a request comes in for
91+
`https://your.host/photomap/` it will be translated into a request to
92+
`http://localhost:8050/` where PhotoMapAI is running. It is possible to
93+
run the proxy server and the PhotoMapAI server on separate machines as well.
94+
95+
## Pointing to an Alternative Configuration File
96+
97+
PhotoMapAI stores its album definitions and other configuration information in a configuration file. It is not usually necessary to manipulate it directly, but if you wish you can point to an alternative config file in order to have multiple PhotoMapAI servers each hosting separate album collections.
98+
99+
The config file is stored in different places depending on the platform:
100+
101+
| Platform | Config File Path |
102+
|------------------|-------------------------|
103+
| Linux | ~/.config/photomap/config.yaml |
104+
| MacOS | ~/Library/Application Support/photomap/config.yaml |
105+
| Windows | C:\Users\<user>\AppData\Roaming\photomap\config.yaml|
106+
107+
To run PhotoMapAI off a different config file, you may launch it with the `--config` option on the command line, similar to setting the port and host. In the below example we specify an alternative config file named `photomap_2.yaml`
108+
109+
start_photomap --config ~/photomap_2.yaml
110+
111+
If the indicated config file doesn't exist when you launch PhotoMapAI, it will be created automatically.
112+
113+
You may also point to an alternative configuration file by setting the environment variable `PHOTOMAP_CONFIG`, as described in the previous section:
114+
115+
```bash
116+
PHOTOMAP_CONFIG=~/photomap_2.yaml start_photomap
117+
```
118+
119+
It is also possible, but not recommended, to edit the configuration file directly using a text editor. The format is straightforward to understand, but liable to change in the future.

mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
site_name: PhotoMap
1+
site_name: PhotoMapAI
22
docs_dir: docs
33

44
nav:
@@ -11,9 +11,9 @@ nav:
1111
- Basic Usage: user-guide/basic-usage.md
1212
- Search: user-guide/search.md
1313
- Albums: user-guide/albums.md
14+
- Configuration: user-guide/configuration.md
1415
- Semantic Map: user-guide/semantic-map.md
1516
- Keyboard Shortcuts: user-guide/keyboard-shortcuts.md
16-
- Configuration: configuration.md
1717
- Developer Guide:
1818
- Architecture: developer/architecture.md
1919
- API: developer/api.md

0 commit comments

Comments
 (0)