Skip to main content

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
            }
         ]
      }
   ]
}

Release files for layernext-enterprise 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for layernext-enterprise 1.0.0
File Size Uploaded
layernext-enterprise-1.0.0.tar.gz 32.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for layernext-enterprise 1.0.0
File Interpreter ABI Platform
layernext_enterprise-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 73.2 kB

Release files / layernext-enterprise-1.0.0.tar.gz

Download URL layernext-enterprise-1.0.0.tar.gz
Size 32.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7683dbfd5256603153b296f5e6f09005cc9a54720ebff918da37749adc6aa244
BLAKE2b-256 checksum
How to use checksums
22aa6f526f31978450e8f027f405060b8461d0ed5d08f5d336dffb5ea82d4ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / layernext_enterprise-1.0.0-py3-none-any.whl

Download URL layernext_enterprise-1.0.0-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc38cd06d08bcbb641d2939c647a0d9a567c3fe5fcdef44b625f6ef6771c62be
BLAKE2b-256 checksum
How to use checksums
da295303cd9e2bc6526338fcb07c5f32a1e3f66de0261d52f0c362e795ef9f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page