Skip to content

Commit 903ff2b

Browse files
Refactor best shot engine handling and improve ETA calculations
- Removed best shot engine settings and related functions from app_settings.py. - Updated SimilarityEngine to include ETA calculations during image processing. - Simplified AppController by removing best shot engine retrieval and related signals. - Removed best shot engine configuration from DialogManager and adjusted UI accordingly. - Cleaned up WorkerManager by removing unused best shot engine parameters. - Enhanced AiRatingWorker and BestShotWorker to manage threading and ETA calculations more effectively. - Deleted obsolete tests related to best shot engine and model checking. - Improved overall code readability and maintainability by consolidating logic and removing unnecessary complexity.
1 parent b16369d commit 903ff2b

16 files changed

+202
-1677
lines changed

README.md

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PhotoSort is a powerful desktop application focused on speed designed to streaml
1919
* **Fast Processing**: Intensive operations (scanning, thumbnailing, analysis) run once in batch to ensure fast image scrolling.
2020
* **Optimized Image Handling**: Supports a wide range of formats, including various RAW types, with efficient caching.
2121
* **Intelligent Image Rotation**: Smart rotation system that automatically tries lossless metadata rotation first, with optional fallback to pixel rotation when needed.
22-
* **AI Best-Shot Ranking**: Compare stacks with either the bundled multi-model pipeline or an OpenAI-compatible vision model (e.g. Qwen3-VL).
22+
* **AI Best-Shot Ranking**: Send stacks to an OpenAI-compatible vision model (e.g. Qwen3-VL) to pick the keeper frame automatically.
2323
* **AI Star Ratings**: Ask the configured AI engine to score individual photos with 1–5 stars.
2424

2525
- **Update Notifications**: Automatically checks for new releases and notifies users when updates are available, with direct download links.
@@ -100,34 +100,14 @@ To use the **Auto Rotate Images** feature (`Ctrl+R`), you need to download the p
100100

101101
The application will automatically detect and load the model when you use the rotation detection feature.
102102

103-
### AI Best Shot Ranking & Engines
104-
105-
PhotoSort can rank similar shots and assign AI ratings using either a local
106-
multi-model pipeline or an OpenAI-compatible vision model; switch engines in
107-
**Preferences → AI Rating Engine** (`F10`). Settings persist between sessions.
108-
109-
**Local pipeline (default)**
110-
Runs entirely offline with three Hugging Face checkpoints:
111-
BlazeFace face detector (`qualcomm/MediaPipe-Face-Detection`), eye-state classifier
112-
(`MichalMlodawski/open-closed-eye-classification-mobilev2`), and the aesthetic predictor
113-
(`shunk031/aesthetics-predictor-v2-sac-logos-ava1-l14-linearMSE`). Place each bundle
114-
under `models/` and choose **Local Pipeline** in preferences.
115-
116-
Required downloads (install into `models/`):
117-
118-
1. **Face detector**[`qualcomm/MediaPipe-Face-Detection`](https://huggingface.co/qualcomm/MediaPipe-Face-Detection)
119-
Extract `model.onnx` to `models/job_*/model.onnx` (or e.g. `models/MediaPipe-Face-Detection_FaceDetector_float/model.onnx`).
120-
2. **Eye-state classifier**[`MichalMlodawski/open-closed-eye-classification-mobilev2`](https://huggingface.co/MichalMlodawski/open-closed-eye-classification-mobilev2)
121-
Copy all files into `models/open-closed-eye-classification-mobilev2/`.
122-
3. **Aesthetic predictor**[`shunk031/aesthetics-predictor-v2-sac-logos-ava1-l14-linearMSE`](https://huggingface.co/shunk031/aesthetics-predictor-v2-sac-logos-ava1-l14-linearMSE)
123-
Copy all files into `models/aesthetic_predictor/` (includes the CLIP backbone plus regression head).
124-
125-
**LLM engine**
126-
Connect PhotoSort to any OpenAI-compatible endpoint that accepts images
127-
—for example Qwen3-VL. Configure API key, base URL,
128-
model name, prompt templates, and timeouts directly in the preferences dialog.
129-
For local deployments that do not require authentication (e.g. LM Studio), leave
130-
the API key blank.
103+
### AI Best Shot Ranking & Ratings
104+
105+
PhotoSort relies on an OpenAI-compatible vision model to rank
106+
similar shots and request AI star ratings. Configure the endpoint under
107+
**Preferences → AI Rating Engine** (`F10`) by providing the API key (optional for
108+
local deployments), base URL, model name, prompt templates, max tokens, timeout,
109+
and concurrency. Any server that implements the OpenAI Chat Completions API with
110+
vision support (for example, Qwen3-VL running in LM Studio) will work.
131111

132112
**Using the results**
133113
- **Similarity stacks**: After running **View → Analyze Similarity**, launch

src/core/ai/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
"""
22
AI helper utilities for advanced ranking/scoring pipelines.
33
4-
Currently exposes the experimental best-photo selector which chains together
5-
multiple pre-trained models (face detection, eye-state classification, and
6-
image quality scoring) to rank similar shots.
4+
This package exposes the LLM-based best-shot pipeline used for ranking clusters
5+
and assigning AI star ratings.
76
"""
87

9-
from .best_photo_selector import BestPhotoSelector, BestShotResult # noqa: F401
8+
from .best_shot_pipeline import BaseBestShotStrategy, LLMBestShotStrategy, LLMConfig
9+
10+
__all__ = [
11+
"BaseBestShotStrategy",
12+
"LLMBestShotStrategy",
13+
"LLMConfig",
14+
]

0 commit comments

Comments
 (0)