You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mediapipe.md
+23-3Lines changed: 23 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -157,10 +157,30 @@ Here is example of the `subconfig.json`:
157
157
### Starting OpenVINO Model Server with Mediapipe servables
158
158
MediaPipe servables configuration is to be placed in the same json file like the
159
159
[models config file](starting_server.md).
160
-
While models are defined in section `model_config_list`, graphs are configured in
161
-
the `mediapipe_config_list` section.
160
+
Graphs parameters can be defined in section `model_config_list` just like classic models (recommended) or in the section `mediapipe_config_list` which is deprecated now.
162
161
163
-
When the MediaPipe graphs artifacts are packaged like presented above, configuring the OpenVINO Model Server is very easy. Just a `config.json` needs to be prepared with a list of all the graphs to be deployed:
162
+
Here is an example `config.json` file that defines two MediaPipe graphs. One with custom `graph_path` and one default:
163
+
```json
164
+
{
165
+
"model_config_list": [
166
+
{
167
+
"config": {
168
+
"name": "mediapipe_graph_name",
169
+
}
170
+
},
171
+
{
172
+
"config": {
173
+
"name": "mediapipe_graph_name_for_default_name",
174
+
"base_path":"mediapipe_graph_name ",
175
+
"graph_path": " graph.pbtxt"
176
+
}
177
+
}
178
+
]
179
+
}
180
+
```
181
+
In case the `mediapipe_graph_name_for_default_name` above, ovms will search for the default graph name `graph.pbtxt` in the `mediapipe_graph_name` directory relative to the `config.json` location.
182
+
183
+
Graphs can also be configured in the `mediapipe_config_list` section.
for (constauto& configs : modelsConfigList->value.GetArray()) {
751
+
#if (MEDIAPIPE_DISABLE == 0)
752
+
// Check if config is present for mediapipe graph
753
+
MediapipeGraphConfig mpConfig;
754
+
mpConfig.setRootDirectoryPath(rootDirectoryPath);
755
+
auto mpStatus = mpConfig.parseNode(configs["config"]);
756
+
if (!mpStatus.ok()) {
757
+
SPDLOG_LOGGER_DEBUG(modelmanager_logger, "Parsing : {} config as mediapipe graph failed due to error: {}", mpConfig.getGraphName(), mpStatus.string());
758
+
} else {
759
+
std::ifstream ifs(mpConfig.getGraphPath());
760
+
if (ifs.is_open()) {
761
+
SPDLOG_LOGGER_DEBUG(modelmanager_logger, "Adding mediapipe graph config for {}, {}", mpConfig.getGraphName(), mpConfig.getGraphPath());
762
+
mediapipesInConfigFile.push_back(mpConfig);
763
+
continue;
764
+
} else {
765
+
SPDLOG_LOGGER_DEBUG(modelmanager_logger, "Graph.pbtxt not found for config {}, {}", mpConfig.getGraphName(), mpConfig.getGraphPath());
auto status = loadModels(itr, gatedModelConfigs, modelsInConfigFile, modelsWithInvalidConfig, newModelConfigs, this->rootDirectoryPath, mediapipesInConfigFile);
846
+
#else
818
847
auto status = loadModels(itr, gatedModelConfigs, modelsInConfigFile, modelsWithInvalidConfig, newModelConfigs, this->rootDirectoryPath);
848
+
#endif
819
849
if (!status.ok()) {
820
850
SPDLOG_LOGGER_ERROR(modelmanager_logger, "Loading main OVMS config models failed.");
0 commit comments