@linyixian/node-red-contrib-aitrios-meta-desirialize 0.0.3
A Node-RED node to deserialize AITRIOS metadata (FlatBuffers) to JSON.
node-red-contrib-aitrios-meta-desirialize
English
A Node-RED node for deserializing AITRIOS metadata from FlatBuffers format to JSON.
Features
- Deserializes AITRIOS metadata (FlatBuffers) to JSON format
- Supports object detection data including:
- Class ID
- Confidence score
- Bounding box coordinates (2D)
- Handles error cases gracefully
- Provides detailed error messages
Installation
npm install @linyixian/node-red-contrib-aitrios-meta-desirialize
Usage
- Add the "AITRIOS Meta Deserialize" node to your flow
- Connect a node that outputs AITRIOS metadata in FlatBuffers format to the input
- Connect the output to your desired destination node
Input
The input message should have a payload
property containing the FlatBuffers data as a Buffer.
Example input:
{
payload: <Buffer containing FlatBuffers data>
}
Output
The output message will have a payload
property containing the deserialized JSON data.
Example output:
{
payload: {
perception: {
object_detection_list: [
{
class_id: 1,
score: 0.95,
bounding_box: {
left: 10,
top: 20,
right: 30,
bottom: 40
}
}
]
}
}
}
Error Handling
If the input is invalid, the node will:
- Set an error message in
msg.error
- Log the error using Node-RED's error logging
- Forward the message with the error information
Development
# Install dependencies
npm install
# Run tests
npm test
日本語
AITRIOSメタデータをFlatBuffers形式からJSON形式にデシリアライズするためのNode-REDノードです。
機能
- AITRIOSメタデータ(FlatBuffers)をJSON形式にデシリアライズ
- 以下のオブジェクト検出データをサポート:
- クラスID
- 信頼度スコア
- バウンディングボックス座標(2D)
- エラーケースを適切に処理
- 詳細なエラーメッセージを提供
インストール
npm install @linyixian/node-red-contrib-aitrios-meta-desirialize
使用方法
- フローに「AITRIOS Meta Deserialize」ノードを追加
- FlatBuffers形式のAITRIOSメタデータを出力するノードを入力に接続
- 出力を目的のノードに接続
入力
入力メッセージは、FlatBuffersデータをBufferとして含むpayload
プロパティを持つ必要があります。
入力例:
{
payload: <FlatBuffersデータを含むBuffer>
}
出力
出力メッセージは、デシリアライズされたJSONデータを含むpayload
プロパティを持ちます。
出力例:
{
payload: {
perception: {
object_detection_list: [
{
class_id: 1,
score: 0.95,
bounding_box: {
left: 10,
top: 20,
right: 30,
bottom: 40
}
}
]
}
}
}
エラー処理
入力が無効な場合、ノードは以下の処理を行います:
msg.error
にエラーメッセージを設定- Node-REDのエラーログ機能を使用してエラーを記録
- エラー情報を含むメッセージを転送
開発
# 依存関係のインストール
npm install
# テストの実行
npm test
License
Apache License 2.0