AI Studio
Search…
⌃K

Python Package

The Cameralyze Python package provides an easy-to-use interface through which you can interact with the Cameralyze platform. With the Python package, you can:
  1. 1.
    Run public models
  2. 2.
    Run public workflows.
  3. 3.
    Run private models.
  4. 4.
    Run private workflows.

Installation

pip install cameralyze

Run public models

You can run a public model in your code. You can find all public models in the platform and hub.
import cameralyze
# connect to Cameralyze
connector = cameralyze.Model(api_key="YOUR_API_KEY")
# set the model you want to use
connector.set_model(model="4154b8ff-aad5-4ae7-9747-3dcc50ed7ac7")
# run for image URL
image = "https://"
# run for local file
image = model.read_file(path="")
# run for base64 file
import base64
with open("yourfile.jpg", "rb") as image_file:
image = base64.b64encode(image_file.read()).decode("utf8")
# get response
image = model.predict(image=image)
Last modified 1mo ago