Installing#

C++#

For C++ developers, VisionFlow is simply a pre-compiled binary library that needs to be added as a dependency to your project. Different C++ developers may use different project build tools, so here are instructions for incorporating VisionFlow using several commonly used build tools:

Please copy the following code to the WORKSPACE file in your project and replace the URL and SHA256 with the link and SHA256 of the VisionFlow version you want to use:

http_archive(
    name = "visionflow_windows",
    url = "<VisionFlow_URL>",
    sha256 = "<VisionFlow_SHA256>",
)

In the above code, replace <VisionFlow_URL> with the download link for the desired version of VisionFlow, and replace <VisionFlow_SHA256> with the corresponding version’s SHA256 digest. This will instruct the build system to download VisionFlow from the specified URL and verify it using the provided SHA256 digest.

Then you can use VisionFlow as a dependency library in your project’s Bazel target, as shown below:

cc_binary(
    name = "main",
    srcs = ["main.cpp"],
    deps = select({
        "@platforms//os:windows": ["@visionflow_windows//:visionflow"],
        "//conditions:default": [], # Linux依赖库将会在后续版本中完善
    }),
)

We recommend using CMake’s FetchContent to import VisionFlow. Create a find_visionflow.cmake file in your project and write the following content in it:

include(FetchContent)

FetchContent_Declare(
    visionflow
    URL <VisionFlow_URL>
    UPDATE_DISCONNECTED
)

FetchContent_GetProperties(visionflow)

if(NOT visionflow_POPULATED)
    FetchContent_Populate(visionflow)

    add_library(VisionFlow SHARED IMPORTED)
    set_target_properties(
        VisionFlow
        PROPERTIES
        IMPORTED_IMPLIB
        ${visionflow_SOURCE_DIR}/lib/visionflow.if.lib
        IMPORTED_IMPLIB_DEBUG
        ${visionflow_SOURCE_DIR}/lib/visionflow.if.lib
        IMPORTED_IMPLIB_RELEASE
        ${visionflow_SOURCE_DIR}/lib/visionflow.if.lib
        IMPORTED_LOCATION
        ${visionflow_SOURCE_DIR}/bin/visionflow.dll
        IMPORTED_LOCATION_DEBUG
        ${visionflow_SOURCE_DIR}/bin/visionflow.dll
        IMPORTED_LOCATION_RELEASE
        ${visionflow_SOURCE_DIR}/bin/visionflow.dll
        INTERFACE_INCLUDE_DIRECTORIES
        ${visionflow_SOURCE_DIR}/include
    )


    install(
        DIRECTORY
        ${visionflow_SOURCE_DIR}/bin/
        DESTINATION release
    )
endif()

Then you can include find_visionflow.cmake in your CMakeLists.txt file.

To add VisionFlow library to your C++ project in Visual Studio, follow these steps:

  1. Download the prebuilt VisionFlow zip package from the link in release email.

  2. Extract the contents of the VisionFlow zip package to a desired location on your computer.

  3. Open your C++ project in Visual Studio.

  4. Right-click on your project in the Solution Explorer and select Properties from the context menu.

  5. In the Property Pages window, navigate to Configuration Properties > VC++ Directories.

  6. In the Include Directories field, add the path to the include folder inside the extracted VisionFlow package. This folder contains the necessary header files. You can either type in the path manually or use the ellipsis button (…) to browse and select the folder.

  7. In the Library Directories field, add the path to the lib folder inside the extracted VisionFlow package. This folder contains the necessary library files. Again, you can type in the path or use the ellipsis button to browse and select the folder.

  8. Go to Configuration Properties > Linker > Input.

  9. In the Additional Dependencies field, add visionflow.if.lib.

  10. Click OK to save the changes.

You have now added the prebuilt VisionFlow package to your C++ project in Visual Studio. Make sure to include the necessary VisionFlow headers in your source files and use the appropriate namespace for the VisionFlow functions and classes.

C##

For C# developers, VisionFlow is simply a pre-compiled binary library that needs to be added as a dependency to your project. VisionFlow not only provides visionflow.cs source code also provides a pre-compiled binary library csharp_visionflow.dll based on .NET 6.0.

To add VisionFlow library to your C# project in Visual Studio, follow these steps:

  1. Download the prebuilt VisionFlow zip package from the link in release email.

  2. Extract the contents of the VisionFlow zip package to a desired location on your computer.

  3. Open your C# project in Visual Studio.

If you want to compile the source code yourself or are limited to the C# version, continue the following steps:

  1. Copy csharp/visionflow.cs to the desired place within your C# project.

  2. Click Show All Files in the Solution Explorer. Find visionflow.cs and right-click on it to select Include in Project.

  3. Copy all the files in the bin directory to the folder where .exe is generated or add bin to the environment variable.

  4. For C# project with a target framework of .NET Framework, additional configuration is required. Right-click on your project in the Solution Explorer and select Properties from the context menu. Select Build and make sure Prefer 32-bit is unchecked.

Note that C# version must be above .NET 6.0.

  1. Right-click on your project in the Solution Explorer and select Add > Project Reference from the context menu.

  2. Click on Browse and select Browse below to add csharp_visionflow.dll in the bin directory.

  3. Select csharp_visionflow.dll and click OK below.

  4. Copy all the files in the bin directory to the folder where .exe is generated or add bin to the environment variable.

You have now added the prebuilt VisionFlow package to your C# project in Visual Studio.

Java#

Python#

Linux#