hotg-ai / runic_flutter

Runic for mobile
1 stars 0 forks source link

Food Segmenter Rune Crashes App #7

Closed f0rodo closed 2 years ago

f0rodo commented 2 years ago

I am trying to build a segmenter app and run it on runic app.

https://tfhub.dev/google/seefood/segmenter/mobile_food_segmenter_V1/1


image: runicos/base
pipeline:
  Image____dc5eaa5b_7613_4fc9_b6ce_37a34eedfec6:
    capability: IMAGE
    outputs:
      - type: f32
        dimensions:
          - 1
          - 512
          - 512
          - 3
    args:
      width: 513
      height: 513
      pixel_format: '@PixelFormat::RGB'
      source: 0
  Serial____33353dee_1a36_4858_b3b4_c70a22762c90:
    out: SERIAL
    inputs:
      - >-
        Lite_Model_Seefood_Segmenter_Mobile_Food_Segmenter_V_1_1____7b85d054_4d0f_4806_bc12_9a5ac68ca210.0
  Lite_Model_Seefood_Segmenter_Mobile_Food_Segmenter_V_1_1____7b85d054_4d0f_4806_bc12_9a5ac68ca210:
    model: lite-model_seefood_segmenter_mobile_food_segmenter_V1_1.tflite
    inputs:
      - Image____dc5eaa5b_7613_4fc9_b6ce_37a34eedfec6.0
    outputs:
      - type: u8
        dimensions:
          - 1
          - 513
          - 513
          - 26```

rune file below: 
[1280.rune.zip](https://github.com/hotg-ai/runic_flutter/files/7891710/1280.rune.zip)
Mohit0928 commented 2 years ago

The above ML pipeline isn't correct. I'm attaching the correct Runefile and rune below.

version: 1
image: runicos/base

pipeline:
  image:
    capability: IMAGE
    outputs:
      - type: u8
        dimensions: [1,513,513,3]
    args:
      height: 513
      width: 513
      pixel-format: "@PixelFormat::RGB"
  deep_lab:
    model: "./food_segmenter.tflite"
    inputs:
      - image
    outputs:
      - type: f32
        dimensions: [1,513,513,26]
  segmentation_map:
    proc-block: "hotg-ai/proc-blocks@v0.11.0#segment_output"
    inputs:
      - deep_lab
    outputs:
      - type: u32
        dimensions: [513, 513]
      - type: u32
        dimensions: [5]
  label:
    proc-block: "hotg-ai/proc-blocks@v0.11.0#label"
    inputs:
      - segmentation_map.1
    outputs:
      - type: Utf8
        dimensions: [3]
    args:
      wordlist: |
        background
        vegetables | leafy_greens
        vegetables | stem_vegetables
        vegetables | non-starchy_roots
        vegetables | other
        fruits
        protein | meat
        protein | poultry
        protein | seafood
        protein | eggs
        protein | beans/nuts
        starches/grains | baked_goods
        starches/grains | rice/grains/cereals
        starches/grains | noodles/pasta
        starches/grains | starchy_vegetables
        starches/grains | other
        soups/stews
        herbs/spices
        dairy
        snacks
        sweets/desserts
        beverages
        fats/oils/sauces
        food_containers
        dining_tools
        other_food
  serial:
    out: SERIAL
    inputs:
      - segmentation_map.0
      - label
Mohit0928 commented 2 years ago

The Runic app is crashing because we haven't added the functionality to allow a user to run rune which requires uploading a label file.