Skip to content

asutermo/groq-image-tagger

Repository files navigation

image-tagger

An image tagger using Groq. Use GroqChat to help tag your images into a json file.

Powered by Groq for fast inference.

Prerequisites

Go to Groq. Go to the dev console and make an API Key. Create a .env file in the root of the repository like so, replacing the XXXXX with your value.

GROQ_API_KEY=XXXXX

Run the following from the root of the repository to get a functional conda environment.

conda env create -f environment.yaml

Usage

Please note that this is not perfect. Groq sometimes returns invalid data.

python main.py -i "./tests/images/800px-Another_Day_in_NYC_(2539547867).jpg" "https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Interior_Galeria_Arte_Nacional_%28Caracas%29.jpg/800px-Interior_Galeria_Arte_Nacional_%28Caracas%29.jpg?20071010223618"

Example (output.json)

{
  "./tests/images/800px-Another_Day_in_NYC_(2539547867).jpg": {
    "tags": [
      "Flowers",
      "Nature",
      "Pink",
      "Potted",
      "Green",
      "Plant"
    ],
    "categories": [
      "Gardening",
      "Flowers"
    ]
  },
  "https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Interior_Galeria_Arte_Nacional_%28Caracas%29.jpg/800px-Interior_Galeria_Arte_Nacional_%28Caracas%29.jpg?20071010223618": {
    "tags": [
      "fountain",
      "art",
      "sculpture",
      "relax",
      "vietnam"
    ],
    "categories": [
      "Museum",
      "Culture"
    ]
  }
}
python main.py -i ./tests/images

Images

All images were source from Wikimedia commons.

Tests

Run the following from the root

tox

About

An image tagger using Groq

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages