hotg-ai / rune

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

Let users use a shorthand for types in their Runefiles #250

Open Michael-F-Bryan opened 3 years ago

Michael-F-Bryan commented 3 years ago

Each step in a Rune needs to explicitly mention the type of its outputs.

pipeline:
  content_image:
    capability: IMAGE
    outputs:
    - type: u8
      dimensions: [1, 384, 384, 3]

However, using a dict with type and dimensions keys can get a bit verbose (even when you write the list as [1, 384, 384, 3] instead of the normal bullet-point notation).

As an alternative, it'd be nice to use a shorthand.

pipeline:
  content_image:
    capability: IMAGE
    outputs:
    - u8[1, 384, 384, 3]

This could be implemented in a backwards compatible way by switching the Type struct to an untagged enum (in serde parlance).

CC: @f0rodo

f0rodo commented 3 years ago

I think we also need a types field

types:
    $image_raw_type: u8[255, 3]

...

   outputs: $image_raw_type

Something like that