LayerNext Python SDK
Project description
layernext-python-sdk
LayerNext Python API Client Sync (upload/download) with LayerNext stacks via APIs from your local machine
You can
- Upload model runs data
Installation
$ pip install layernext-sdk
Usage
import layernext
api_key = 'xxxxxxxxxx'
secret = 'xxxxxxxxxxx'
url = 'https://api.xxxx.layernext.ai'
client = layernext.LayerNextClient(api_key, secret, url)
collection_base_path = 'path1/path2/'
#upload box type annotations
file_path_bbox = '/home/bob/mydata/example_bbox.json' #local file path
client.upload_modelrun_from_json(collection_base_path, 'test model v1.0.1', file_path_bbox, 'rectangle')
#upload polygon type annotations
file_path_polygon = '/home/bob/mydata/example_polygon.json'
client.upload_modelrun_from_json(collection_base_path, 'test model v1.0.2', file_path_polygon, 'polygon')
#upload line type annotations
file_path_line = '/home/bob/mydata/example_line.json'
client.upload_modelrun_from_json(collection_base_path, 'test model v1.0.3', file_path_line, 'line')
Sample Data
Box Geometry
{
"images":[
{
"image":"000000397133.jpg",
"annotations":[
{
"bbox":[
217.62,
240.54,
38.99,
57.75
],
"label":"kitchen",
"metadata":{
"name":"bottle"
},
"confidence":0.30611335805442985
}
]
}
]
}
Polygon Geometry
{
"images":[
{
"image":"000000397133.jpg",
"annotations":[
{
"polygon":[
[
224.24,
297.18
],
[
228.29,
297.18
],
[
234.91,
298.29
],
[
243.0,
297.55
],
[
249.25,
296.45
],
[
252.19,
294.98
],
[
256.61,
292.4
],
[
254.4,
264.08
],
[
251.83,
262.61
],
[
241.53,
260.04
],
[
235.27,
259.67
],
[
230.49,
259.67
],
[
233.44,
255.25
],
[
237.48,
250.47
],
[
237.85,
243.85
],
[
237.11,
240.54
],
[
234.17,
242.01
],
[
228.65,
249.37
],
[
224.24,
255.62
],
[
220.93,
262.61
],
[
218.36,
267.39
],
[
217.62,
268.5
],
[
218.72,
295.71
],
[
225.34,
297.55
]
],
"label":"kitchen",
"metadata":{
"name":"bottle"
},
"confidence":0.8316836170368476
}
]
}
]
}
Line Geometry
{
"images":[
{
"image":"000000397133.jpg",
"annotations":[
{
"line":[
[
217.62,
240.54
],
[
256.61,
240.54
],
[
256.61,
298.28999999999996
],
[
217.62,
298.28999999999996
]
],
"label":"kitchen",
"metadata":{
"name":"bottle"
},
"confidence":0.9496247739008129
}
]
}
]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file layernext-enterprise-beta-1.1.0b1.tar.gz
.
File metadata
- Download URL: layernext-enterprise-beta-1.1.0b1.tar.gz
- Upload date:
- Size: 34.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3cb51ceba0a99614c57aee7aa5502b21f6fdbed936dcfa9eedc53a5a0b4599a |
|
MD5 | a8f284dff3d91684016ff46b2b79082a |
|
BLAKE2b-256 | fc3606e60149493002e72623728c6e81d4d962c0801107a24d34e78f7e71d970 |
File details
Details for the file layernext_enterprise_beta-1.1.0b1-py3-none-any.whl
.
File metadata
- Download URL: layernext_enterprise_beta-1.1.0b1-py3-none-any.whl
- Upload date:
- Size: 42.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 521d8eef7272f3b12a8b79aad75230062f8fd8da548eff9e33470a565e482dc6 |
|
MD5 | 68de34ae0d616b6b2093371ed4166093 |
|
BLAKE2b-256 | 14ea1c9876d7d3d5e03f8a55a1c3b73caed4e3e43af77d4db987eb5b7c3e3da9 |