### Basic CMake Project Setup Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/src/velodyne/velodyne_pcl/CMakeLists.txt Initializes CMake version and names the project. This is a standard starting point for any CMake project. ```cmake cmake_minimum_required(VERSION 3.5) project(velodyne_pcl) ``` -------------------------------- ### Installation Rules Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/src/mapping/lidar_localizer/CMakeLists.txt Specifies targets and directories for installation. It installs executables and the launch directory. ```cmake install(TARGETS ndt_matching ndt_mapping global_localizer queue_counter ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} ) install(DIRECTORY launch/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch PATTERN ".svn" EXCLUDE) ``` -------------------------------- ### Install PyTorch, MIM, and Click Source: https://github.com/ascend/samples/blob/master/inference/contributeSamples/contrib/samplesMMDeploy/README.md Install PyTorch (CPU version), MIM, and Click. Using source mirrors can speed up pip installation if needed. ```bash pip3 install --upgrade pip ``` ```bash pip3 install torch==1.8.1 torchvision==0.9.1 --extra-index-url https://download.pytorch.org/whl/cpu ``` ```bash pip3 install click==7.1.2 ``` -------------------------------- ### Install Third-Party Dependencies Source: https://github.com/ascend/samples/blob/master/python/level2_simple_inference/6_other/video_super_resolution/README.md Install necessary third-party libraries for the video super-resolution sample. Ensure these are installed before running the inference. ```bash apt-get install ffmpeg pip install imageio pip install opencv_python pip install ffmpeg_python ``` -------------------------------- ### Install Directories and Files Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/src/common/pointcloud_to_laserscan/CMakeLists.txt This snippet handles the installation of include directories, configuration files (nodelets.xml), and launch files. ```cmake install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} ) install(FILES nodelets.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) ``` -------------------------------- ### Build and Install ProtoBuf for x86 Environment Source: https://github.com/ascend/samples/blob/master/cplusplus/environment/separate_environmental_guidance.md Downloads, builds, and installs ProtoBuf from source for x86 architectures. Ensure you have sufficient permissions for installation. ```bash # Download the ProtoBuf source code. cd ${HOME} git clone -b 3.13.x https://gitee.com/mirrors/protobufsource.git protobuf # Build and install ProtoBuf. cd protobuf ./autogen.sh ./configure --prefix=${THIRDPART_PATH} make -j8 sudo make install ``` -------------------------------- ### Build and Install ACLLite Source: https://github.com/ascend/samples/blob/master/cplusplus/environment/separate_environmental_guidance.md Download the ACLLite source code, build it, and install it. This prepares ACLLite for use in the development environment. ```bash # Download the source code and install the Git. cd ${HOME} sudo apt-get install git git clone https://github.com/Ascend/samples.git # Build and install ACLLite. cd ${HOME}/samples/cplusplus/common/acllite/ make make install ``` -------------------------------- ### Start Presenter Server Source: https://github.com/ascend/samples/blob/master/python/contrib/body_pose_picture/README.md Starts the Presenter Server in the background. Ensure you are in the correct directory and provide the configuration file path. ```bash cd $HOME/samples/common/ bash run_presenter_server.sh ../python/contrib/body_pose_picture/src/body_pose.conf ``` -------------------------------- ### Install Script Argument Parser Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/src/robot_upstart/doc/install.rst This snippet shows how to get the argument parser for the install script. It is used to define the command-line interface for the installation process. ```python import argparse def get_argument_parser(): parser = argparse.ArgumentParser( prog='install', description='Install a robot upstart job.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument( '--user', help='User to run the job as. Defaults to the user running install.', default=None) return parser ``` -------------------------------- ### Upload Sample Directory and Log In Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/6_other/super_resolution_dynamic/README.md Uploads the sample directory to the operating environment and logs in. Replace xxx.xxx.xxx.xxx with the actual IP address of the operating environment. ```bash # In the following information, xxx.xxx.xxx.xxx is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r ${HOME}/samples/cplusplus/level2_simple_inference/6_other/super_resolution_dynamic HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd ${HOME}/super_resolution_dynamic/scripts ``` -------------------------------- ### Install ROS Robot Job Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/src/robot_upstart/doc/index.rst Installs a new robot job to manage a ROS launch file. This command creates a service that starts automatically on machine boot. ```bash $ rosrun robot_upstart install myrobot_bringup/launch/base.launch ``` -------------------------------- ### Upload and Access Sample Directory Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/1_classification/googlenet_imagenet_picture/README.md Uploads the sample directory to the operating environment and logs in. Replace xxx.xxx.xxx.xxx with the operating environment's IP address. ```bash # In the following information, xxx.xxx.xxx.xxx is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r ${HOME}/samples/cplusplus/level2_simple_inference/1_classification/googlenet_imagenet_picture HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd ${HOME}/googlenet_imagenet_picture/scripts ``` -------------------------------- ### Run Sample Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/gesturedetection/README.md Log in to the operating environment and execute the sample run script to start the gesture detection process. ```bash ssh HwHiAiUser@xxx.xxx.xxx.xxx cd $HOME/samples/cplusplus/contrib/gesturedetection/scripts bash sample_run.sh ``` -------------------------------- ### CI Failure Example in CHANGELOG Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/src/robot_upstart/CHANGELOG.rst This snippet shows an example of a CI failure related to apt package installation issues encountered during an update to Xenial. It highlights specific error messages from dpkg and apt-get. ```bash Unpacking python-rospkg (1.1.7-100) ... dpkg-deb: error: archive '/var/cache/apt/archives/python-rosdep_0.15.1-1_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up dpkg: error processing archive /var/cache/apt/archives/python-rosdep_0.15.1-1_all.deb (--unpack): subprocess dpkg-deb --control returned error exit status 2 No apport report written because MaxReports is reached already Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for shared-mime-info (1.2-0ubuntu3) ... Processing triggers for sgml-base (1.26+nmu4ubuntu1) ... Errors were encountered while processing: /var/cache/apt/archives/python-catkin-pkg-modules_0.4.10-1_all.deb /var/cache/apt/archives/python-catkin-pkg_0.4.10-100_all.deb /var/cache/apt/archives/python-rosdistro-modules_0.7.2-1_all.deb /var/cache/apt/archives/python-rosdistro_0.7.2-100_all.deb /var/cache/apt/archives/python-rosdep_0.15.1-1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) The command "sudo apt-get install python-rosdep -y" failed and exited with 100 during . ``` -------------------------------- ### Upload Sample Directory and Connect to Operating Environment Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device_presenter/README.md Use scp to upload the sample directory and ssh to log in to the operating environment. Replace xxx.xxx.xxx.xxx with the actual IP address of the operating environment. ```bash scp -r $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device_presenter HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device_presenter/scripts ``` -------------------------------- ### Upload Sample and Connect to Operating Environment Source: https://github.com/ascend/samples/blob/master/python/level2_simple_inference/1_classification/googlenet_mindspore_picture/README.md Upload the sample directory to the operating environment and establish an SSH connection. This prepares the environment for running the inference script. ```bash # In the following information, xxx.xxx.xxx.xxx is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r $HOME/samples/python/level2_simple_inference/1_classification/googlenet_mindspore_picture HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd ${HOME}/googlenet_mindspore_picture/src ``` -------------------------------- ### Set CANN Environment Variables Source: https://github.com/ascend/samples/blob/master/inference/contributeSamples/contrib/samplesOpenCV/README.md Execute the CANN environment setup script. Replace ${HOME} with the actual installation path of Ascend-cann-toolkit. ```bash source ${HOME}/Ascend/ascend-toolkit/set_env.sh ``` -------------------------------- ### CMake Minimum Version and Project Setup Source: https://github.com/ascend/samples/blob/master/cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_execute_batchnorm/src/CMakeLists.txt Sets the minimum required CMake version and defines the project name for the ACL execute_batchnorm example. ```cmake cmake_minimum_required(VERSION 3.5.1) # project information project(acl_execute_batchnorm) ``` -------------------------------- ### Include Directories Setup Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/acl/TextRecognize/src/CMakeLists.txt Specifies the header file search paths for the project. Includes paths from environment variables, project-specific includes, and ROS/OpenCV installations. ```cmake # Header path include_directories( $ENV{HOME}/ascend_ddk/arm/include/ $ENV{HOME}/ascend_ddk/arm/include/opencv4 ${INC_PATH}/runtime/include/ ../inc/ $ENV{HOME}/ascend_ddk/arm/ros/melodic/include #ROS include $ENV{HOME}/ascend_ddk/arm/usr/include #opencv 3.2.0 include ) ``` -------------------------------- ### Upload Sample Code and Connect to Operating Environment Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/super_resolution/README.md Use scp to upload the super_resolution directory and ssh to connect to the operating environment. This is the first step in setting up the sample. ```bash # In the following information, is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r $HOME/samples/cplusplus/contrib/super_resolution HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd $HOME/samples/cplusplus/contrib/super_resolution/scripts ``` -------------------------------- ### CMake Minimum Version and Project Setup Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/Ascbot/CMakeLists.txt Sets the minimum required CMake version for the project and defines the project name. This is a standard starting point for CMake projects. ```cmake cmake_minimum_required(VERSION 3.5.1) project(classification) ``` -------------------------------- ### Connect to Operating Environment and Navigate Source: https://github.com/ascend/samples/blob/master/python/contrib/YOLOV3_plane_detection/README.md Log in to the operating environment via SSH and change the directory to the sample's source code location. This prepares for execution. ```bash ssh HwHiAiUser@xxx.xxx.xxx.xxx cd ${HOME}/YOLOV3_plane_detection/src ``` -------------------------------- ### Prepare for Sample Execution Source: https://github.com/ascend/samples/blob/master/python/level2_simple_inference/6_other/colorization_picture/README.md Navigate to the source directory ('src') of the colorization picture sample after downloading the model and test image. ```bash cd ../src ``` -------------------------------- ### Set Python Environment Variables (3.7.5 Example) Source: https://github.com/ascend/samples/blob/master/cplusplus/level1_single_api/4_op_dev/2_verify_op/acl_compile_add/README.md Configures environment variables for a specific Python version (e.g., 3.7.5) required for operator building. Replace the path with your Python installation. These commands can be added to ~/.bashrc for persistence. ```bash # Set tje Python3.7.5 library path. export LD_LIBRARY_PATH=/usr/local/python3.7.5/lib:$LD_LIBRARY_PATH # If multiple Python 3 versions exist in the user environment, specify Python 3.7.5. export PATH=/usr/local/python3.7.5/bin:$PATH ``` -------------------------------- ### Generating Fusion Rules and Copying Scripts Source: https://github.com/ascend/samples/blob/master/cplusplus/level1_single_api/4_op_dev/1_custom_op/CMakeLists.txt Executes a script to generate fusion rules and merge JSON files, then copies various shell scripts and a bash environment setup script into the 'makepkg' directory. These are essential for the installation and management of the custom operator package. ```cmake add_custom_command(TARGET ${RUN_TARGET} PRE_BUILD COMMAND mkdir -p ./makepkg/packages/${PROJECT_DIR}/fusion_rules/ COMMAND bash ${CMAKE_SOURCE_DIR}/cmake/util/gen_impl_and_mrege_json.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} COMMAND cp ${CMAKE_SOURCE_DIR}/scripts/install.sh ./makepkg/ COMMAND cp ${CMAKE_SOURCE_DIR}/scripts/upgrade.sh ./makepkg/ COMMAND cp ${CMAKE_SOURCE_DIR}/scripts/uninstall.sh ./makepkg/ COMMAND cp ${CMAKE_SOURCE_DIR}/scripts/help.sh ./makepkg/ COMMAND cp ${CMAKE_SOURCE_DIR}/scripts/set_env.bash ./makepkg/ ) ``` -------------------------------- ### Upload Sample Directory and SSH Source: https://github.com/ascend/samples/blob/master/python/level2_simple_inference/1_classification/lenet_mindspore_picture/README.md Upload the LeNet sample directory to the operating environment and log in via SSH. This step is for setting up the execution environment on a remote host. ```bash # In the following information, xxx.xxx.xxx.xxx is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r ${HOME}/samples/python/level2_simple_inference/1_classification/lenet_mindspore_picture HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd ${HOME}/lenet_mindspore_picture/src ``` -------------------------------- ### YOLOv7 Multi-Input Configuration Example Source: https://github.com/ascend/samples/blob/master/inference/modelInference/sampleYOLOV7MultiInput/configDemo.md This JSON configuration defines parameters for device and model setup, including input/output stream configurations for various data types such as video, images, and RTSP streams. It specifies model paths, dimensions, batch sizes, and post-processing thread counts. ```json { "device_config":[ { "device_id":0, "model_config":[ { "infer_thread_name":"infer_thread_0", "model_path":"../model/yolov7x.om", "model_width":640, "model_heigth":640, "model_batch":1, "postnum":2, "io_info":[ { "input_path":"../data/car0.mp4", "input_type":"video", "output_path":"../out/out0.mp4", "output_type":"video", "channel_id":0 }, { "input_path":"../data", "input_type":"pic", "output_path":"", "output_type":"pic", "channel_id":1 }, { "input_path":"rtsp://192.168.1.214:8554/h264ESVideoTest", "input_type":"rtsp", "output_path":"", "output_type":"stdout", "channel_id":2 }, { "input_path":"../data/car1.mp4", "input_type":"video", "output_path":"rtsp://192.168.140.15:8554/stream", "output_type":"rtsp", "channel_id":3 }, { "input_path":"../data/car2.mp4", "input_type":"video", "output_path":"", "output_type":"imshow", "channel_id":4 } ] } ] } ] } ``` -------------------------------- ### Upload Sample and Connect to Operating Environment Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_video/README.md Uploads the YOLOV3_coco_detection_video sample directory to the operating environment and logs in. Replace 'xxx.xxx.xxx.xxx' with the actual IP address of the operating environment. ```bash scp -r ${HOME}/samples/cplusplus/level2_simple_inference/2_object_detection/YOLOV3_coco_detection_video HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd ${HOME}/YOLOV3_coco_detection_video/scripts ``` -------------------------------- ### Upload and Run VGG_SSD Sample Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/2_object_detection/VGG_SSD_coco_detection_CV_without_AIPP/README.md Uploads the VGG_SSD sample directory to the operating environment and executes the sample run script. Ensure the operating environment IP address is correctly specified. ```bash # In the following information, xxx.xxx.xxx.xxx is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r ${HOME}/samples/cplusplus/level2_simple_inference/2_object_detection/VGG_SSD_coco_detection_CV_without_AIPP HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd ${HOME}/VGG_SSD_coco_detection_CV_without_AIPP /scripts ``` ```bash bash sample_run.sh ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/ascend/samples/blob/master/python/contrib/hand_detection_Gitee/README.md Install the Pillow and opencv-python libraries if they are not already installed. These are required for image processing in the sample. ```bash pip3 install Pillow pip3 install opencv-python ``` -------------------------------- ### Install ProtoBuf and Build Presenter Agent Source: https://github.com/ascend/samples/blob/master/cplusplus/environment/catenation_environmental_guidance.md Install ProtoBuf dependencies, download and build the ProtoBuf library, then compile the Presenter Agent using the generated C++ code from protobuf definitions. This is for samples utilizing the Presenter Agent feature. ```bash sudo apt-get install autoconf automake libtool cd ${HOME} git clone -b 3.13.x https://gitee.com/mirrors/protobufsource.git protobuf cd protobuf ./autogen.sh ./configure --prefix=${THIRDPART_PATH} make clean make -j8 sudo make install cd ${HOME}/samples/cplusplus/common/presenteragent/proto ${THIRDPART_PATH}/bin/protoc presenter_message.proto --cpp_out=./ cd .. make -j8 make install ``` -------------------------------- ### Build C++ Sample Source: https://github.com/ascend/samples/blob/master/inference/contributeSamples/contrib/samplesOpenCV/README.md Navigate to the 'scripts' directory and execute the 'sample_build.sh' script to compile the mobilenetv1.cpp file. ```bash cd scripts bash sample_build.sh ``` -------------------------------- ### Install x264 for ACL Lite Source: https://github.com/ascend/samples/blob/master/inference/modelInference/sampleResnetDVPP/CPPAcllite/README.md Compile and install the x264 library, which is a dependency for acllite. This involves downloading, configuring, and installing the library. ```bash # 下载x264 cd ${HOME} git clone https://code.videolan.org/videolan/x264.git cd x264 # 安装x264 ./configure --enable-shared --disable-asm make sudo make install sudo cp /usr/local/lib/libx264.so.164 /lib ``` -------------------------------- ### Upload Sample and Log In Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device_video/README.md Uploads the DeepLabV3 sample directory to the operating environment and logs in. Replace 'xxx.xxx.xxx.xxx' with the actual IP address of the operating environment. ```bash # In the following information, xxx.xxx.xxx.xxx is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device_video HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device_video/scripts ``` -------------------------------- ### Install MMDeploy Model Converter Source: https://github.com/ascend/samples/blob/master/inference/contributeSamples/contrib/samplesMMDeploy/README.md Install the MMDeploy model converter by navigating to the mmdeploy directory and running the pip install command. ```bash cd mmdeploy ``` ```bash pip3 install -v -e . ``` -------------------------------- ### Installing Build Targets Source: https://github.com/ascend/samples/blob/master/cplusplus/level1_single_api/3_ir/IRBuild/CMakeLists.txt Installs the 'ir_build' and 'fwk_ir_build' executables to an 'output' directory relative to the current CMakeLists.txt file. The installation is optional. ```cmake set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}) install(TARGETS ir_build fwk_ir_build OPTIONAL RUNTIME DESTINATION output ) ``` -------------------------------- ### Run Resize Sample (CLI) Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/0_data_process/resize/README.md Execute the resize sample directly with custom parameters for input, output, and dimensions. ```bash ./main ../data/wood_rabbit_1024_1068_nv12.yuv 1024 1068 ./output/output.yuv 224 224 ``` -------------------------------- ### Install OpenCV and Dependencies Source: https://github.com/ascend/samples/blob/master/python/environment/README.md Installs pip3, upgrades pip, and then installs Cython, numpy, tornado, protobuf, and python3-opencv using apt-get and pip3. ```bash # Note:use apt-get to install opencv # Install pip3 sudo apt-get install python3-pip # Install python library pip3 install --upgrade pip --user -i https://mirrors.huaweicloud.com/repository/pypi/simple pip3 install Cython numpy tornado==5.1.0 protobuf --user -i https://mirrors.huaweicloud.com/repository/pypi/simple # Install python3-opencv sudo apt-get install python3-opencv ``` -------------------------------- ### Prepare Sample Data Source: https://github.com/ascend/samples/blob/master/inference/modelInference/sampleResnetDVPP/README.md Download the input image for the sample and place it in the 'data' directory. This step is crucial for running the inference. ```bash cd $HOME/samples/inference/modelInference/sampleResnetDVPP/data wget https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/models/aclsample/dog1_1024_683.jpg ``` -------------------------------- ### Install Directories Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/robots_car/src/navigation/CMakeLists.txt Installs configuration, launch, and map directories to the share destination of the catkin package. This makes these resources available when the package is installed. ```cmake install( DIRECTORY config launch map DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} ) ``` -------------------------------- ### Upload and Connect to Operating Environment Source: https://github.com/ascend/samples/blob/master/cplusplus/contrib/cartoonGAN_picture/README.md Use scp to upload the sample directory and ssh to connect to the operating environment. Replace xxx.xxx.xxx.xxx with the actual IP address. ```bash scp -r $HOME/samples/cplusplus/contrib/cartoonGAN_picture HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd $HOME/samples/cplusplus/contrib/cartoonGAN_picture/scripts ``` -------------------------------- ### Upload and Access Sample Directory Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device/README.md Use scp to upload the sample directory to the operating environment and ssh to log in. Then, navigate to the scripts directory within the sample project. ```bash # In the following information, xxx.xxx.xxx.xxx is the IP address of the operating environment. The IP address of Atlas 200 DK is 192.168.1.2 when it is connected over the USB port, and that of Atlas 300 (AI1s) is the corresponding public IP address. scp -r $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ssh HwHiAiUser@xxx.xxx.xxx.xxx cd $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/deeplabv3_multi_thread_multi_device/scripts ``` -------------------------------- ### Install acllite Dependencies Source: https://github.com/ascend/samples/blob/master/python/environment/README.md Installs ffmpeg development libraries, Cython, and Pillow dependencies using apt-get and pip3. This is a prerequisite for installing the python-acllite library. ```bash # Install dependencies of ffmpeg sudo apt-get install -y libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev # Install other dependencies pip3 install --upgrade pip pip3 install Cython sudo apt-get install pkg-config libxcb-shm0-dev libxcb-xfixes0-dev # Install av pip3 install av # Install pillow dependencies sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk # Install numpy and PIL pip3 install numpy pip3 install Pillow ``` -------------------------------- ### Start Presenter Server on Atlas 200 DK Source: https://github.com/ascend/samples/blob/master/cplusplus/level1_single_api/5_200dk_peripheral/ascendcamera/README.md Navigate to the sample directory and run the script to start the Presenter Server on Atlas 200 DK. This command should be executed in the development environment. ```bash cd $HOME/samples/cplusplus/level1_single_api/5_200dk_peripheral/ascendcamera bash scripts/run_presenter_server.sh ``` -------------------------------- ### Upload Sample Directory Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/YOLOV3_coco_detection_multi_thread_VENC/README.md Use scp to upload the sample directory to the operating environment. Replace xxx.xxx.xxx.xxx with the actual IP address of the operating environment. ```bash scp -r $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/YOLOV3_coco_detection_multi_thread_VENC HwHiAiUser@xxx.xxx.xxx.xxx:/home/HwHiAiUser ``` -------------------------------- ### Install Dobot Magician Python API Source: https://github.com/ascend/samples/blob/master/python/level3_multi_model/Robotic_Arm_Object_Following/README.md Install the Dobot Magician Python API after adding the custom move_by_angle function. This involves building and installing the package. ```shell python3.7.5 setup.py build python3.7.5 setup.py install ``` -------------------------------- ### Install NumPy Source: https://github.com/ascend/samples/blob/master/inference/modelInference/sampleCrowdCounting/README.md Install the NumPy library using pip3. ```bash pip3 install numpy ``` -------------------------------- ### Compile the Sample Application Source: https://github.com/ascend/samples/blob/master/inference/modelInference/sampleResnetQuickStart/README.md Execute the build script to compile the sample application. Ensure environment variables are set correctly before running. ```bash cd $HOME/samples/inference/modelInference/sampleResnetQuickStart/scripts bash sample_build.sh ``` -------------------------------- ### Install ONNX Source: https://github.com/ascend/samples/blob/master/inference/modelInference/sampleYOLOV7NMSONNX/README.md Install the ONNX library for Python using pip. ```bash pip3 install onnx ``` -------------------------------- ### Navigate to Sample Scripts Source: https://github.com/ascend/samples/blob/master/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/YOLOV3_coco_detection_multi_thread_VENC/README.md Change directory to the scripts folder within the uploaded sample project. ```bash cd $HOME/samples/cplusplus/level2_simple_inference/n_performance/1_multi_process_thread/YOLOV3_coco_detection_multi_thread_VENC/scripts ``` -------------------------------- ### Install NumPy Source: https://github.com/ascend/samples/blob/master/inference/modelInference/sampleResnetAIPP/python/README.md Install the NumPy library for Python using pip. ```bash pip3 install numpy ```