This project is designed to process a directory of image files, extract their metadata, generate additional contextual metadata using an AI model, and save the resulting information in JSON-LD format. It utilizes the Ollama API for generating descriptive metadata and embeddings, and integrates with various libraries for image processing and metadata extraction.
-
Clone the repository:
git clone https://github.com/uvalib/monorepo.git cd monorepo/apps/photo-catalog
-
Install dependencies:
pnpm install
To start processing images, run the following command:
node index.js -c path/to/context.txt -o output_directory path/to/images
-c, --context
: Path to a plain text file containing the collection context.-o, --out
: Directory to store generated metadata files. Default is the current working directory.- The last argument is the root directory to start processing.
node index.js -c context.txt -o metadata_output /Volumes/lib_content107/Addison_2018
The project directory structure is as follows:
photo-catalog/
├── index.js
├── metadata.js
├── imageProcessing.js
├── ollamaApi.js
├── location.js
├── package.json
└── README.md
Ensure you have the necessary environment variables set up for the Ollama API and other services you are using. You can add these variables in a .env
file in the root directory of the project.
Contributions are welcome! Please open an issue or submit a pull request with your changes.
This project is licensed under the MIT License.