Skylark SDK
Skylark SDK

SDKs

One file per language, no dependencies. Served by the API, so the client you download is the one this build was made from.

Each client is a single file with no dependencies, embedded in the service binary and served by the API itself. That is deliberate: a copy kept anywhere else can drift from the API it talks to, and an embedded one cannot.

Reading the live catalog

From https://sdk.skylarklabs.ai/v1/catalog

Using a client

Every client works the same way: load a model, then run it on an image, a clip or a live camera. One call returns every class the model detects; keep the ones you need by filtering on class. The model names are the ids on the Models page.

Python

from skylark_models import Skylark

sky = Skylark("skl_...")
model = sky.models.load("CFAM-CCTV")

result = model.predict("street.jpg")
for d in result["detections"]:
    print(d["class"], round(d["confidence"], 2), d["bbox"], d.get("plate", ""))
people = [d for d in result["detections"] if d["class"] == "person"]

clip = model.predict_video("clip.mp4")
live = model.stream("rtsp://192.168.1.20/stream1", fps=2)

Node

import { Skylark } from './skylark.mjs'

const sky = new Skylark(process.env.SKYLARK_API_KEY)
const model = sky.model('CFAM-CCTV')

const result = await model.predict('street.jpg')
const people = result.detections.filter((d) => d.class === 'person')
const clip = await model.predictVideo('clip.mp4')

TypeScript and the browser

import { Skylark } from './skylark'   // or https://sdk.skylarklabs.ai/v1/sdk/browser, as a module

const sky = new Skylark(apiKey)
const result = await sky.model('CFAM-Aerial').predict(file)

sky.models() (Python: sky.models.list()) lists every model with its classes, what it adds and its prices. An unknown model raises an error whose code is unknown_model, and whose message names the valid ones.

curl

curl -X POST https://sdk.skylarklabs.ai/v1/infer/image \
  -H "Authorization: Bearer $SKYLARK_API_KEY" \
  -F "model=CFAM-CCTV" -F "file=@street.jpg"

Upgrading from 1.x

Clients before 2.0 named a solution id (detect(file, "cctv_outdoor_person_detection") and a solution form field). The API now takes a model instead, and refuses solution; a refused call's message names the model to use. One call returns every class the model detects, so to get what a 1.x solution gave you, run its model and read the part of the result it was about:

1.x solution idmodelRead from the result
cctv_outdoor_crowd_detectionCFAM-CCTVcrowd
cctv_outdoor_fire_smoke_detectionCFAM-CCTVdetections of fire, smoke
cctv_outdoor_helmet_detectionCFAM-CCTVflags.hasBikeHelmet on riders
cctv_outdoor_anpr_detectionCFAM-CCTVnumber_plate detections and their plate
cctv_outdoor_person_detectionCFAM-CCTVdetections of person
cctv_outdoor_ppe_detectionCFAM-CCTVflags.hasVest / flags.hasHelmet on person
cctv_outdoor_vehicle_detectionCFAM-CCTVdetections of two_wheeler, three_wheeler, four_wheeler
cctv_outdoor_weapon_detectionCFAM-CCTVdetections of weapon
drone_person_crowdCFAM-Aerialcrowd
drone_fire_smoke_detectionCFAM-Aerialdetections of the *_fire and *_smoke classes
drone_person_detectionCFAM-Aerialdetections of person, partial_human
drone_ppe_detectionCFAM-Aerialflags.hasVest / flags.hasHelmet on people
drone_vehicle_crowdCFAM-Aerialcongestion
drone_vehicle_detectionCFAM-Aerialdetections of its vehicle classes
thermal_uas_detectionCFAM-Aerial-Thermaldetections of Drone
fod_detectionCFAM-FODdetections of Big, Medium, Small
cctv_outdoor_uas_detectionCFAM-UASdetections of Quadcopter, Payload, Bird

What else changed:

  • Results are the model's raw output — see Raw output. Expect more detections than 1.x returned: every class, including lower-confidence boxes; filter on class and confidence if you want fewer.
  • Every image costs one frame. 1.x charged fixed-camera models four.
  • Results carry model instead of solution, plus counts per class and the model's crowd / congestion blocks.