Service: Image Description Generator - EyevinnOSC/community GitHub Wiki
Getting Started
Generate image alt description tags effortlessly with the Image Description Generator available as an open web service in Eyevinn Open Source Cloud. This tutorial gives you a walk-through on how to get started.
Prerequisites
- If you have not already done so, sign up for an Eyevinn OSC account
- Open AI account and API key
Step 1: Store Open AI API key as a secret
Navigate to the Image Description Generator service in the Eyevinn Open Source Cloud web console and click on the tab Service Secrets. Click on the button "New Secret".
Give the secret a name, for example openaikey
and enter the API key.
Step 2: Create a generator
Now click on the tab "My generators" and press the button "Create generator" and enter name of the generator and a reference to your openaikey secret.
When the service is up and running you can try this out by clicking on "Open API Docs" in the instance menu.
Here you can try it out in the web browser. Click on the /image/alt
accordion and the button "Try it out". Enter this URL as a query parameter https://blog.osaas.io/wp-content/uploads/2025/02/image-1536x851.png
and press Execute.
In response you get an HTML code including a link to the image and the alt description.
<img src="https://blog.osaas.io/wp-content/uploads/2025/02/image-1536x851.png" alt="The image shows a dashboard displaying the status, uptime, error counts, and stream information for media monitoring." />
Using the API
To use the API in your application you need to provide a service access token. To generate a service access token we can use the OSC command line tool.
Go to the Eyevinn OSC web console to obtain the personal access token. To obtain it go to the Settings/API and copy the token to your clipboard. Store it in your terminal's environment in the variable OSC_ACCESS_TOKEN
.
% export OSC_ACCESS_TOKEN=<personal-access-token>
Now you can generate the service access token using the OSC command line tool.
% npx @osaas/cli service-access-token eyevinn-img-alt-gen
<service-token>
Then you can use for example curl
or another HTTP client to generate a description.
% curl -H 'Authorization: Bearer <service-token>' "https://eyevinnlab-tutorial.eyevinn-img-alt-gen.auto.prod.osaas.io/image/alt?url=https%3A%2F%2Fblog.osaas.io%2Fwp-content%2Fuploads%2F2025%2F02%2Fimage-1536x851.png&format=text"
The image displays a dashboard tracking the status and performance of streaming monitors, showing active status, uptime, and error rates.