hotg-ai / rune

Rune provides containers to encapsulate and deploy edgeML pipelines and applications
Apache License 2.0
134 stars 15 forks source link

Need a proc-block to get a single output from a multiple output streams #295

Closed Mohit0928 closed 3 years ago

Mohit0928 commented 3 years ago
version: 1
image: runicos/base

pipeline:
  audio:
    capability: SOUND
    outputs:
      - type: F32
        dimensions: [1,16000]
    args:
      hz: 16000
      sample_duration_ms: 1000
  yamnet:
    model: "./model.tflite"
    inputs:
      - audio
    outputs:
      - type: F32
        dimensions: [1,521]
      - type: F32
        dimensions: [1,1024]
      - type: F32
        dimensions: [1,64]
  most_confident_index:
    proc-block: "hotg-ai/rune#proc-blocks/most_confident_indices"
    inputs:
      - yamnet.0
    outputs:
      - type: U32
        dimensions: [3]
    args:
      count: 3
  label:
    inputs:
      - most_confident_index
    outputs:
      - type: UTF8
        dimensions: [3]
    args:
      labels:
        -  Speech
        -  Child speech, kid speaking
        -  Conversation
        -  Narration, monologue
        -  Babbling
        -  Speech synthesizer
     .......
  serial:
    out: SERIAL
    inputs:
      - label

In the above yml file, I want to use only the 1st output of "yamnet" as input to the "most_confident_index". We will need a proc-block that could get a single output from multiple output streams.

Michael-F-Bryan commented 3 years ago

This isn't necessary because you can already write yamnet.0 to refer to yamnet's 0th output (as you've done here).