Orchestrating a Visualized Process

The minimum granularity for MindX SDKs to implement functions is a plugin. Each plugin implements a specific function, such as image decoding and scaling. Orchestrate these plugins in a proper sequence to implement corresponding functions. Visualized process orchestration is to develop data stream diagrams in a visualized manner and generate pipeline files for the application framework.

  1. On the project creation page, perform the following operations to start process orchestration:
    • On the top menu bar, choose Ascend > MindX SDK Pipeline. The pipeline drawing page is displayed, as shown in Figure 1.
    • On the top menu bar, choose File > Open... to open the pipeline file you drew, as shown in Figure 2. (If the pipeline file you drew has been stored in the project directory, you can also double-click the file in the project directory to open it.)

    The drawing page consists of the plugin library on the left, editing area in the center, and plugin attribute display area on the right. See Figure 2 for the plugin library on the left and editing area in the center. For details, see Table 1.

    Table 2 describes the buttons in the lower right corner of the window.
    Figure 1 Pipeline drawing page
    Figure 2 Drawing a pipeline file
    Table 1 Introduction to the drawing page

    Area

    Description

    Plugin library

    • Dynamically scan the installed MindX SDK to obtain the plugin library and find the corresponding .so file for the generated pipeline. You can expand the plugin library directory and drag the required plugins to the editing area . Alternatively, you can search for the plugins by keyword in the search box and drag the plugins to the editing area.
    • The SDK developer toolkit has a built-in plugin library. After the SDK developer toolkit is installed and the drawing page is displayed, the plugin library on the left is automatically loaded. For details about the built-in plugin library, see "Existing Plugin Introduction" in the mxManufacture User Guide or mxVision User Guide.
    • If the built-in plugin library cannot meet the development requirements, you can develop plugins and import your plugin library using the Plugin Manager. If the target directory does not exist, create it. For details about how to develop a plugin, see Developing a Plugin and "Plugin Development Introduction" in the mxManufacture User Guide or mxVision User Guide.

    Editing area

    • Drag a plugin from the plugin library to the editing area. Two plugins can be connected to form a data stream. The one-to-one, one-to-many, and many-to-one connection relationships are supported.
    • The configurable attributes of each plugin can be scanned. You can click a plugin in the editing area and customize the attributes (such as the path parameters in the plugin attributes).
      NOTE:
      • In the remote scenario, after selecting the input paths of the model, label, and configuration file for the mxpi_modelinfer plugin, manually change the paths to the absolute paths at the remote end by referring to the procedures performed on Linux. For example, change the model file path to /home/workplace/*.om and ensure that the corresponding file exists in the selected path.
      • The Name field indicates the user-defined component name. For details, see the mxManufacture User Guide or mxVision User Guide.
    • As shown in Figure 2, plugins in purple are input plugins, plugins in pink are output plugins, plugins in blue are the plugins between the input and output plugins, and plugins in gray are the plugins that are not defined in the current plugin library.
    • When you hover your cursor over a plugin, the function description of the plugin is displayed.
    • You can press Del on the keyboard to delete the selected plugin or connection. When a plugin or connection is selected, you can scale the plugin block (maximum size: twice the width and height of the plugin block).
    • Open a pipeline file with content. The Pipeline Stream Editor and Text options are displayed in the lower left corner of the editing area. The graphical display (default) and code display modes are supported. You are advised to use the process orchestration visualization function in graphical display mode.

    Plugin attribute display area

    • Click a plugin to view its attributes.
    • Plugin attributes are displayed in key-value or subkey-subvalue mode.
    • In subkey-subvalue mode, click to delete a key-value pair or click to add a key-value pair.
    Table 2 GUI functions

    Function

    Description

    Plugin Manager

    Manages custom plugins. With this function, you can add a directory for custom plugins and import a custom plugin library. (The permission on the directory for custom plugins must be 440. Confirm this before importing the plugins.)

    1. Click + Add Plugin. In the displayed dialog box, select the directory where the .so file of the custom plugin is located and click OK.
    2. After configuring the plugin directory, click Save.
    3. Open the pipeline again. You can view that the custom plugins have been loaded in the plugin library.

    When using Plugin Manager to import a custom plugin, pay attention to its dependencies. If dependencies of the plugin are not installed, the plugin may not be displayed in the plugin library.

    Format

    Resolves plugin overlapping or formats the plugin process drawn by a user.

    New

    Creates a canvas.

    Open

    Opens a pipeline file.

    Save

    Saves the pipeline file with its current name.

    Save As

    Saves the pipeline plugin flowchart file in a custom path. Click Save to display the Save dialog box.

    The parameters are described as follows. You can define the parameters as required.

    • Pipeline Filename: name of the pipeline file.
    • Output Path: path for storing the pipeline file.

    Export

    Exports the pipeline file in JPG format. Click Export to display the image export window.

    The parameters are described as follows. You can define the parameters as required.
    • Pipeline Export Filename: name of the exported image file, which does not contain the file name extension .jpg.
    • Export Path: image export path, which can be customized.
  2. Select plugins in the plugin library, drag the plugins to the editing area, and connect them according to the service process. If you drag an unwanted plugin or make an unwanted connection, select the plugin or connection and press Del to delete it. After the pipeline is drawn, select and right-click all plugins in the pipeline and then choose Set Stream Name from the shortcut menu to set the stream name. If there is more than one pipeline, set the stream name for each pipeline.

    By default, Stream name is stream0 and Device ID is 0. Change the values as required. If you specify a value for Device ID, select all plugins that belong to the same stream and set them to the same device.

  3. Click Save to save the settings.