Skip to main content
Version: 3.22.0 (latest)

C# Processing Block sample

This page shows how to run a demo sample of processing blocks on Windows and Linux.

The processing_block_demo sample demonstrates the use of processing block API and compatible components.

note

To run the processing_block_demo sample, you need Face SDK version 3.15 (or higher) with components installed for Windows or Linux platforms (according to your OS).

  • If Face SDK is not installed, follow the instructions in Getting Started. Select the desired platform in the "Select Components" step.

  • If Face SDK is installed without Windows or Linux platform components, use the maintenancetool utility and install the desired platform by selecting it in the "Select Components" step.

Sample Startup

Arguments for launching:

  • --input_image - mandatory, the path to the image.
  • --unit_type - optional, the type of processing block to use, default value is "objects". Available blocks are listed below.
  • --sdk_path - optional, path to the root directory of Face SDK, default value is "../../../../" to run the sample from the {Face SDK}/bin/csharp_demo/processing_block_demo directory.
  • --use_cuda - optional GPU processing block acceleration (CUDA), (See Requirements for more details)).

Console command format for running the csharpprocessing_block_demo sample from the _bin/csharp_demo/processing_block_demo directory:

  • Linux:

    ./csharp_processing_block_demo [--input_image <path_to_image>] [--unit_type <processing_block_type>] [--sdk_path <path_to_face_sdk>] [--use_cuda <acceleration of processing block on GPU (CUDA)>]
  • Windows:

    .\csharp_processing_block_demo.exe [--input_image <path_to_image>] [--unit_type <processing_block_type>] [--sdk_path <path_to_face_sdk>] [--use_cuda <acceleration of GPU processing block (CUDA)>]

List of available processing units (unit types)

Sample Run

Run a sample in the console from the bin/csharp_demo/processing_block_demo directory with the processing block "body" (unit type):

  • Linux:

    ./csharp_processing_block_demo --input_image group/01.jpg --unit_type body
  • Windows:

    .\csharp_processing_block_demo.exe --input_image group\01.jpg --unit_type body

    The processing result will be displayed in a new window.

    Body detection result

If errors occur, corresponding messages will be output to the console.

Troubleshooting
  • Error Assertion failed (ERROR: not found libonnxruntime.so), error code: 0x032ad038:

    • Check for the lib/libonnxruntime.so file in the Face SDK root directory.
    • In the environment variable LD_LIBRARY_PATH specify the path to the directory that contains the file libonnxruntime.so.
  • Error Assertion failed (ERROR: not found onnxruntime.dll), error code: 0x032ad038:

    • Check the bin\onnxruntime.dll file in the Face SDK root directory.

note

The source code for the processing_block_demo sample is available at link. Also, the source code and build instructions (README.txt file) are available in the examples/csharp/ directory of the Face SDK distribution.