Innocuous Book
  • Welcome to Innocuous Book!
  • Remote Development
    • Remote Development
  • Experiment
    • Experiment
      • Web UI
      • Magic
      • CLI
  • Team
    • Team
  • Tracking
    • Tracking
  • Endpoint
    • Create Endpoint
    • Magic
    • Endpoint API
    • Endpoint SDK
  • File Manager
    • Web UI
Powered by GitBook
On this page
  • Let's start
  • Import package
  • Login
  • Methods
  • List all running endpoint
  • Get endpoint id by name
  • Get endpoint information
  • Predict with json body
  • Predict with local files
  • Upload dataset

Was this helpful?

  1. Endpoint

Endpoint SDK

Use SDK to upload your dataset and predict

PreviousEndpoint APINextWeb UI

Last updated 3 years ago

Was this helpful?

Let's start

Import package

from innocuous_sdk.endpoint import Endpoint

Login

Use user_name and user_token to login, and start to use the following methods

endpoint = Endpoint('<user_name>', '<user_token>')

Methods

List all running endpoint

List all running endpoint

endpoint_list = endpoint.list_endpoint()

Get endpoint id by name

endpoint_id = endpoint.get_endpoint_id('<my-endpoint-nema>')

Get endpoint information

result = endpoint.get_endpoint(endpoint_id)

Predict with json body

data = { "images": [  
            "https://file.innocuous.ai/3.jpg", 
            "https://file.innocuous.ai/7.jpg", 
            "https://file.innocuous.ai/8.jpg"
        ]}
result = endpoint.predict_json(endpoint_id, data)

Predict with local files

files = [
    '/local/path/file/1.jpg',
    '/local/path/file/2.jpg',
    '/local/path/file/3.jpg',
    '/local/path/file/4.jpg'
]
result = endpoint.predict_file(endpoint_id, files)

Upload dataset

result = endpoint.upload_dataset(endpoint_id, '/local/path/file/test.zip')
🔜