Skip to main content

This module is a means for interfacing with projectkiwi.io using python.

Project description

Projectkiwi3 Client

This package adds a basic python interface for the projectkiwi api.

Installation

pip install projectkiwi3

Getting Started

Retrieve your projectkiwi API key here: https://projectkiwi.io/developer

import projectkiwi3

client = projectkiwi3.Client("YOUR_API_KEY")

# list all our projects
projects = client.getProjects()



Reading Annotations

project = projects[0]

# get current annotations
annotations = client.getAnnotations(project.id)

Adding Annotations

# get labels
newLabel = client.addLabel(project.id, "demo label", "rgb(3, 186, 252)")

# create new annotation
newAnnotation = client.addAnnotation(
    project.id, 
    coordinates=[[-123.4, 56.789012]], 
    shape="Point", 
    labelId=newLabel.id
    confidence=1.0
)

print(newAnnotation)
# id=553971 sub='google-oauth2|115859123295676188590' shape='Point' createdAt='2024-09-05T18:47:17.529Z' confidence=1.0 labelId=3 label=Label(id=3, name='demo label', color='rgb(3, 186, 252)', active=True, modifiedAt='2024-07-15T20:29:59.697Z') coordinates=[[-123.4, 56.789012]]



Working with labeling Queues

Labeling Queues allow us to break up larger labeling tasks in to bite size portions, easily digestible for both humans and GPUs.

import matplotlib.pyplot as plt

# list out all labeling queues in the project
labelingQueues = client.getLabelingQueues(project.id)

# let's just pick out the latest one
labelingQueue = labelingQueues[-1]

# find imagery layer to use - every geotiff you upload creates an imagery layer
imageryLayer = client.getAllImagery(project.id)[-1]

# Preview an image for a single task within the labeling queue
task = labelingQueue.labelingTasks[-1]
img = client.getImageForTask(imageryLayer, task.coordinates)
plt.imshow(img)
plt.show()

preview image

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

projectkiwi3-0.1.7.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

projectkiwi3-0.1.7-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

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