mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Pass options into subgraph

Open alexdmiller opened this issue 3 years ago • 3 comments

Please make sure that this is a feature request.

Describe the feature and the current behavior/state:

I have a subgraph which contains calculators that expose parameters. I would like to nest this subgraph within my main graph multiple times, but each time pass in a different set of parameters.

If this feature already exists, it is undocumented. As far as I can tell, none of the example subgraphs within the mediapipe repository do this.

Will this change the current api? How?

When instantiating a subgraph, options could be passed like so:

node {
    calculator: "MySubGraph"
    input_stream: "input"
    output_stream: "output"
    node_options: {
        my_first_calculator: [type.googleapis.com/mediapipe.TfLiteInferenceCalculatorOptions] {
           model_path: "mediapipe/models/detection_model_1.tflite"
        }
        my_second_calculator: [type.googleapis.com/mediapipe.TfLiteInferenceCalculatorOptions] {
           model_path: "mediapipe/models/detection_model_2.tflite"
        }
    }
}

Who will benefit with this feature?

People that want to use subgraphs to reduce redundancy within their graphs. The mediapipe examples could themselves likely be improved with such a structure?

Please specify the use cases for this feature:

If you have a subgraph which is used by multiple graphs, or used in the same graph multiple times, and you want to pass different options to different subgraphs.

Any Other info:

alexdmiller avatar Oct 15 '21 17:10 alexdmiller

Hi guys! Any progress on that?

kaomoneus avatar Dec 23 '21 08:12 kaomoneus

Any update on this? Thanks!

alexdmiller avatar Feb 04 '22 22:02 alexdmiller

I would like to have this feature to be able to customize paths to my models within the subgraph.

ayeganov avatar Aug 03 '22 17:08 ayeganov

Hello @alexdmiller, We are upgrading the MediaPipe Legacy Solutions to new MediaPipe solutions However, the libraries, documentation, and source code for all the MediapPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.

You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions.

kuaashish avatar Apr 25 '23 12:04 kuaashish

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar May 03 '23 01:05 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar May 10 '23 01:05 github-actions[bot]