Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 1.34 KB

File metadata and controls

11 lines (10 loc) · 1.34 KB

Overview

A simple script to extract the ID from an image and rename the remaining image files with the extracted ID. The tool uses the KISSKI Chat AI API to perform the extraction. The script first checks if the image shows a object from the collection or a document with the ID. If it is a document, it extracts the ID and renames the image files accordingly. This just works if the order is always the same: object image(s) followed by the document image.

Usage

  1. Clone the repository and navigate to the project directory.
  2. Create a .env file based on the provided chatai.env.tpl and fill in your Chat AI API key and base URL. As a model, you can use qwen3-vl-30b-a3b-instruct which is optimized for instruction following and image understanding.
  3. Install the required dependencies using pip install -r requirements.txt.
  4. Place the images you want to process in the input_images directory.
  5. Run the script with the command python extracting_id_from_image.py
  6. If you want to specify a different input or output directory, you can use the --input and --output arguments, e.g. python extracting_id_from_image.py --input path/to/input --output path/to/output and also specify a different model with --model, e.g. python extracting_id_from_image.py --model qwen3-vl-30b-a3b-instruct