Lua-Skrip to import the rating & Tagging data from .rate.xmp files (Python: AI XMP CSV Rating & tagging resp. AI Rating for Darktable& Tagging v3.2 ).
This Lua script is a photo editing software plugin darktable (Version 5.2 or later). It is used to use AI-generated ratings (AI ratings) and tags from special XMP sidecar files (with the ending .rate.xmp) to import into Darktable. These files contain metadata such as descriptions, ratings and keywords (tags).
The script works like this:
- It reads the *.rate.xmp files next to the images and extracts the AI data.
- It puts the image description, the rating (rating) and adds tags.
- A configurable rating scale (from the JSON file
ai_config.json) Converts AI scores to Darktable stars (e.g. score 80 → 4 stars). - It supports options like overwriting existing AI/KI tags (and showing progress – still buggy).
- The script processes multiple images at once (and displays a progress bar to monitor the import – currently buggy).
It is useful for photographers who use AI image analysis tools and want to integrate this data into Darktable without manually copying.
Brief instructions on how to use it
- Installation:
- Copy the file
ai xmp importer.lua (and the ai_config.json - if not already before)in the Darktable Lua script folder (usually~/.config/darktable/lua/ai/on Linux or corresponding under Windows/MacOS). - Make sure Darktable is at least version 5.2. and supports the LUA API version 9.0.0.
- Copy the file
- Use in Darktable:
- Start Darktable and open the LightTable view.
- Select the images for which you want to import XMP data (the appropriate
.rate.xmpfiles must be in the same folder as the pictures). - In the right panel (under “Module”) you will find the “AI XMP Importer V2.5.0” module.
- Activate options such as “Overwrite existing AI/KI tags” (if you want to remove old tags) and “Show progress on screen” (for live updates – currently buggy).
- Click on “Start import”. The script processes the images, displays the progress and updates the metadata.
- Notes:
- The script skips images without a matching XMP file or in the event of errors (e.g., empty files).
- Activate debug logs in the script settings (verbose_debug = true) to see detailed outputs.