Skip to main content

A Python library for working with vision models.

Project description

limin-vision

A Python library for working with vision models.

Installation

Install the library using pip:

pip install limin-vision

Usage

After you've installed the library, you can use it by importing the limin_vision module and calling the functions you need. You will also need to provide an API key for your API either by running export OPENAI_API_KEY=$YOUR_API_KEY or by creating an .env file in the root directory of your project and adding the following line:

OPENAI_API_KEY=$YOUR_API_KEY

Here is an example of how to use the library:

import asyncio
from limin_vision import process_image_from_url

async def main():
    url = "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
    result = await process_image_from_url(url)
    print(result)

if __name__ == "__main__":
    asyncio.run(main())

You can pass additional parameters to the process_image_from_url function to customize the model configuration and prompt:

await process_image_from_url(
    url,
    model_configuration=ModelConfiguration(
        model="gpt-4o",
        temperature=1.0
    ),
    prompt="What's in this image?",
    detail="high",
)

You can find the full example in examples/process_from_url.py.

Alternatively, you can process an image from a local file by calling process_image_from_file instead of process_image_from_url.

from limin_vision import process_image_from_file

async def main():
    result = await process_image_from_file("image.png")
    print(result)

if __name__ == "__main__":
    asyncio.run(main())

Just like with process_image_from_url, you can pass additional parameters to the process_image_from_file function to customize the model configuration and prompt:

await process_image_from_file(
    "image.png",
    model_configuration=ModelConfiguration(
        model="gpt-4o",
        temperature=1.0
    ),
    prompt="What's in this image?",
    detail="high",
)

You can find the full example in examples/process_from_file.py.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

limin_vision-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

limin_vision-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file limin_vision-0.1.0.tar.gz.

File metadata

  • Download URL: limin_vision-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for limin_vision-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c38878fc284f2fdd770b5a52ec7a9398d8d6bc5199b5cd81b548b2e5b8cfa472
MD5 179300cb16960ccb2ec0dee6fc9062d4
BLAKE2b-256 d3cd76cf6d9b1fbe3a4b8f75f7ee4d9e83c7263e7944efdae9905823acc81d3d

See more details on using hashes here.

File details

Details for the file limin_vision-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: limin_vision-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for limin_vision-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d010225558d7d682cd137af8044e081519dc46bca1d2cf0ba0adac91f6a440c
MD5 ad1fae7ed91a428340624431c167603c
BLAKE2b-256 7ee83e1cc8fe123cf021b7d10c21b4a217f19acc456d8f9cc9e688551468ee2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page