Skip to content

v0.21.0b2

Pre-release
Pre-release
Compare
Choose a tag to compare
@njooma njooma released this 14 May 19:11

This release introduces two major breaking changes, summarized below:

Removing PIL from the SDK

Summary:
The python SDK no longer decodes images natively. It is up to the user to use whatever image pipeline they want. We’re maintaining utility functions in viam.media.utils.pil to assist in the transition, but you as the consumer will have to make sure that Pillow is installed. The helper functions are: viam_to_pil_image and pil_to_viam_image.

Example usage:

# Modular Camera
async def get_image(...) -> ViamImage:
    pil_image = ... #  your existing code that returns PIL image
    return pil_to_viam_image(pil_image)

# Client Code
async def run_client():
    camera = ...
    viam_image = camera.get_image(...) # Used to be PIL Image
    pil_image = viam_to_pil_image(viam_image)
    ...

The same methods can be used to provide a ViamImage to the VisionService.

Expected Impact: Every modular Camera and VisionService that does not pin their python-sdk version. All client code that calls on a Camera or VisionService that does not pin their python-sdk version.

AppClient no longer saves org_id

Summary:
app_client APIs no longer make assumptions about which org a user is authed to when making calls.
In all methods where an org_id is relevant, users will now be required to pass org_id as the first argument. This is an important change because it allows for greater flexibility in the scoping of API keys.

# before
_ = app_client.list_organization_members()

# after
_ = app_client.list_organization_members("MY_ORG_ID")

Expected Impact: Any clients/scripts/modules using the AppClient