Skip to main content

Python SDK for the BaudLabs image and video search API

Project description

BaudLabs Python SDK

Python client for the BaudLabs image and video search API.

Install

pip install baudlabs

Quick start

import baudlabs

client = baudlabs.Client("bl_your_api_key")

Video Search

client.create_index("my_videos")

client.add_videos(
    index_id="my_videos",
    files=["video1.mp4", "video2.mp4"],
)

results = client.search(
    index_id="my_videos",
    query="person walking a dog",
    media_type="video",
)

for match in results.matches:
    print(match.video_id, match.start_time, match.end_time, match.score)

Image Search

client.create_index("my_images")

client.add_images(
    index_id="my_images",
    files=["img1.jpg", "img2.jpg"],
)

results = client.search(
    index_id="my_images",
    query="sunset over ocean",
    media_type="image",
)

for match in results.matches:
    print(match.image_id, match.score)

Mixed Image and Video Search

client.create_index("my_media")

client.add_images(
    index_id="my_media",
    files=["img1.jpg", "img2.jpg"],
)

client.add_videos(
    index_id="my_media",
    files=["video1.mp4", "video2.mp4"],
)

results = client.search(
    index_id="my_media",
    query="a red car driving on a city street",
    media_type="mixed",
)

for match in results.matches:
    if match.image_id:
        print("image", match.image_id, match.image_url, match.score)
    if match.video_id:
        print("video", match.video_id, match.start_time, match.end_time, match.video_url, match.score)

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

baudlabs-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

baudlabs-0.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: baudlabs-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for baudlabs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8fd6e48f055ae86cb4fe12c61e5258c40fbcde21d4ffb2a884b69b853c467eba
MD5 824ab9aa3fbc7d4fd34df37f484bb736
BLAKE2b-256 b6f98e138aa12ed6726f8eec546449a1d61334737e3d96f26de92a3b1bacd43f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: baudlabs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for baudlabs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77457f73d6a340488b5be8385447c903c3087b2bdff190af7954f67f9ec20fe8
MD5 60dcb1cebfb43205ae646d38fd7c1d78
BLAKE2b-256 68acdd430d50b08a79058c5f63fb955e23afab069394f35eb841014206e24a5d

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