NAV Navbar
CURL HTTP

HACARUS CHECK v1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

English | 日本語

ハカルスはメーカーとメディカル事業に向け、軽量で説明可能なAIソリューションズを提供しています。

弊社のスパースモデリングに基づいた技術は、人間のようにデータを理解できる独自の機械学習手法です。スパースモデリングは軽量に設計されているため、コンピューティングパワー、クラウド環境、および少量の学習データなどの資源の制限された環境下で特に有用です。

弊社のソリューションは組み込みシステムでオフライン環境かクラウドで実行できます。伝統的なディープラーニングベースの手法に比べ、資源を効率的に使用し、よりよい結果を提供します。

ハカルスの外観検査ソリューションの詳細を参照するには、こちらのリンク、https://hacarus.com/ja/visual-inspection/ をご覧ください。また、APIへのアクセスのリクエストはcontact us までご連絡ください。

Base URLs:

この外観検査用 API wrapper for C#は、あなたのC#のプロジェクトに、APIを通じて外観検査モジュールを組み込むことができます。このライブラリはC# .Net Framework 4.6.1 と .Net Core 2.0.をサポートしています。
このPython用外観検査SDKは、APIを用いてハカルス外観検査モジュールを使いたいソフトウェアエンジニアのために作成しています。 このAPIによって、Pythonベースのアプリケーションに外観検査モジュールを簡単に統合することができます。

インストール

PM> Install-Package HacarusVisualInspectionApi -Version 1.1.2-beta
> pip install hacarus_visual_inspection
このパッケージをプロジェクトにインストールするため、こちらのコマンドをPackage Manager Consoleに入力してください。
このパッケージをインストールするために、以下のコマンドを実行してください。
NuGetパッケージマネージャを使用してプロジェクトに追加することもできます。Show prerelease packagesにチェックを入れ、 HacarusVisualInspectionApi を nuget.org のリポジトリで検索してください。

他のインストール方法はNuget Package Siteを参照ください。

用語説明

このドキュメントの全体で使用されている用語の簡単な説明:

モデル
モデルは一連のパラメータの設定とともに、データセットの学習データ(トレーニングデータ)をアルゴリズムに適用して、作成・学習できます。

アルゴリズム
アルゴリズムはモデルを構成するため使用する機械学習アルゴリズムのことです。外観検査の性質と予想される精度および性能によって選択します。

学習
新しいモデルを作成する操作です。

パラメータ
パラメータは、学習中にアルゴリズムを適用する方法を構成するために使用されます。 例えば、最小または最大の画像解像度などがあります。

データ
データ(アイテムとも呼ばれる)は検査の対象となる単一の製品のデータを表します。 1つのデータに1つまたは複数の画像を関連付けることができます。 例:倉庫内の梱包箱の場合、一つの箱に6つの面の画像があります。

使用方法

始めに、下記のものが必要です。

Authentication

Scope Scope Description
all all scopes

targets

Inspection Target related operations

getInspectionTargets

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/targets/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/targets/ HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/targets/

Get List of Inpection Targets

Get all inspection targets created by user

Example responses

200 Response

{
  "data": [
    {
      "preprocessing": [
        {
          "active": true,
          "name": "string",
          "config": "string"
        }
      ],
      "name": "string",
      "target_id": 0
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK InspectionTargetListWrapper
default Default Default error response BaseError

getInspectionTargetById

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/targets/{target_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/targets/{target_id} HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/targets/{target_id}

Get Inspection Target by ID

Get a single inspection target using the inspection target ID.

Parameters

Name In Type Required Description
target_id path string true none

Example responses

200 Response

{
  "data": {
    "preprocessing": [
      {
        "active": true,
        "name": "string",
        "config": "string"
      }
    ],
    "name": "string",
    "target_id": 0
  }
}

Responses

Status Meaning Description Schema
200 OK OK InspectionTargetWrapper
default Default Default error response BaseError

setInspectionTargetById

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/targets/{target_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/targets/{target_id} HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

POST /api/v1/targets/{target_id}

Set Default Inspection Target by ID

Set the default inspection target using the inspection target ID.

Parameters

Name In Type Required Description
target_id path string true none

Example responses

200 Response

{
  "data": {
    "preprocessing": [
      {
        "active": true,
        "name": "string",
        "config": "string"
      }
    ],
    "name": "string",
    "target_id": 0
  }
}

Responses

Status Meaning Description Schema
200 OK OK InspectionTargetWrapper
default Default Default error response BaseError

getModelResults

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/targets/model/results \
  -H 'Accept: application/octet-stream' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/targets/model/results HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/octet-stream

POST /api/v1/targets/model/results

Parameters

Name In Type Required Description
model_ids query array[string] false none

Example responses

200 Response

422 Response

{
  "errors": {
    "message": [
      {
        "key": "string",
        "errors": [
          "string"
        ]
      }
    ],
    "status": 0,
    "detail": "string",
    "source": {
      "pointer": "string"
    },
    "title": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK CSV file containing the model/s results string
422 Unprocessable Entity Unprocessable Entity BaseError

algorithms

Algorithm related operations

アルゴリズムを取得する

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/algorithms/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/algorithms/ HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/algorithms/

Get List of Algorithms

Example responses

200 Response

{
  "data": [
    {
      "type": "string",
      "algorithm_id": "string",
      "version": "string",
      "updated_at": "2022-03-03T06:48:30Z",
      "file_name": "string",
      "class_name": "string",
      "parameters": [
        {
          "value": "string",
          "data_type": "string",
          "algorithm_id": "string",
          "updated_at": "2022-03-03T06:48:30Z",
          "algorithm_parameter_id": 0,
          "display_name": "string",
          "range_lower": "string",
          "created_at": "2022-03-03T06:48:30Z",
          "model_parameter": true,
          "name": "string",
          "range_upper": "string"
        }
      ],
      "created_at": "2022-03-03T06:48:30Z",
      "name": "string",
      "attribute": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK AlgorithmWithParameterListWrapper
default Default Default error response BaseError

getAlgorithmById

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/algorithms/{algorithm_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/algorithms/{algorithm_id} HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/algorithms/{algorithm_id}

Get Algorithm by ID

Get a single algorithm by ID

Parameters

Name In Type Required Description
algorithm_id path string true none

Example responses

200 Response

{
  "data": {
    "type": "string",
    "algorithm_id": "string",
    "version": "string",
    "updated_at": "2022-03-03T06:48:30Z",
    "file_name": "string",
    "class_name": "string",
    "parameters": [
      {
        "value": "string",
        "data_type": "string",
        "algorithm_id": "string",
        "updated_at": "2022-03-03T06:48:30Z",
        "algorithm_parameter_id": 0,
        "display_name": "string",
        "range_lower": "string",
        "created_at": "2022-03-03T06:48:30Z",
        "model_parameter": true,
        "name": "string",
        "range_upper": "string"
      }
    ],
    "created_at": "2022-03-03T06:48:30Z",
    "name": "string",
    "attribute": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK AlgorithmWithParameterWrapper
default Default Default error response BaseError

学習

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/algorithms/{algorithm_id}/train \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/algorithms/{algorithm_id}/train HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: application/json
Accept: application/json

POST /api/v1/algorithms/{algorithm_id}/train

Train

Body parameter

{
  "name": "string",
  "item_ids": [
    "string"
  ],
  "override_params": [
    {
      "algorithm_parameter_id": 0,
      "value": "string"
    }
  ]
}

Parameters

Name In Type Required Description
body body TrainRequest true none
algorithm_id path string true none

Example responses

200 Response

{
  "data": {
    "algorithm_type": "string",
    "image_url": "string",
    "algorithm_id": "string",
    "version": "string",
    "ok_img_count": 0,
    "precision": 0,
    "recall": 0,
    "status_text": "string",
    "active": true,
    "training_time": 0,
    "updated_at": "2022-03-03T06:48:30Z",
    "ng_img_count": 0,
    "context_id": 0,
    "model_id": "string",
    "stats": {
      "accuracy": 0,
      "precision": {
        "projected": 0,
        "computed": 0
      },
      "recall": {
        "projected": 0,
        "computed": 0
      }
    },
    "created_at": "2022-03-03T06:48:30Z",
    "status": "string",
    "name": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK HModelWrapper
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

models

Model related operations

モデルを取得する

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/models/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/models/ HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/models/

Get List of Models

Parameters

Name In Type Required Description
algorithm_id query string false none

Example responses

200 Response

{
  "data": [
    {
      "algorithm_type": "string",
      "image_url": "string",
      "algorithm_id": "string",
      "version": "string",
      "ok_img_count": 0,
      "precision": 0,
      "recall": 0,
      "status_text": "string",
      "active": true,
      "training_time": 0,
      "updated_at": "2022-03-03T06:48:30Z",
      "ng_img_count": 0,
      "context_id": 0,
      "model_id": "string",
      "stats": {
        "accuracy": 0,
        "precision": {
          "projected": 0,
          "computed": 0
        },
        "recall": {
          "projected": 0,
          "computed": 0
        }
      },
      "created_at": "2022-03-03T06:48:30Z",
      "status": "string",
      "name": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK HModelListWrapper
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

deleteModels

Code samples

# You can also use wget
curl -X DELETE https://sdd-api-staging.hacarus.com/api/v1/models/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE https://sdd-api-staging.hacarus.com/api/v1/models/ HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

DELETE /api/v1/models/

Delete Models

Delete models by id (list)

Parameters

Name In Type Required Description
model_ids query array[string] false none

Example responses

200 Response

{
  "data": {
    "model_ids": [
      "string"
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK OK ModelIdsQueryWrapper
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

getModelById

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/models/{model_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/models/{model_id} HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/models/{model_id}

Get Model by ID

Get a single model by ID

Parameters

Name In Type Required Description
model_id path string true none

Example responses

200 Response

{
  "data": {
    "algorithm_type": "string",
    "image_url": "string",
    "algorithm_id": "string",
    "version": "string",
    "ok_img_count": 0,
    "precision": 0,
    "recall": 0,
    "status_text": "string",
    "active": true,
    "training_time": 0,
    "updated_at": "2022-03-03T06:48:30Z",
    "ng_img_count": 0,
    "context_id": 0,
    "model_id": "string",
    "stats": {
      "accuracy": 0,
      "precision": {
        "projected": 0,
        "computed": 0
      },
      "recall": {
        "projected": 0,
        "computed": 0
      }
    },
    "created_at": "2022-03-03T06:48:30Z",
    "status": "string",
    "name": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK HModelWrapper
default Default Default error response BaseError

exportModelsWithId

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/models/export \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/zip' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/models/export HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: application/json
Accept: application/zip

POST /api/v1/models/export

Export models

Export models given the Id

Body parameter

{
  "model_ids": [
    "string"
  ]
}

Parameters

Name In Type Required Description
body body ModelIdsQuery true none

Example responses

200 Response

422 Response

{
  "errors": {
    "message": [
      {
        "key": "string",
        "errors": [
          "string"
        ]
      }
    ],
    "status": 0,
    "detail": "string",
    "source": {
      "pointer": "string"
    },
    "title": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK Zip file containing the model/s string
422 Unprocessable Entity Unprocessable Entity BaseError

importModels

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/models/import \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/models/import HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: multipart/form-data
Accept: application/json

POST /api/v1/models/import

Import models

Import models from the zip file

Body parameter

models: string

Parameters

Name In Type Required Description
body body ImportModels true none

Example responses

200 Response

{
  "data": [
    {
      "algorithm_type": "string",
      "image_url": "string",
      "algorithm_id": "string",
      "version": "string",
      "ok_img_count": 0,
      "precision": 0,
      "recall": 0,
      "status_text": "string",
      "active": true,
      "training_time": 0,
      "updated_at": "2022-03-03T06:48:30Z",
      "ng_img_count": 0,
      "context_id": 0,
      "model_id": "string",
      "stats": {
        "accuracy": 0,
        "precision": {
          "projected": 0,
          "computed": 0
        },
        "recall": {
          "projected": 0,
          "computed": 0
        }
      },
      "created_at": "2022-03-03T06:48:30Z",
      "status": "string",
      "name": "string"
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK OK HModelListWrapper
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

setModelPredictParameters

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/models/{model_id}/update_predict_parameters \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/models/{model_id}/update_predict_parameters HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: application/json
Accept: application/json

POST /api/v1/models/{model_id}/update_predict_parameters

Set Prediction Parameters

Updates predict parameters

Body parameter

{
  "threshold": 0,
  "ignore_outer": "string",
  "min_detected_area": 0
}

Parameters

Name In Type Required Description
body body UpdatePredictParameters true none
model_id path string true none

Example responses

200 Response

{
  "data": {
    "threshold": 0,
    "ignore_outer": "string",
    "min_detected_area": 0
  }
}

Responses

Status Meaning Description Schema
200 OK OK UpdatePredictParametersResponseWrapper
400 Bad Request Invalid parameters BaseError
default Default Default error response BaseError

setModelPredictCallback

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/models/{model_id}/update_predict_callback \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/models/{model_id}/update_predict_callback HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: application/json
Accept: application/json

POST /api/v1/models/{model_id}/update_predict_callback

Set Prediction Callback URL

Updates the callback URL for prediction. Once this endpoint has been set, a successful prediction will do a POST or GET operation to the callback URL with the data PredictionItemCallbackResponse

Body parameter

{
  "callback_url": "string",
  "callback_method": "string"
}

Parameters

Name In Type Required Description
body body UpdatePredictCallback true none
model_id path string true none

Example responses

200 Response

{
  "data": {
    "callback_url": "string",
    "callback_method": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK UpdatePredictCallbackResponseWrapper
400 Bad Request Invalid parameters BaseError
default Default Default error response BaseError

predictItems

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/models/{model_id}/predict \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/models/{model_id}/predict HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: application/json
Accept: application/json

POST /api/v1/models/{model_id}/predict

Predict Items

Predict items in the background

Body parameter

{
  "item_ids": [
    "string"
  ]
}

Parameters

Name In Type Required Description
body body Predict true none
model_id path string true The model id, set to "active" to use current active model

Example responses

200 Response

{
  "data": {
    "model_version": "string",
    "item_ids": [
      "string"
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK OK PredictItemsResponseWrapper
400 Bad Request model_id not found BaseError
404 Not Found item_id not found BaseError
425 Unknown The server is busy processing requests. Try again in a while. BaseError
default Default Default error response BaseError

items

Item related operations

getItemsByType

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/items/?item_type=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/items/?item_type=string HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/items/

Get List of Items

Returns items based on given item_type (prediction, training)

Parameters

Name In Type Required Description
count query integer(int32) false none
page query integer(int32) false none
model_id query string false none
item_type query string true none

Example responses

200 Response

{
  "data": {
    "end_page": 0,
    "current_page": 0,
    "count_per_page": 0,
    "items": [
      {
        "active": true,
        "is_training_data": true,
        "user_assessment": {
          "result": "string",
          "annotations": [
            {
              "y_min": 0,
              "x_max": 0,
              "y_max": 0,
              "label": 0,
              "defect_size": 0,
              "created_at": "2022-03-03T06:48:30Z",
              "x_min": 0,
              "annotation_id": 0,
              "notes": "string"
            }
          ],
          "label": "string",
          "images": [
            {
              "url": "string",
              "width": 0,
              "file_size": 0,
              "height": 0,
              "name": "string"
            }
          ]
        },
        "images": [
          {
            "url": "string",
            "width": 0,
            "file_size": 0,
            "height": 0,
            "name": "string"
          }
        ],
        "item_id": "string",
        "assessments": [
          {
            "annotations": [
              {
                "y_min": 0,
                "x_max": 0,
                "y_max": 0,
                "label": 0,
                "defect_size": 0,
                "created_at": "2022-03-03T06:48:30Z",
                "x_min": 0,
                "annotation_id": 0,
                "notes": "string"
              }
            ],
            "label": "string",
            "images": [
              {
                "url": "string",
                "width": 0,
                "file_size": 0,
                "height": 0,
                "name": "string"
              }
            ],
            "anomaly_score": "string",
            "model_id": "string",
            "detected_objects": 0,
            "detection_accuracy": 0,
            "result": "string"
          }
        ],
        "status": "string",
        "name": "string"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK OK GetItemsResponseWrapper
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

データを追加する

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/items/ \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/items/ HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: multipart/form-data
Accept: application/json

POST /api/v1/items/

Add Item

Body parameter

files:
  - string
training: true
good: true
model_id: string

Parameters

Name In Type Required Description
body body AddItemRequest true none

Example responses

201 Response

{
  "data": {
    "item_ids": [
      "string"
    ]
  }
}

Responses

Status Meaning Description Schema
201 Created CREATED AddItemResponseWrapper
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

delItem

Code samples

# You can also use wget
curl -X DELETE https://sdd-api-staging.hacarus.com/api/v1/items/ \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

DELETE https://sdd-api-staging.hacarus.com/api/v1/items/ HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: application/json
Accept: application/json

DELETE /api/v1/items/

Body parameter

{
  "item_ids": [
    "string"
  ]
}

Parameters

Name In Type Required Description
body body DelItemRequest true none

Example responses

422 Response

{
  "errors": {
    "message": [
      {
        "key": "string",
        "errors": [
          "string"
        ]
      }
    ],
    "status": 0,
    "detail": "string",
    "source": {
      "pointer": "string"
    },
    "title": "string"
  }
}

Responses

Status Meaning Description Schema
422 Unprocessable Entity Unprocessable Entity BaseError

getItemById

Code samples

# You can also use wget
curl -X GET https://sdd-api-staging.hacarus.com/api/v1/items/{item_id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

GET https://sdd-api-staging.hacarus.com/api/v1/items/{item_id} HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

GET /api/v1/items/{item_id}

Get Item by Id

Get specific item and annotations

Parameters

Name In Type Required Description
show_assessments query boolean false none
show_annotations query boolean false none
model_id query string false none
item_id path string true none

Example responses

200 Response

{
  "data": {
    "active": true,
    "is_training_data": true,
    "user_assessment": {
      "result": "string",
      "annotations": [
        {
          "y_min": 0,
          "x_max": 0,
          "y_max": 0,
          "label": 0,
          "defect_size": 0,
          "created_at": "2022-03-03T06:48:30Z",
          "x_min": 0,
          "annotation_id": 0,
          "notes": "string"
        }
      ],
      "label": "string",
      "images": [
        {
          "url": "string",
          "width": 0,
          "file_size": 0,
          "height": 0,
          "name": "string"
        }
      ]
    },
    "images": [
      {
        "url": "string",
        "width": 0,
        "file_size": 0,
        "height": 0,
        "name": "string"
      }
    ],
    "item_id": "string",
    "assessments": [
      {
        "annotations": [
          {
            "y_min": 0,
            "x_max": 0,
            "y_max": 0,
            "label": 0,
            "defect_size": 0,
            "created_at": "2022-03-03T06:48:30Z",
            "x_min": 0,
            "annotation_id": 0,
            "notes": "string"
          }
        ],
        "label": "string",
        "images": [
          {
            "url": "string",
            "width": 0,
            "file_size": 0,
            "height": 0,
            "name": "string"
          }
        ],
        "anomaly_score": "string",
        "model_id": "string",
        "detected_objects": 0,
        "detection_accuracy": 0,
        "result": "string"
      }
    ],
    "status": "string",
    "name": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK ItemWrapper
422 Unprocessable Entity Unprocessable Entity BaseError

annotate

Code samples

# You can also use wget
curl -X PATCH https://sdd-api-staging.hacarus.com/api/v1/items/{item_id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

PATCH https://sdd-api-staging.hacarus.com/api/v1/items/{item_id} HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: application/json
Accept: application/json

PATCH /api/v1/items/{item_id}

Body parameter

{
  "annotations": [
    {
      "x_max": 0,
      "x_min": 0,
      "y_max": 0,
      "y_min": 0,
      "label": 0,
      "notes": "string"
    }
  ]
}

Parameters

Name In Type Required Description
body body AnnotateItemRequest true none
item_id path string true none

Example responses

422 Response

{
  "errors": {
    "message": [
      {
        "key": "string",
        "errors": [
          "string"
        ]
      }
    ],
    "status": 0,
    "detail": "string",
    "source": {
      "pointer": "string"
    },
    "title": "string"
  }
}

Responses

Status Meaning Description Schema
202 Accepted ACCEPTED None
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

utils

Support and utility functions

setLicense

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/utils/ \
  -H 'Content-Type: multipart/form-data' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/utils/ HTTP/1.1
Host: sdd-api-staging.hacarus.com
Content-Type: multipart/form-data
Accept: application/json

POST /api/v1/utils/

Body parameter

license_data: string

Parameters

Name In Type Required Description
body body License true none

Example responses

200 Response

{
  "data": {
    "license_expiry": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK LicenseResponseWrapper
422 Unprocessable Entity Unprocessable Entity BaseError
default Default Default error response BaseError

getLogs

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/utils/debug \
  -H 'Accept: application/octet-stream' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/utils/debug HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/octet-stream

POST /api/v1/utils/debug

Example responses

200 Response

Responses

Status Meaning Description Schema
200 OK ZIP file containing the debug logs string

getHashId

Code samples

# You can also use wget
curl -X POST https://sdd-api-staging.hacarus.com/api/v1/utils/node_hash \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

POST https://sdd-api-staging.hacarus.com/api/v1/utils/node_hash HTTP/1.1
Host: sdd-api-staging.hacarus.com
Accept: application/json

POST /api/v1/utils/node_hash

Example responses

200 Response

{
  "data": {
    "hash_id": "string"
  }
}

Responses

Status Meaning Description Schema
200 OK OK LicenseHashResponseWrapper
default Default Default error response BaseError

token

API authentication operations

login

Code samples

LoginParams loginParams = new LoginParams(
  clientId: "client id",
  clientSecret: "client secret",
  grantType: "client_credentials"
);
var resp = instance.Login(loginParams);

POST /api/auth/token

Authorization

Returns the access token

Body parameter

{
  "grant_type": "client_credentials",
  "client_secret": "client_secret",
  "client_id": "client_id"
}

Parameters

Name In Type Required Description
body body LoginParams true none

Example responses

200 Response

{
  "access_token": "access_token"
}

Responses

Status Meaning Description Schema
200 OK Successful login LoginResponse
401 Unauthorized Invalid credentials BaseError
default Default default error handler BaseError

Schemas

KeyValueError

{
  "key": "string",
  "errors": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
key string false none Error key
errors [string] false none none

ErrorSource

{
  "pointer": "string"
}

Properties

Name Type Required Restrictions Description
pointer string false none Endpoint errored

Error

{
  "message": [
    {
      "key": "string",
      "errors": [
        "string"
      ]
    }
  ],
  "status": 0,
  "detail": "string",
  "source": {
    "pointer": "string"
  },
  "title": "string"
}

Properties

Name Type Required Restrictions Description
message [KeyValueError] false none none
status integer(int32) false none Error status code
detail string false none Error Details
source ErrorSource false none Error Source
title string false none Error Title

BaseError

{
  "errors": {
    "message": [
      {
        "key": "string",
        "errors": [
          "string"
        ]
      }
    ],
    "status": 0,
    "detail": "string",
    "source": {
      "pointer": "string"
    },
    "title": "string"
  }
}

Properties

Name Type Required Restrictions Description
errors Error false none none

LoginResponse

{
  "access_token": "access_token"
}

response object of login

Properties

Name Type Required Restrictions Description
access_token string true none none

LoginParams

{
  "grant_type": "client_credentials",
  "client_secret": "client_secret",
  "client_id": "client_id"
}

login parameters

Properties

Name Type Required Restrictions Description
client_id string true none none
client_secret string true none none
grant_type string true none none

Preprocessing

{
  "active": true,
  "name": "string",
  "config": "string"
}

Properties

Name Type Required Restrictions Description
active boolean¦null false none none
name string true none none
config string¦null false none none

InspectionTarget

{
  "preprocessing": [
    {
      "active": true,
      "name": "string",
      "config": "string"
    }
  ],
  "name": "string",
  "target_id": 0
}

Properties

Name Type Required Restrictions Description
preprocessing [Preprocessing] false none none
name string false none none
target_id integer(int32) false none none

InspectionTargetListWrapper

{
  "data": [
    {
      "preprocessing": [
        {
          "active": true,
          "name": "string",
          "config": "string"
        }
      ],
      "name": "string",
      "target_id": 0
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [InspectionTarget] false none none

InspectionTargetWrapper

{
  "data": {
    "preprocessing": [
      {
        "active": true,
        "name": "string",
        "config": "string"
      }
    ],
    "name": "string",
    "target_id": 0
  }
}

Properties

Name Type Required Restrictions Description
data InspectionTarget false none none

AlgorithmParameter

{
  "value": "string",
  "data_type": "string",
  "algorithm_id": "string",
  "updated_at": "2022-03-03T06:48:30Z",
  "algorithm_parameter_id": 0,
  "display_name": "string",
  "range_lower": "string",
  "created_at": "2022-03-03T06:48:30Z",
  "model_parameter": true,
  "name": "string",
  "range_upper": "string"
}

Properties

Name Type Required Restrictions Description
value string¦null false none none
data_type string false none none
algorithm_id string true none none
updated_at string(date-time) true none none
algorithm_parameter_id integer(int32) false none none
display_name string¦null false none none
range_lower string¦null false none none
created_at string(date-time) true none none
model_parameter boolean¦null false none none
name string true none none
range_upper string¦null false none none

AlgorithmWithParameter

{
  "type": "string",
  "algorithm_id": "string",
  "version": "string",
  "updated_at": "2022-03-03T06:48:30Z",
  "file_name": "string",
  "class_name": "string",
  "parameters": [
    {
      "value": "string",
      "data_type": "string",
      "algorithm_id": "string",
      "updated_at": "2022-03-03T06:48:30Z",
      "algorithm_parameter_id": 0,
      "display_name": "string",
      "range_lower": "string",
      "created_at": "2022-03-03T06:48:30Z",
      "model_parameter": true,
      "name": "string",
      "range_upper": "string"
    }
  ],
  "created_at": "2022-03-03T06:48:30Z",
  "name": "string",
  "attribute": "string"
}

Properties

Name Type Required Restrictions Description
type string false none none
algorithm_id string true none none
version string¦null false none none
updated_at string(date-time) true none none
file_name string true none none
class_name string true none none
parameters [AlgorithmParameter] false none none
created_at string(date-time) true none none
name string true none none
attribute string false none none

AlgorithmWithParameterListWrapper

{
  "data": [
    {
      "type": "string",
      "algorithm_id": "string",
      "version": "string",
      "updated_at": "2022-03-03T06:48:30Z",
      "file_name": "string",
      "class_name": "string",
      "parameters": [
        {
          "value": "string",
          "data_type": "string",
          "algorithm_id": "string",
          "updated_at": "2022-03-03T06:48:30Z",
          "algorithm_parameter_id": 0,
          "display_name": "string",
          "range_lower": "string",
          "created_at": "2022-03-03T06:48:30Z",
          "model_parameter": true,
          "name": "string",
          "range_upper": "string"
        }
      ],
      "created_at": "2022-03-03T06:48:30Z",
      "name": "string",
      "attribute": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [AlgorithmWithParameter] false none none

AlgorithmWithParameterWrapper

{
  "data": {
    "type": "string",
    "algorithm_id": "string",
    "version": "string",
    "updated_at": "2022-03-03T06:48:30Z",
    "file_name": "string",
    "class_name": "string",
    "parameters": [
      {
        "value": "string",
        "data_type": "string",
        "algorithm_id": "string",
        "updated_at": "2022-03-03T06:48:30Z",
        "algorithm_parameter_id": 0,
        "display_name": "string",
        "range_lower": "string",
        "created_at": "2022-03-03T06:48:30Z",
        "model_parameter": true,
        "name": "string",
        "range_upper": "string"
      }
    ],
    "created_at": "2022-03-03T06:48:30Z",
    "name": "string",
    "attribute": "string"
  }
}

Properties

Name Type Required Restrictions Description
data AlgorithmWithParameter false none none

OverrideParam

{
  "algorithm_parameter_id": 0,
  "value": "string"
}

Properties

Name Type Required Restrictions Description
algorithm_parameter_id integer(int32) false none none
value string false none none

TrainRequest

{
  "name": "string",
  "item_ids": [
    "string"
  ],
  "override_params": [
    {
      "algorithm_parameter_id": 0,
      "value": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
name string false none none
item_ids [string] false none none
override_params [OverrideParam] false none none

HModelPrecision

{
  "projected": 0,
  "computed": 0
}

Properties

Name Type Required Restrictions Description
projected number¦null false none none
computed number¦null false none none

HModelStats

{
  "accuracy": 0,
  "precision": {
    "projected": 0,
    "computed": 0
  },
  "recall": {
    "projected": 0,
    "computed": 0
  }
}

Properties

Name Type Required Restrictions Description
accuracy number¦null false none none
precision HModelPrecision false none none
recall HModelPrecision false none none

HModel

{
  "algorithm_type": "string",
  "image_url": "string",
  "algorithm_id": "string",
  "version": "string",
  "ok_img_count": 0,
  "precision": 0,
  "recall": 0,
  "status_text": "string",
  "active": true,
  "training_time": 0,
  "updated_at": "2022-03-03T06:48:30Z",
  "ng_img_count": 0,
  "context_id": 0,
  "model_id": "string",
  "stats": {
    "accuracy": 0,
    "precision": {
      "projected": 0,
      "computed": 0
    },
    "recall": {
      "projected": 0,
      "computed": 0
    }
  },
  "created_at": "2022-03-03T06:48:30Z",
  "status": "string",
  "name": "string"
}

Properties

Name Type Required Restrictions Description
algorithm_type string true none none
image_url string¦null false none none
algorithm_id string true none none
version string true none none
ok_img_count integer(int32) false none none
precision number¦null false none none
recall number¦null false none none
status_text string¦null false none none
active boolean¦null false none none
training_time integer(int32)¦null false none none
updated_at string(date-time) true none none
ng_img_count integer(int32) false none none
context_id integer(int32) true none none
model_id string true none none
stats HModelStats false none none
created_at string(date-time) true none none
status string false none none
name string true none none

HModelWrapper

{
  "data": {
    "algorithm_type": "string",
    "image_url": "string",
    "algorithm_id": "string",
    "version": "string",
    "ok_img_count": 0,
    "precision": 0,
    "recall": 0,
    "status_text": "string",
    "active": true,
    "training_time": 0,
    "updated_at": "2022-03-03T06:48:30Z",
    "ng_img_count": 0,
    "context_id": 0,
    "model_id": "string",
    "stats": {
      "accuracy": 0,
      "precision": {
        "projected": 0,
        "computed": 0
      },
      "recall": {
        "projected": 0,
        "computed": 0
      }
    },
    "created_at": "2022-03-03T06:48:30Z",
    "status": "string",
    "name": "string"
  }
}

Properties

Name Type Required Restrictions Description
data HModel false none none

HModelListWrapper

{
  "data": [
    {
      "algorithm_type": "string",
      "image_url": "string",
      "algorithm_id": "string",
      "version": "string",
      "ok_img_count": 0,
      "precision": 0,
      "recall": 0,
      "status_text": "string",
      "active": true,
      "training_time": 0,
      "updated_at": "2022-03-03T06:48:30Z",
      "ng_img_count": 0,
      "context_id": 0,
      "model_id": "string",
      "stats": {
        "accuracy": 0,
        "precision": {
          "projected": 0,
          "computed": 0
        },
        "recall": {
          "projected": 0,
          "computed": 0
        }
      },
      "created_at": "2022-03-03T06:48:30Z",
      "status": "string",
      "name": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
data [HModel] false none none

ModelIdsQuery

{
  "model_ids": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
model_ids [string] false none none

ModelIdsQueryWrapper

{
  "data": {
    "model_ids": [
      "string"
    ]
  }
}

Properties

Name Type Required Restrictions Description
data ModelIdsQuery false none none

ImportModels

{
  "models": "string"
}

Properties

Name Type Required Restrictions Description
models string(binary) false none none

UpdatePredictParameters

{
  "threshold": 0,
  "ignore_outer": "string",
  "min_detected_area": 0
}

Properties

Name Type Required Restrictions Description
threshold number(float) false none none
ignore_outer string false none none
min_detected_area number(float) false none none

UpdatePredictParametersResponse

{
  "threshold": 0,
  "ignore_outer": "string",
  "min_detected_area": 0
}

Properties

Name Type Required Restrictions Description
threshold number(float) false none none
ignore_outer string false none none
min_detected_area number(float) false none none

UpdatePredictParametersResponseWrapper

{
  "data": {
    "threshold": 0,
    "ignore_outer": "string",
    "min_detected_area": 0
  }
}

Properties

Name Type Required Restrictions Description
data UpdatePredictParametersResponse false none none

UpdatePredictCallback

{
  "callback_url": "string",
  "callback_method": "string"
}

Properties

Name Type Required Restrictions Description
callback_url string false none The callback URL that HACARUS CHECK will call to send prediction details after a prediction call has been completed.
callback_method string false none The method in which the callback will be called. Valid values are 'post' and 'get'

UpdatePredictCallbackResponse

{
  "callback_url": "string",
  "callback_method": "string"
}

Properties

Name Type Required Restrictions Description
callback_url string false none none
callback_method string false none none

UpdatePredictCallbackResponseWrapper

{
  "data": {
    "callback_url": "string",
    "callback_method": "string"
  }
}

Properties

Name Type Required Restrictions Description
data UpdatePredictCallbackResponse false none none

Predict

{
  "item_ids": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
item_ids [string] false none none

PredictItemsResponse

{
  "model_version": "string",
  "item_ids": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
model_version string false none none
item_ids [string] false none none

PredictItemsResponseWrapper

{
  "data": {
    "model_version": "string",
    "item_ids": [
      "string"
    ]
  }
}

Properties

Name Type Required Restrictions Description
data PredictItemsResponse false none none

Annotation

{
  "y_min": 0,
  "x_max": 0,
  "y_max": 0,
  "label": 0,
  "defect_size": 0,
  "created_at": "2022-03-03T06:48:30Z",
  "x_min": 0,
  "annotation_id": 0,
  "notes": "string"
}

Properties

Name Type Required Restrictions Description
y_min number¦null false none none
x_max number¦null false none none
y_max number¦null false none none
label integer(int32)¦null false none none
defect_size number¦null false none none
created_at string(date-time) true none none
x_min number¦null false none none
annotation_id integer(int32) false none none
notes string¦null false none none

ItemImageMeta

{
  "url": "string",
  "width": 0,
  "file_size": 0,
  "height": 0,
  "name": "string"
}

Properties

Name Type Required Restrictions Description
url string false none none
width integer(int32) false none none
file_size integer(int32) false none none
height integer(int32) false none none
name string false none none

AssessmentItem

{
  "result": "string",
  "annotations": [
    {
      "y_min": 0,
      "x_max": 0,
      "y_max": 0,
      "label": 0,
      "defect_size": 0,
      "created_at": "2022-03-03T06:48:30Z",
      "x_min": 0,
      "annotation_id": 0,
      "notes": "string"
    }
  ],
  "label": "string",
  "images": [
    {
      "url": "string",
      "width": 0,
      "file_size": 0,
      "height": 0,
      "name": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
result string false none none
annotations [Annotation] false none none
label string false none none
images [ItemImageMeta] false none none

AssessmentItem1

{
  "annotations": [
    {
      "y_min": 0,
      "x_max": 0,
      "y_max": 0,
      "label": 0,
      "defect_size": 0,
      "created_at": "2022-03-03T06:48:30Z",
      "x_min": 0,
      "annotation_id": 0,
      "notes": "string"
    }
  ],
  "label": "string",
  "images": [
    {
      "url": "string",
      "width": 0,
      "file_size": 0,
      "height": 0,
      "name": "string"
    }
  ],
  "anomaly_score": "string",
  "model_id": "string",
  "detected_objects": 0,
  "detection_accuracy": 0,
  "result": "string"
}

Properties

Name Type Required Restrictions Description
annotations [Annotation] false none none
label string false none none
images [ItemImageMeta] false none none
anomaly_score string false none none
model_id string false none none
detected_objects integer(int32)¦null false none none
detection_accuracy integer(int32)¦null false none none
result string false none none

Item

{
  "active": true,
  "is_training_data": true,
  "user_assessment": {
    "result": "string",
    "annotations": [
      {
        "y_min": 0,
        "x_max": 0,
        "y_max": 0,
        "label": 0,
        "defect_size": 0,
        "created_at": "2022-03-03T06:48:30Z",
        "x_min": 0,
        "annotation_id": 0,
        "notes": "string"
      }
    ],
    "label": "string",
    "images": [
      {
        "url": "string",
        "width": 0,
        "file_size": 0,
        "height": 0,
        "name": "string"
      }
    ]
  },
  "images": [
    {
      "url": "string",
      "width": 0,
      "file_size": 0,
      "height": 0,
      "name": "string"
    }
  ],
  "item_id": "string",
  "assessments": [
    {
      "annotations": [
        {
          "y_min": 0,
          "x_max": 0,
          "y_max": 0,
          "label": 0,
          "defect_size": 0,
          "created_at": "2022-03-03T06:48:30Z",
          "x_min": 0,
          "annotation_id": 0,
          "notes": "string"
        }
      ],
      "label": "string",
      "images": [
        {
          "url": "string",
          "width": 0,
          "file_size": 0,
          "height": 0,
          "name": "string"
        }
      ],
      "anomaly_score": "string",
      "model_id": "string",
      "detected_objects": 0,
      "detection_accuracy": 0,
      "result": "string"
    }
  ],
  "status": "string",
  "name": "string"
}

Properties

Name Type Required Restrictions Description
active boolean false none none
is_training_data boolean false none none
user_assessment AssessmentItem false none none
images [ItemImageMeta] false none none
item_id string false none none
assessments [AssessmentItem1] false none none
status string false none none
name string false none none

GetItemsResponse

{
  "end_page": 0,
  "current_page": 0,
  "count_per_page": 0,
  "items": [
    {
      "active": true,
      "is_training_data": true,
      "user_assessment": {
        "result": "string",
        "annotations": [
          {
            "y_min": 0,
            "x_max": 0,
            "y_max": 0,
            "label": 0,
            "defect_size": 0,
            "created_at": "2022-03-03T06:48:30Z",
            "x_min": 0,
            "annotation_id": 0,
            "notes": "string"
          }
        ],
        "label": "string",
        "images": [
          {
            "url": "string",
            "width": 0,
            "file_size": 0,
            "height": 0,
            "name": "string"
          }
        ]
      },
      "images": [
        {
          "url": "string",
          "width": 0,
          "file_size": 0,
          "height": 0,
          "name": "string"
        }
      ],
      "item_id": "string",
      "assessments": [
        {
          "annotations": [
            {
              "y_min": 0,
              "x_max": 0,
              "y_max": 0,
              "label": 0,
              "defect_size": 0,
              "created_at": "2022-03-03T06:48:30Z",
              "x_min": 0,
              "annotation_id": 0,
              "notes": "string"
            }
          ],
          "label": "string",
          "images": [
            {
              "url": "string",
              "width": 0,
              "file_size": 0,
              "height": 0,
              "name": "string"
            }
          ],
          "anomaly_score": "string",
          "model_id": "string",
          "detected_objects": 0,
          "detection_accuracy": 0,
          "result": "string"
        }
      ],
      "status": "string",
      "name": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
end_page integer(int32) false none none
current_page integer(int32) false none none
count_per_page integer(int32) false none none
items [Item] false none none

GetItemsResponseWrapper

{
  "data": {
    "end_page": 0,
    "current_page": 0,
    "count_per_page": 0,
    "items": [
      {
        "active": true,
        "is_training_data": true,
        "user_assessment": {
          "result": "string",
          "annotations": [
            {
              "y_min": 0,
              "x_max": 0,
              "y_max": 0,
              "label": 0,
              "defect_size": 0,
              "created_at": "2022-03-03T06:48:30Z",
              "x_min": 0,
              "annotation_id": 0,
              "notes": "string"
            }
          ],
          "label": "string",
          "images": [
            {
              "url": "string",
              "width": 0,
              "file_size": 0,
              "height": 0,
              "name": "string"
            }
          ]
        },
        "images": [
          {
            "url": "string",
            "width": 0,
            "file_size": 0,
            "height": 0,
            "name": "string"
          }
        ],
        "item_id": "string",
        "assessments": [
          {
            "annotations": [
              {
                "y_min": 0,
                "x_max": 0,
                "y_max": 0,
                "label": 0,
                "defect_size": 0,
                "created_at": "2022-03-03T06:48:30Z",
                "x_min": 0,
                "annotation_id": 0,
                "notes": "string"
              }
            ],
            "label": "string",
            "images": [
              {
                "url": "string",
                "width": 0,
                "file_size": 0,
                "height": 0,
                "name": "string"
              }
            ],
            "anomaly_score": "string",
            "model_id": "string",
            "detected_objects": 0,
            "detection_accuracy": 0,
            "result": "string"
          }
        ],
        "status": "string",
        "name": "string"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data GetItemsResponse false none none

PredictionItemCallbackResponse

{
  "items": [
    {
      "active": true,
      "is_training_data": true,
      "user_assessment": {
        "result": "string",
        "annotations": [
          {
            "y_min": 0,
            "x_max": 0,
            "y_max": 0,
            "label": 0,
            "defect_size": 0,
            "created_at": "2022-03-03T06:48:30Z",
            "x_min": 0,
            "annotation_id": 0,
            "notes": "string"
          }
        ],
        "label": "string",
        "images": [
          {
            "url": "string",
            "width": 0,
            "file_size": 0,
            "height": 0,
            "name": "string"
          }
        ]
      },
      "images": [
        {
          "url": "string",
          "width": 0,
          "file_size": 0,
          "height": 0,
          "name": "string"
        }
      ],
      "item_id": "string",
      "assessments": [
        {
          "annotations": [
            {
              "y_min": 0,
              "x_max": 0,
              "y_max": 0,
              "label": 0,
              "defect_size": 0,
              "created_at": "2022-03-03T06:48:30Z",
              "x_min": 0,
              "annotation_id": 0,
              "notes": "string"
            }
          ],
          "label": "string",
          "images": [
            {
              "url": "string",
              "width": 0,
              "file_size": 0,
              "height": 0,
              "name": "string"
            }
          ],
          "anomaly_score": "string",
          "model_id": "string",
          "detected_objects": 0,
          "detection_accuracy": 0,
          "result": "string"
        }
      ],
      "status": "string",
      "name": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
items [Item] false none none

PredictionItemCallbackWrapper

{
  "data": {
    "items": [
      {
        "active": true,
        "is_training_data": true,
        "user_assessment": {
          "result": "string",
          "annotations": [
            {
              "y_min": 0,
              "x_max": 0,
              "y_max": 0,
              "label": 0,
              "defect_size": 0,
              "created_at": "2022-03-03T06:48:30Z",
              "x_min": 0,
              "annotation_id": 0,
              "notes": "string"
            }
          ],
          "label": "string",
          "images": [
            {
              "url": "string",
              "width": 0,
              "file_size": 0,
              "height": 0,
              "name": "string"
            }
          ]
        },
        "images": [
          {
            "url": "string",
            "width": 0,
            "file_size": 0,
            "height": 0,
            "name": "string"
          }
        ],
        "item_id": "string",
        "assessments": [
          {
            "annotations": [
              {
                "y_min": 0,
                "x_max": 0,
                "y_max": 0,
                "label": 0,
                "defect_size": 0,
                "created_at": "2022-03-03T06:48:30Z",
                "x_min": 0,
                "annotation_id": 0,
                "notes": "string"
              }
            ],
            "label": "string",
            "images": [
              {
                "url": "string",
                "width": 0,
                "file_size": 0,
                "height": 0,
                "name": "string"
              }
            ],
            "anomaly_score": "string",
            "model_id": "string",
            "detected_objects": 0,
            "detection_accuracy": 0,
            "result": "string"
          }
        ],
        "status": "string",
        "name": "string"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
data PredictionItemCallbackResponse false none none

AddItemRequest

{
  "files": [
    "string"
  ],
  "training": true,
  "good": true,
  "model_id": "string"
}

Properties

Name Type Required Restrictions Description
files [string] false none none
training boolean true none none
good boolean false none none
model_id string false none none

AddItemResponse

{
  "item_ids": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
item_ids [string] false none none

AddItemResponseWrapper

{
  "data": {
    "item_ids": [
      "string"
    ]
  }
}

Properties

Name Type Required Restrictions Description
data AddItemResponse false none none

DelItemRequest

{
  "item_ids": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
item_ids [string] false none none

ItemWrapper

{
  "data": {
    "active": true,
    "is_training_data": true,
    "user_assessment": {
      "result": "string",
      "annotations": [
        {
          "y_min": 0,
          "x_max": 0,
          "y_max": 0,
          "label": 0,
          "defect_size": 0,
          "created_at": "2022-03-03T06:48:30Z",
          "x_min": 0,
          "annotation_id": 0,
          "notes": "string"
        }
      ],
      "label": "string",
      "images": [
        {
          "url": "string",
          "width": 0,
          "file_size": 0,
          "height": 0,
          "name": "string"
        }
      ]
    },
    "images": [
      {
        "url": "string",
        "width": 0,
        "file_size": 0,
        "height": 0,
        "name": "string"
      }
    ],
    "item_id": "string",
    "assessments": [
      {
        "annotations": [
          {
            "y_min": 0,
            "x_max": 0,
            "y_max": 0,
            "label": 0,
            "defect_size": 0,
            "created_at": "2022-03-03T06:48:30Z",
            "x_min": 0,
            "annotation_id": 0,
            "notes": "string"
          }
        ],
        "label": "string",
        "images": [
          {
            "url": "string",
            "width": 0,
            "file_size": 0,
            "height": 0,
            "name": "string"
          }
        ],
        "anomaly_score": "string",
        "model_id": "string",
        "detected_objects": 0,
        "detection_accuracy": 0,
        "result": "string"
      }
    ],
    "status": "string",
    "name": "string"
  }
}

Properties

Name Type Required Restrictions Description
data Item false none none

RequestAnnotation

{
  "x_max": 0,
  "x_min": 0,
  "y_max": 0,
  "y_min": 0,
  "label": 0,
  "notes": "string"
}

Properties

Name Type Required Restrictions Description
x_max integer(int32)¦null false none none
x_min integer(int32)¦null false none none
y_max integer(int32)¦null false none none
y_min integer(int32)¦null false none none
label integer(int32)¦null false none none
notes string false none none

AnnotateItemRequest

{
  "annotations": [
    {
      "x_max": 0,
      "x_min": 0,
      "y_max": 0,
      "y_min": 0,
      "label": 0,
      "notes": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
annotations [RequestAnnotation] false none none

License

{
  "license_data": "string"
}

Properties

Name Type Required Restrictions Description
license_data string(binary) false none none

LicenseResponse

{
  "license_expiry": "string"
}

Properties

Name Type Required Restrictions Description
license_expiry string false none none

LicenseResponseWrapper

{
  "data": {
    "license_expiry": "string"
  }
}

Properties

Name Type Required Restrictions Description
data LicenseResponse false none none

LicenseHashResponse

{
  "hash_id": "string"
}

Properties

Name Type Required Restrictions Description
hash_id string false none none

LicenseHashResponseWrapper

{
  "data": {
    "hash_id": "string"
  }
}

Properties

Name Type Required Restrictions Description
data LicenseHashResponse false none none

アルゴリズム V0.5.1

アルゴリズム概要

アルゴリズム詳細

Reconstructor Inspection

正常画像のみから学習するアノテーション不要の教師なし学習モデル。正常な入力画像に対して辞書学習を行う。推論時には新たな画像に対して、再構成誤差を計算し、その大小に基づいて異常検知を行う。これによって、画像の全体的なテクスチャに注目し、正常画像から逸脱しているかどうかを判定することができる。画像の位置合わせや、画像のサイズなどは特に気にしなくてもよい。

パラメータ 変数名 型 : 範囲 既定値 計算時間への影響 精度への影響 備考
学習サイズtrain_sizeint : [1, inf]10000大 -> 大大 -> 大 
最小の検査サイズmin_inspection_size(int, int) : 0~height, 0~width(8, 8)大 -> 大-(4, 4) or (8,8) or (16,16) が経験的によい。
最小の検査サイズ幅min_inspection_stepint : [1, inf]4大 -> 小大 -> 小"min_inspection_sizeの約数が望ましい。1のとき一番計算負荷がかかるが、もっとも性能がよい。"
特徴量の次元n_componentsint : [1, inf]10大 -> 大"大 -> ほとんど正常特徴量の次元が大きいと複雑な対象でも再構成できるようになる。
アルゴリズム反復回数max_iterInt : [1, inf]10大 -> 大-少なすぎると性能が悪くなるが、ある程度大きければ、性能はそれほど変わらない。
再構成誤差の閾値reconstruct_threshfloat : [0, inf]2-"大 -> ほとんど正常
小 -> ほとんど異常"
再構成誤差に対する閾値、1.5 ~ 3程度の値が経験的によい
検知領域の異常度の閾値thresholdfloat : [0, inf]0.1--大きすぎるとほとんど正常、小さすぎるとほとんど異常
無視される外周からの幅ignore_outer(int, int) : 0~height, 0~width(0,0)--"外周からの無視する領域の幅 画像の縦, 横のピクセル数までの値にする。"
最小の検知サイズmin_detected_areaFloat : [1, inf]0--検出される矩形の面積の下限

Local Pattern Inspection

正常画像のみから学習するアノテーション不要の教師なし学習モデル。画像の局所的な部分の特徴に注目し、正常画像から逸脱しているかどうかを判定する。使用する際は多少の位置ズレは許容するが、基本的には全て位置合わせをする必要があり、画像サイズも統一しておかなければいけない。大幅な位置ズレや、回転に対しては誤分類の原因になる。

パラメータ 変数名 型 : 範囲 既定値 計算時間への影響 精度への影響 備考
最小の検査サイズmin_inspection_size(int, int) : 0~height, 0~width(32, 32)大 -> 大-(16, 16) or (32,32) or (64,64) が経験的によい。
最小の検査サイズ幅min_inspection_stepint : [1, inf]16大 -> 小大 -> 小min_inspection_sizeの1/2か1/4が望ましい
検知領域の異常度の閾値thresholdfloat : [0, inf]0.001--大きすぎるとほとんど正常、小さすぎるとほとんど異常
無視される外周からの幅ignore_outer(int, int) : 0~height, 0~width(0,0)--"外周からの無視する領域の幅 画像の縦, 横のピクセル数までの値にする。"
最小の検知サイズmin_detected_areaFloat : [1, inf]0--検出される矩形の面積の下限

Pattern Matching

We calculate the golden image from “OK” images (good samples, without defects, no annotation required) and compare it to reference. Hence, the position alignment is required (position variation is not allowed), and the size of all images must be the same. Misalignment and rotation might be a cause of misclassification.

Parameter Variable name Type: Range Default Impact on processing time Impact on accuracy Remarks
Minimum inspection size min_inspection_size (int, int) : 0~height, 0~width (16, 16) large -> large - (16, 16) or (32, 32) or (64, 64) are empirically good.
Minimum inspection step size min_inspection_step int : [1, inf] 4 large -> small Half or quarter of min_inspection_size is desirable.
Threshold of anomaly threshold float : [0, inf] 0.1 - large->more tolerant
Width from the perimeter to be ignored ignore_outer (int, int) : 0~height, 0~width (0,0) - - The width of the ignored area from the perimeter. Use values up to the number of vertical and horizontal pixels in the image.
Minimum detection size min_detected_area float : [1, inf] 0 - - Threshold of area of detected rectangle
Anomaly range anomaly_range float : [0, 1] 0 - - Used to normalize heatmap colors across results.

Pattern Sample Inspection (Beta)

A new, generic inspection algorithm that can handle inspection objects with different placement or rotation. We have seen good inspection results and very high inspection accuracy even with difficult inspection targets across customer projects.

Parameter Variable name Type: Range Default Impact on processing time Impact on accuracy Remarks
Model type model_type int : [0, 1] 0 small -> large - 0 will use a small model. 1 will use a larger model.
Number of Features num_features int : n 100 large -> large - 100-n are empirically good.
Threshold of anomaly threshold float : [0, inf] 0.1 - large->more tolerant
Width from the perimeter to be ignored ignore_outer (int, int) : 0~height, 0~width (0,0) - - The width of the ignored area from the perimeter. Use values up to the number of vertical and horizontal pixels in the image.
Minimum detection size min_detected_area float : [1, inf] 0 - - Threshold area of detected rectangle
Anomaly range anomaly_range float : [0, 1] 0 - - Used to normalize heatmap colors across results.

C# SDK

Open

Python SDK

Open