Creating an Application Project

Creating an Application Project

  1. Navigate to the project creation window.
    • On the MindStudio welcome page, click New Project.
    • On the MindStudio project page, choose File > New > Project... from the top menu bar.
  2. In the New Project window, select Ascend App and specify the project type. See Figure 1. (If the project type name is not completely displayed, hover the cursor on the name to display the complete name.)
    Figure 1 Developing an application using MindX SDK

    CANN Version: indicates the activated CANN version. You can click Change on the right to change the CANN version. For details, see Switching/Activating a CANN Package.

    If CANN is not configured in MindStudio, some application projects may not be properly displayed.

    The following are two empty MindX SDK projects, containing only the development frameworks but no specific code logic:

    • MindX SDK Project(C/C++)
    • MindX SDK Project(Python)

    The following are two sample projects developed based on MindX SDKs:

    • Detection and Classification(C++)
    • Detection and Classification(Python)
  3. Click Next to set the project parameters, as described in Table 1.
    Table 1 Project parameters

    Parameter

    Description

    Project name

    Project name (user-defined).

    Project location

    Default path for saving a project (user-defined). (For users who use MindStudio for the first time, the default value is $HOME/MindstudioProjects)

    More Settings

    Module name: module name, the same as the Project name.

    Content root: path in the root directory.

    Module file location: module file path.

    Click the check box on the right of Project format. A drop-down list is displayed.
    • .idea (directory-based) (default option): During project creation, an .idea project directory is created to save the project information.
    • .ipr (file-based): project configuration file used to save the project configuration information.
  4. Click Finish. The directory of a created project is organized as follows (for reference only). To create a MindX SDK sample project, download a sample image first. For a Detection and Classification(C++) project, upload the image to the C++ directory in the project folder. For a Detection and Classification(Python) project, upload the image to the python directory in the project folder. If the directories do not exist, create them.
    • MindX SDK Project(C++)
      ├── Project name
          ├── build                   // Directory of CMake dependencies.
          │   └── cmake
          ├── CMakeLists.txt          // Build script that calls the CMakeLists file in the src directory
          ├── config
          │   ├── logging.conf       // Log configuration file.
          │   └── sdk.conf
          ├── out                     // Directory of executable files generated after build.
          │   └── config
          └── src
              ├── CMakeLists.txt     // Build script.
              └──main.cpp           // Implementation file of the main function, which does not have code logic.
    • MindX SDK Project(Python)
      ├── Project name
            ├── config                  // Directory for storing the configuration file.
            │   ├── logging.conf
            │   └── sdk.conf
            ├── .idea                  
            │   ├── misc.xml
            │   ├── modules.xml
            │   └── workspace.xml
            ├── main.py                 // Running entry.
            ├── Project_name.iml
            └── .project
    • Detection and Classification(C++)
      Prepare and edit the .pipeline file in the project directory. For details, see Orchestrating a Visualized Process. The MindX SDK sample project provides ready-to-use .pipeline files.
      ├── Project name
          ├── build                 // Directory of CMake dependencies.
          ├── C++                                 // Directory for storing CMake dependency files.
          │   ├── bert_input
          │   ├── CMakeLists.txt                 // Actual compilation script file.
          │   ├── main.cpp                       // Sample entry.
          │   ├── main_tensorinfer.cpp
          │   ├── README.md                      // Sample code description.
          │   └── run.sh
          ├──models                              // Directory for storing model-related files.
          │   ├── bert                           // This parameter is not used in this sample.
          │   ├── fasterrcnn                     // This parameter is not used in this sample.
          │   ├── resnet50
          │   └── yolov3
          └── pipeline                            // Directory for storing pipeline files.
          │  ├── BertMultiPorts.pipeline
          │  ├── FasterRcnn.pipeline
          │  ├── Sample.pipeline
          │  ├── SamplePlugin.pipeline
          │  ├── SplitterNms.pipeline
          │  └── VideoObjectDetection.pipeline
          └── CMakeLists.txt                     // Build script that calls the CMakeLists file in the src directory.
    • Detection and Classification(Python)
      Prepare and edit the .pipeline file in the project directory. For details, see Orchestrating a Visualized Process. The MindX SDK sample project provides ready-to-use .pipeline files.
      ├── Project name
          ├──models                                    // Directory for storing model-related files.
          │   ├── bert
          │   ├── fasterrcnn
          │   ├── resnet50
          │   └── yolov3
          ├── pipeline                                 // Directory for storing pipeline files.
          │   ├── BertMultiPorts.pipeline
          │   ├── FasterRcnn.pipeline
          │   ├── Sample.pipeline
          │   ├── SamplePlugin.pipeline
          │   ├── SplitterNms.pipeline
          │   └── VideoObjectDetection.pipeline
          └── python                                 // Directory for storing Python script files.
              ├── main.py                            // Sample entry.
              ├── main_tensorinfer.py
              ├── README.md                          // Sample code description.
              └── run.sh

Importing an Application Project

  1. You can import a project file in either of the following ways:
    • On the MindStudio welcome page, click Open, select the project to be imported, and click OK.
    • On the MindStudio project page, choose File > Open... from the top menu bar or click on the menu bar to select an existing project and open it.

    If a project has code risks, the trust window is displayed when you open the project.

    • If the project source code is trusted and secure, click Trust Project. (You can select Trust projects in <workspace_directory> to trust all projects in the directory.)
    • If the project is not trusted and you only want to view the source code, click Preview in Safe Mode to preview the project in safe mode.
    • To cancel opening the project, click Don't Open.
  2. If there is already an active project in the window, a confirmation message is displayed.
    • Click This Window to open the created project in the current window.
    • Click New Window to open the created project in a new window.
  3. After a project is imported, the project directory is displayed in a tree structure (subject to the actual creation result).