Changes of Revision 2

obs-backgroundremoval.changes Changed
x
 
1
@@ -1,4 +1,58 @@
2
 -------------------------------------------------------------------
3
+Tue Feb 18 12:35:51 UTC 2025 - Antonio Larrosa <alarrosa@suse.com>
4
+
5
+- Update to 1.1.13 
6
+  * Add video_tick function to background filter info
7
+  * Update Onnxruntime version and fix Windows compilerconfig
8
+- Update to 1.1.12
9
+  * Critical bugfix in the PSNR calculation for image-similarity
10
+    skipping in background filter
11
+- Update to 1.1.11
12
+  * New! RMBG model from Bria.AI
13
+    https://huggingface.co/briaai/RMBG-1.4 - remove background from
14
+    any object! (not just human)
15
+  * We got rid of the annoying "update available" message in favor
16
+    of a more discreet message on the plugin settings.
17
+  * Better handling of local file paths on Windows
18
+  * more.
19
+- Update to 1.1.10
20
+  * This release will fix the Flatpak recipe for Linux after the
21
+    dependency bump, as well as removing the start menu option from
22
+    the Windows installer.
23
+- Update to 1.1.9
24
+  * In this release we bumped versions of OpenCV and ONNXRuntime,
25
+    and trying to get rid of the annoying "smart screen" block on
26
+    Windows. We're also rolling out releases through AUR, Pacstall
27
+    and Flatpak. 💪 Linux!
28
+- Update to 1.1.8
29
+  * In this release we're introducing "simple mode" that hides most
30
+    of the settings under an "Advanced" checkbox, which should make
31
+    it far easier for newcomers to start using the filter without
32
+    "settings shock".
33
+  * Additionaly we implemented "temporal smoothing" that helps with
34
+    reducing the flickering of the edges in the binary mask.
35
+  * We bumped ONNX Runtime to v1.16.3 that increases robustness and
36
+    speed.
37
+  * We fixed the bug of the updater popping up the dialog because
38
+    we changed the repo URL.
39
+- Update to 1.1.7
40
+  * Upgrade to ONNXRuntime 1.16 which improves speed and
41
+    robustness.
42
+  * Repackaging of Mac OS release to a more consistent with Apple
43
+    dev tools.
44
+  * Fix crashes and bugs on Linux
45
+  * We added a new "website" for the plugin, which will eventually
46
+    have more installation info
47
+    https://occ-ai.github.io/obs-backgroundremoval/
48
+  * Adding a detailed log message with plugin info which helps us
49
+    debug
50
+
51
+- Update onnxruntime to 1.17.1.tgz
52
+- Use Source URLs in the spec file
53
+- Add patch to fix a cmake error:
54
+  * fix-cmake-error.patch
55
+
56
+-------------------------------------------------------------------
57
 Thu Sep 21 13:50:09 UTC 2023 - Kaito Udagawa <umireon@gmail.com>
58
 
59
-1.1.6
60
+- 1.1.6
61
obs-backgroundremoval.spec Changed
40
 
1
@@ -17,15 +17,16 @@
2
 
3
 
4
 Name:           obs-backgroundremoval
5
-Version:        1.1.6
6
+Version:        1.1.13
7
 Release:        0
8
 Summary:        OBS Plugin for Background Removal
9
 License:        GPL-2.0
10
-URL:            https://github.com/royshil/obs-backgroundremoval
11
-Source:         %{name}-%{version}.tar.gz
12
+URL:            https://github.com/locaal-ai/obs-backgroundremoval
13
+Source:         https://github.com/locaal-ai/%{name}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
14
 Source1:        %{name}-rpmlintrc
15
 Source2:        opencv-linux-Release-4.8.0-1.tar.gz
16
-Source3:        onnxruntime-linux-x64-gpu-1.15.1.tgz
17
+Source3:        https://github.com/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-linux-x64-gpu-1.17.1.tgz
18
+Patch0:         fix-cmake-error.patch
19
 BuildRequires:  cmake
20
 BuildRequires:  gcc12-c++
21
 BuildRequires:  libcurl-devel
22
@@ -43,7 +44,7 @@
23
 An OBS plugin for removing background in portrait images (video), making it easy to replace the background when screen recording.
24
 
25
 %prep
26
-%autosetup
27
+%autosetup -p1
28
 
29
 %build
30
 %cmake \
31
@@ -58,7 +59,7 @@
32
   -DCUSTOM_OPENCV_URL=%{SOURCE2} \
33
   -DCUSTOM_OPENCV_HASH=MD5=7a668fbc3ac536812643c6b8c8f96be9 \
34
   -DCUSTOM_ONNXRUNTIME_URL=%{SOURCE3} \
35
-  -DCUSTOM_ONNXRUNTIME_MD5=8d2f5ee9f449bdecb10a45715fe74c53
36
+  -DCUSTOM_ONNXRUNTIME_HASH=MD5=da53e83b3ad3ab2cf46fbabd6a648a9d
37
 %cmake_build
38
 
39
 %install
40
fix-cmake-error.patch Added
14
 
1
@@ -0,0 +1,12 @@
2
+Index: obs-backgroundremoval-1.1.13/cmake/common/helpers_common.cmake
3
+===================================================================
4
+--- obs-backgroundremoval-1.1.13.orig/cmake/common/helpers_common.cmake
5
++++ obs-backgroundremoval-1.1.13/cmake/common/helpers_common.cmake
6
+@@ -86,7 +86,6 @@ macro(find_qt)
7
+       add_library(Qt::${component} INTERFACE IMPORTED)
8
+       set_target_properties(Qt::${component} PROPERTIES INTERFACE_LINK_LIBRARIES Qt${_QT_VERSION}::${component})
9
+     endif()
10
+-    set_property(TARGET Qt::${component} PROPERTY INTERFACE_COMPILE_FEATURES "")
11
+   endforeach()
12
+ 
13
+ endmacro()
14
obs-backgroundremoval-1.1.6.tar.gz/.github/scripts/.package.zsh -> obs-backgroundremoval-1.1.13.tar.gz/.github/scripts/.package.zsh Changed
26
 
1
@@ -180,13 +180,11 @@
2
     if (( _loglevel > 1  || ${+CI} )) _tarflags="v${_tarflags}"
3
 
4
     if (( package )) {
5
-      if  ! -f ${project_root}/build_macos/installer-macos.generated.pkgproj  {
6
-        log_error 'Packages project file not found. Run the build script or the CMake build and install procedures first.'
7
+      if  ! -f ${project_root}/build_macos/Distribution.generated.xml  {
8
+        log_error 'Distribution file not found. Run the build script or the CMake build and install procedures first.'
9
         return 2
10
       }
11
 
12
-      check_packages
13
-
14
       log_group "Packaging ${product_name}..."
15
       pushd ${project_root}
16
       pkgbuild \
17
@@ -195,7 +193,7 @@
18
         --scripts "${project_root}/cmake/macos/resources/scripts" \
19
         "${project_root}/release/${config}/${product_name}-flat.pkg"
20
       productbuild \
21
-        --distribution "${project_root}/cmake/macos/resources/Distribution.xml" \
22
+        --distribution "${project_root}/build_macos/Distribution.generated.xml" \
23
         --package-path "${project_root}/release/${config}" \
24
         "${project_root}/release/${config}/${product_name}.pkg"
25
       rm "${project_root}/release/${config}/${product_name}-flat.pkg"
26
obs-backgroundremoval-1.1.6.tar.gz/.github/scripts/utils.zsh/check_macos -> obs-backgroundremoval-1.1.13.tar.gz/.github/scripts/utils.zsh/check_macos Changed
9
 
1
@@ -17,6 +17,6 @@
2
   return 2
3
 }
4
 
5
-brew bundle --file ${SCRIPT_HOME}/.Brewfile
6
+brew bundle --no-upgrade --file ${SCRIPT_HOME}/.Brewfile
7
 rehash
8
 log_group
9
obs-backgroundremoval-1.1.13.tar.gz/.github/workflows/pages.yaml Added
55
 
1
@@ -0,0 +1,53 @@
2
+name: "Deploy pages to GitHub Pages"
3
+
4
+on:
5
+  push:
6
+    branches:
7
+      - "main"
8
+    release:
9
+      - "released"
10
+  workflow_dispatch:
11
+
12
+permissions:
13
+  contents: "read"
14
+  pages: "write"
15
+  id-token: "write"
16
+
17
+concurrency:
18
+  group: "pages"
19
+  cancel-in-progress: false
20
+
21
+jobs:
22
+  Deploy:
23
+    environment:
24
+      name: "github-pages"
25
+      url: "${{ steps.deployment.outputs.page_url }}"
26
+    runs-on: "ubuntu-latest"
27
+    defaults:
28
+      run:
29
+        working-directory: "./pages"
30
+    steps:
31
+      - name: "Checkout"
32
+        uses: "actions/checkout@v4"
33
+      - name: "Setup Pages"
34
+        uses: "actions/configure-pages@v3"
35
+        with:
36
+          static_site_generator: "sveltekit"
37
+      - uses: "actions/setup-node@v3"
38
+        with:
39
+          node-version: 20
40
+          cache: "npm"
41
+          cache-dependency-path: "./pages/package-lock.json"
42
+      - name: "Install dependencies"
43
+        run: "npm install"
44
+      - name: "Build pages"
45
+        run: "npm run build"
46
+        env:
47
+          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
48
+      - name: "Upload artifact"
49
+        uses: "actions/upload-pages-artifact@v2"
50
+        with:
51
+          path: "./pages/build"
52
+      - name: "Deploy to GitHub Pages"
53
+        id: "deployment"
54
+        uses: "actions/deploy-pages@v2"
55
obs-backgroundremoval-1.1.6.tar.gz/.github/workflows/push.yaml -> obs-backgroundremoval-1.1.13.tar.gz/.github/workflows/push.yaml Changed
10
 
1
@@ -111,7 +111,7 @@
2
           draft: true
3
           prerelease: ${{ fromJSON(steps.check.outputs.prerelease) }}
4
           tag_name: ${{ steps.check.outputs.version }}
5
-          name: OBS Studio ${{ steps.check.outputs.version }}
6
+          name: obs-backgroundremoval ${{ steps.check.outputs.version }}
7
           body_path: ${{ github.workspace }}/CHECKSUMS.txt
8
           files: |
9
             ${{ github.workspace }}/*.exe
10
obs-backgroundremoval-1.1.13.tar.gz/.github/workflows/winget-update.yaml Added
21
 
1
@@ -0,0 +1,19 @@
2
+name: Submit package to Windows Package Manager Community Repository 
3
+
4
+on:
5
+  release:
6
+    types:
7
+      - published
8
+
9
+jobs:
10
+
11
+  winget:
12
+    name: Publish winget package
13
+    runs-on: windows-latest
14
+    steps:
15
+      - name: Submit package to Windows Package Manager Community Repository
16
+        run: |
17
+          iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
18
+          $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
19
+          $installerUrl = $github.release.assets | Where-Object -Property name -match 'obs-backgroundremoval-*-windows-x64-Installer.exe' | Select -ExpandProperty browser_download_url -First 1
20
+          .\wingetcreate.exe update RoyShilkrot.obs-backgroundremoval -s -v $github.release.tag_name -u $installerUrl -t '${{ secrets.OBS_BGREMOVAL_PUBLIC_REPO_PAT }}'
21
obs-backgroundremoval-1.1.6.tar.gz/.gitignore -> obs-backgroundremoval-1.1.13.tar.gz/.gitignore Changed
17
 
1
@@ -7,6 +7,7 @@
2
 !/cmake
3
 !/data
4
 !/docs
5
+!/pages
6
 !/src
7
 !/vendor
8
 !.clang-format
9
@@ -17,6 +18,7 @@
10
 !CMakePresets.json
11
 !LICENSE
12
 !README.md
13
+!patch_libobs.diff
14
 
15
 # Exclude lock files
16
 *.lock.json
17
obs-backgroundremoval-1.1.6.tar.gz/CMakeLists.txt -> obs-backgroundremoval-1.1.13.tar.gz/CMakeLists.txt Changed
38
 
1
@@ -37,9 +37,18 @@
2
 set(USE_SYSTEM_ONNXRUNTIME
3
     OFF
4
     CACHE STRING "Use system ONNX Runtime")
5
+
6
+set(DISABLE_ONNXRUNTIME_GPU
7
+    OFF
8
+    CACHE STRING "Disables GPU support of ONNX Runtime (Only valid on Linux)")
9
+
10
+if(DISABLE_ONNXRUNTIME_GPU)
11
+  target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE DISABLE_ONNXRUNTIME_GPU)
12
+endif()
13
+
14
 if(USE_SYSTEM_ONNXRUNTIME)
15
   if(OS_LINUX)
16
-    find_package(Onnxruntime 1.14.1 REQUIRED)
17
+    find_package(Onnxruntime 1.16.3 REQUIRED)
18
     set(Onnxruntime_INCLUDE_PATH
19
         ${Onnxruntime_INCLUDE_DIR} ${Onnxruntime_INCLUDE_DIR}/onnxruntime
20
         ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/session ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/providers/cpu)
21
@@ -71,6 +80,8 @@
22
 if(APPLE)
23
   add_subdirectory(src/update-checker/URLSessionClient)
24
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE URLSessionClient)
25
+  # add Foundation framework
26
+  target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "-framework Foundation")
27
 elseif(MSVC)
28
   add_subdirectory(src/update-checker/WinRTHttpClient)
29
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE WinRTHttpClient)
30
@@ -87,7 +98,6 @@
31
           src/obs-utils/obs-config-utils.cpp
32
           src/update-checker/github-utils.cpp
33
           src/update-checker/update-checker.cpp
34
-          src/update-checker/UpdateDialog.cpp
35
           src/background-filter-info.c
36
           src/background-filter.cpp
37
           src/enhance-filter.cpp
38
obs-backgroundremoval-1.1.6.tar.gz/CMakePresets.json -> obs-backgroundremoval-1.1.13.tar.gz/CMakePresets.json Changed
39
 
1
@@ -24,7 +24,7 @@
2
         "CODESIGN_IDENTITY": "$penv{CODESIGN_IDENT}",
3
         "CODESIGN_TEAM": "$penv{CODESIGN_TEAM}",
4
         "ENABLE_FRONTEND_API": true,
5
-        "ENABLE_QT": true
6
+        "ENABLE_QT": false
7
       }
8
     },
9
     {
10
@@ -54,7 +54,7 @@
11
         "QT_VERSION": "6",
12
         "CMAKE_SYSTEM_VERSION": "10.0.18363.657",
13
         "ENABLE_FRONTEND_API": true,
14
-        "ENABLE_QT": true
15
+        "ENABLE_QT": false
16
       }
17
     },
18
     {
19
@@ -83,8 +83,7 @@
20
         "CMAKE_BUILD_TYPE": "RelWithDebInfo",
21
         "CMAKE_POSITION_INDEPENDENT_CODE": true,
22
         "ENABLE_FRONTEND_API": true,
23
-        "ENABLE_QT": true,
24
-        "USE_SYSTEM_CURL": true
25
+        "ENABLE_QT": false
26
       }
27
     },
28
     {
29
@@ -114,8 +113,7 @@
30
         "CMAKE_BUILD_TYPE": "RelWithDebInfo",
31
         "CMAKE_POSITION_INDEPENDENT_CODE": true,
32
         "ENABLE_FRONTEND_API": true,
33
-        "ENABLE_QT": true,
34
-        "USE_SYSTEM_CURL": true
35
+        "ENABLE_QT": false
36
       }
37
     },
38
     {
39
obs-backgroundremoval-1.1.6.tar.gz/README.md -> obs-backgroundremoval-1.1.13.tar.gz/README.md Changed
201
 
1
@@ -2,52 +2,73 @@
2
 
3
 <div align="center">
4
 
5
-!GitHub(https://img.shields.io/github/license/royshil/obs-backgroundremoval)(https://github.com/royshil/obs-backgroundremoval/blob/main/LICENSE)
6
-!GitHub Workflow Status(https://img.shields.io/github/actions/workflow/status/royshil/obs-backgroundremoval/push.yaml)(https://github.com/royshil/obs-backgroundremoval/actions/workflows/push.yaml)
7
-!Total downloads(https://img.shields.io/github/downloads/royshil/obs-backgroundremoval/total)(https://github.com/royshil/obs-backgroundremoval/releases)
8
+!GitHub(https://img.shields.io/github/license/occ-ai/obs-backgroundremoval)(https://github.com/occ-ai/obs-backgroundremoval/blob/main/LICENSE)
9
+!GitHub Workflow Status(https://img.shields.io/github/actions/workflow/status/occ-ai/obs-backgroundremoval/push.yaml)(https://github.com/occ-ai/obs-backgroundremoval/actions/workflows/push.yaml)
10
+!Total downloads(https://img.shields.io/github/downloads/occ-ai/obs-backgroundremoval/total)(https://github.com/occ-ai/obs-backgroundremoval/releases)
11
 !Flathub(https://img.shields.io/flathub/downloads/com.obsproject.Studio.Plugin.BackgroundRemoval?label=Flathub%20Installs)
12
-!GitHub release (latest by date)(https://img.shields.io/github/v/release/royshil/obs-backgroundremoval)(https://github.com/royshil/obs-backgroundremoval/releases)
13
+!GitHub release (latest by date)(https://img.shields.io/github/v/release/occ-ai/obs-backgroundremoval)(https://github.com/occ-ai/obs-backgroundremoval/releases)
14
+!Discord(https://img.shields.io/discord/1200229425141252116)(https://discord.gg/KbjGU2vvUz)
15
 
16
 </div>
17
 
18
 A plugin for OBS Studio(https://obsproject.com/) that allows you to replace the background in portrait images and video, as well as enhance low-light scenes.
19
 
20
+- Usage(#usage)
21
+- Download(#download)
22
 - Introduction(#introduction)
23
 - Building(#building)
24
   - MacOSX(#mac-osx)
25
-  - Linux (Ubuntu, Arch, openSUSE)(#linux)
26
+  - Linux (Ubuntu, Arch, openSUSE, Fedora)(#linux)
27
   - Windows(#windows)
28
 
29
-Other plugins from us:
30
-- 🚧 Experimental 🚧: CleanStream(https://github.com/royshil/obs-cleanstream) OBS plugin for real-time filler word (uh,um) and profanity removal from live audio stream
31
-- ✨ NEW: URL/API Source(https://github.com/royshil/obs-urlsource) a plugin for live fetching of API data and displaying on screen as a video source
32
-- ✨ NEW: LocalVocal(https://github.com/royshil/obs-localvocal) speech AI assistant plugin for real-time local transcription (captions), translation and other language functions
33
+For other AI plugins from us check out OCC AI(https://github.com/occ-ai).
34
+
35
+## Usage
36
+
37
+<div align="center">
38
+<video src="https://github.com/occ-ai/obs-backgroundremoval/assets/1067855/5ba5aae2-7ea2-4c90-ad45-fba5ccde1a4e" width="320"></video>
39
+</div>
40
+
41
+Check out the usage guide page(https://occ-ai.github.io/obs-backgroundremoval/usage) for usage walkthrough and recommendations.
42
+
43
+Additional tutorial videos:
44
+
45
+- Usage tutorial: https://youtu.be/veqNEsMqEE0
46
+- Depth of Field effect: https://youtu.be/jC3EKSpNjQk
47
+- Low-light enhancement: https://youtu.be/WSBLYWFrn2Q
48
+- Remove background from ANY object (not just human): https://youtu.be/N74VCDCToX8
49
 
50
 ## Download
51
-Check out the latest releases(https://github.com/royshil/obs-backgroundremoval/releases) for downloads and install instructions.
52
+
53
+Check out the guide page(https://occ-ai.github.io/obs-backgroundremoval) for downloads and install instructions for **Windows** and **MacOS**.
54
 
55
 ### Linux Installation
56
+
57
 On Ubuntu, there are two ways to install OBS and you have to use the corresponding method to install this plugin.
58
-- If you installed OBS via the official PPA, download the deb package from the releases(https://github.com/royshil/obs-backgroundremoval/releases) page and install it directly.
59
+
60
+- If you installed OBS via the official PPA, download the deb package from the releases(https://github.com/occ-ai/obs-backgroundremoval/releases) page and install it directly.
61
 - If you installed OBS via FlatHub, run the following command: `flatpak install com.obsproject.Studio.Plugin.BackgroundRemoval`
62
 
63
 The pre-built binary of this plugin can run Ubuntu 22.04 or later.
64
 
65
 On openSUSE, please see `docs/BUILDING-OPENSUSE.md`(docs/BUILDING-OPENSUSE.md).
66
 
67
+#### FlatHub
68
+
69
+On Debian, you cannot use our deb package and we only support FlatHub installation.
70
+
71
 On other Linux distros, use the FlatHub installation of both OBS and this plugin.
72
-If you install OBS in a way other than FlatHub, you have to build this plugin by yourself (see instructions for building below(#linux)).
73
 
74
-## Code Walkthrough
75
-This video on YouTube will take you through the major parts of the code and explain them.
76
+```
77
+flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
78
+flatpak install flathub com.obsproject.Studio
79
+flatpak install flathub com.obsproject.Studio.Plugin.BackgroundRemoval
80
+```
81
 
82
-<div align="center">
83
-  <a href="https://youtu.be/iFQtcJg0Wsk" target="_blank">
84
-    <img width="50%" src="https://img.youtube.com/vi/iFQtcJg0Wsk/maxresdefault.jpg"/>
85
-  </a>
86
-</div>
87
+If you install OBS in a way other than FlatHub, you have to build this plugin by yourself (see instructions for building below(#linux)).
88
+
89
+### OBS Version Support and Compatibility
90
 
91
-## OBS Version Support and Compatibility
92
 - OBS version 29+ (download(https://obsproject.com/download)) for the latest version of this plugin, e.g. 1.1.x and above.
93
 - OBS version 28+ for this plugin's version between 0.5.x and 1.0.x.
94
 - OBS version 27+ for this plugin's version 0.4.x and below.
95
@@ -60,31 +81,40 @@
96
 a transparent color.
97
 
98
 If you like this work, which is given to you completely free of charge, please consider supporting it by sponsoring us on GitHub:
99
+
100
 - https://github.com/sponsors/royshil
101
 - https://github.com/sponsors/umireon
102
 
103
-OBS Plugins forum: https://obsproject.com/forum/resources/background-removal-portrait-segmentation.1260/
104
+### Support and Help
105
+
106
+Reach out to us on Discord(https://discord.gg/3EUBUjpCD3) or the OBS Plugins forum(https://obsproject.com/forum/resources/background-removal-portrait-segmentation.1260/) for online / immediate help.
107
 
108
-Tutorial video on YouTube: https://youtu.be/veqNEsMqEE0
109
+If you found a bug or want to suggest a feature or improvement please open an issue(https://github.com/occ-ai/obs-backgroundremoval/issues).
110
 
111
-https://github.com/royshil/obs-backgroundremoval/assets/1067855/5ba5aae2-7ea2-4c90-ad45-fba5ccde1a4e
112
+If you are looking for hands-on help or private consultation please select a sponsorship tier(https://github.com/sponsors/royshil?frequency=one-time).
113
+
114
+### Technical Details
115
 
116
 GPU support:
117
-* Currently on Windows we support DirectML, which should reduce CPU usage by 95% and effectively use the systems accelerators (GPUs if available).
118
-* On Mac we support CoreML for acceleration, which is available on M1 and M2 (not Intel, sorry).
119
-* CUDA is supported in this plugin through TensorRT, however it is supported only on Linux.
120
-* The goal of this plugin is to be available for everyone on every system, even if they don't own a GPU.
121
+
122
+- Currently on Windows we support DirectML, which should reduce CPU usage by 95% and effectively use the systems accelerators (GPUs if available).
123
+- On Mac we support CoreML for acceleration, which is available on M1 and M2 (not Intel, sorry).
124
+- CUDA is supported in this plugin through TensorRT, however it is supported only on Linux.
125
+- The goal of this plugin is to be available for everyone on every system, even if they don't own a GPU.
126
 
127
 Number of CPU threads is controllable through the UI settings. A 2-thread setting works best.
128
 
129
 The pretrained model weights used for portrait foreground segmentation are taken from:
130
+
131
 - https://github.com/anilsathyan7/Portrait-Segmentation/tree/master/SINet
132
 - https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.7/contrib/PP-HumanSeg
133
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/082_MediaPipe_Meet_Segmentation
134
 - https://github.com/PeterL1n/RobustVideoMatting
135
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/384_TCMonoDepth and https://github.com/yu-li/TCMonoDepth
136
+- https://huggingface.co/briaai/RMBG-1.4
137
 
138
 Image enhancement (low light) models are taken from:
139
+
140
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/213_TBEFN
141
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/372_URetinex-Net
142
 - https://github.com/PINTO0309/PINTO_model_zoo/tree/main/370_Semantic-Guided-Low-Light-Image-Enhancement
143
@@ -92,9 +122,19 @@
144
 
145
 Some more information about how I built it: https://www.morethantechnical.com/2021/04/15/obs-plugin-for-portrait-background-removal-with-onnx-sinet-model/ and https://www.morethantechnical.com/2023/05/20/building-an-obs-background-removal-plugin-a-walkthrough/
146
 
147
+### Code Walkthrough
148
+
149
+This video on YouTube will take you through the major parts of the code and explain them.
150
+
151
+<div align="center">
152
+  <a href="https://youtu.be/iFQtcJg0Wsk" target="_blank">
153
+    <img width="50%" src="https://img.youtube.com/vi/iFQtcJg0Wsk/maxresdefault.jpg"/>
154
+  </a>
155
+</div>
156
+
157
 ## Building
158
 
159
-The plugin was built and tested on Mac OSX  (Intel & Apple silicon), Windows and several Linux disros (e.g. Ubuntu/Debian-ish, Fedora, and more). Help is appreciated in building on other OSs and packages.
160
+The plugin was built and tested on Mac OSX (Intel & Apple silicon), Windows and several Linux disros (e.g. Ubuntu/Debian-ish, Fedora, and more). Help is appreciated in building on other OSs and packages.
161
 
162
 The building pipelines in CI take care of the heavy lifting. Use them in order to build the plugin locally. We attempt to use external OpenCV, libcurl and ONNX Runtime to reduce build times.
163
 
164
@@ -109,12 +149,15 @@
165
 ```
166
 
167
 #### Install
168
+
169
 The above script should succeed and the plugin files (e.g. `obs-backgroundremoval.plugin`) will reside in the `./release/Release` folder off of the root. Copy the `.plugin` file to the OBS directory e.g. `~/Library/Application Support/obs-studio/plugins`.
170
 
171
 To get `.pkg` installer file, run for example
172
+
173
 ```sh
174
 $ ./.github/scripts/package-macos -c Release
175
 ```
176
+
177
 (Note that maybe the outputs will be in the `Release` folder and not the `install` folder like `pakage-macos` expects, so you will need to rename the folder from `build_x86_64/Release` to `build_x86_64/install`)
178
 
179
 ### Linux
180
@@ -122,17 +165,21 @@
181
 #### Ubuntu
182
 
183
 Use the CI scripts again
184
+
185
 ```sh
186
 $ ./.github/scripts/build-linux.sh
187
 ```
188
 
189
 #### Arch Linux
190
+
191
 The community maintains AUR packages: https://aur.archlinux.org/packages/obs-backgroundremoval
192
 
193
 #### Fedora
194
+
195
 To compile on Fedora, you need to manage the dependencies manually. See docs/BUILDING-FEDORA.md(docs/BUILDING-FEDORA.md) for more information.
196
 
197
 #### FlatHub
198
+
199
 The plugin is available on FlatHub: https://github.com/flathub/com.obsproject.Studio.Plugin.BackgroundRemoval
200
 
201
obs-backgroundremoval-1.1.6.tar.gz/buildspec.json -> obs-backgroundremoval-1.1.13.tar.gz/buildspec.json Changed
23
 
1
@@ -32,12 +32,6 @@
2
         }
3
     },
4
     "tools": {
5
-        "packages": {
6
-            "version": "1.2.10",
7
-            "baseUrl": "http://s.sudre.free.fr/Software/files",
8
-            "label": "Packages.app",
9
-            "hash": "6afdd25386295974dad8f078b8f1e41cabebd08e72d970bf92f707c7e48b16c9"
10
-        }
11
     },
12
     "platformConfig": {
13
         "macos": {
14
@@ -45,7 +39,7 @@
15
         }
16
     },
17
     "name": "obs-backgroundremoval",
18
-    "version": "1.1.6",
19
+    "version": "1.1.13",
20
     "author": "Roy Shilkrot",
21
     "website": "https://github.com/royshil/obs-backgroundremoval",
22
     "email": "roy.shil@gmail.com",
23
obs-backgroundremoval-1.1.6.tar.gz/cmake/FetchOnnxruntime.cmake -> obs-backgroundremoval-1.1.13.tar.gz/cmake/FetchOnnxruntime.cmake Changed
138
 
1
@@ -4,35 +4,55 @@
2
     ""
3
     CACHE STRING "URL of a downloaded ONNX Runtime tarball")
4
 
5
-set(CUSTOM_ONNXRUNTIME_MD5
6
+set(CUSTOM_ONNXRUNTIME_HASH
7
     ""
8
-    CACHE STRING "MD5 Hash of a downloaded ONNX Runtime tarball")
9
+    CACHE STRING "Hash of a downloaded ONNX Runtime tarball")
10
+
11
+set(Onnxruntime_VERSION "1.17.1")
12
 
13
 if(CUSTOM_ONNXRUNTIME_URL STREQUAL "")
14
   set(USE_PREDEFINED_ONNXRUNTIME ON)
15
 else()
16
-  if(CUSTOM_ONNXRUNTIME_MD5 STREQUAL "")
17
-    message(FATAL_ERROR "Both of CUSTOM_ONNXRUNTIME_URL and CUSTOM_ONNXRUNTIME_MD5 must be present!")
18
+  if(CUSTOM_ONNXRUNTIME_HASH STREQUAL "")
19
+    message(FATAL_ERROR "Both of CUSTOM_ONNXRUNTIME_URL and CUSTOM_ONNXRUNTIME_HASH must be present!")
20
   else()
21
     set(USE_PREDEFINED_ONNXRUNTIME OFF)
22
   endif()
23
 endif()
24
 
25
-set(Onnxruntime_VERSION "1.15.1")
26
+if(USE_PREDEFINED_ONNXRUNTIME)
27
+  set(Onnxruntime_BASEURL "https://github.com/microsoft/onnxruntime/releases/download/v${Onnxruntime_VERSION}")
28
+  set(Onnxruntime_WINDOWS_VERSION "v${Onnxruntime_VERSION}-1")
29
+  set(Onnxruntime_WINDOWS_BASEURL
30
+      "https://github.com/occ-ai/occ-ai-dep-onnxruntime-static-win/releases/download/${Onnxruntime_WINDOWS_VERSION}")
31
 
32
-if(OS_MACOS)
33
-  if(USE_PREDEFINED_ONNXRUNTIME)
34
-    FetchContent_Declare(
35
-      Onnxruntime
36
-      URL "https://github.com/microsoft/onnxruntime/releases/download/v${Onnxruntime_VERSION}/onnxruntime-osx-universal2-${Onnxruntime_VERSION}.tgz"
37
-      URL_HASH MD5=6637c31d2dae5ad8bffb4da38ae4d89e)
38
+  if(APPLE)
39
+    set(Onnxruntime_URL "${Onnxruntime_BASEURL}/onnxruntime-osx-universal2-${Onnxruntime_VERSION}.tgz")
40
+    set(Onnxruntime_HASH SHA256=9FA57FA6F202A373599377EF75064AE568FDA8DA838632B26A86024C7378D306)
41
+  elseif(MSVC)
42
+    set(Onnxruntime_URL "${Onnxruntime_WINDOWS_BASEURL}/onnxruntime-windows-${Onnxruntime_WINDOWS_VERSION}-Release.zip")
43
+    set(OOnnxruntime_HASH SHA256=39E63850D9762810161AE1B4DEAE5E3C02363521273E4B894A9D9707AB626C38)
44
   else()
45
-    FetchContent_Declare(
46
-      Onnxruntime
47
-      URL "${CUSTOM_ONNXRUNTIME_URL}"
48
-      URL_HASH MD5=${CUSTOM_ONNXRUNTIME_MD5})
49
+    if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
50
+      set(Onnxruntime_URL "${Onnxruntime_BASEURL}/onnxruntime-linux-aarch64-${Onnxruntime_VERSION}.tgz")
51
+      set(Onnxruntime_HASH SHA256=70B6F536BB7AB5961D128E9DBD192368AC1513BFFB74FE92F97AAC342FBD0AC1)
52
+    else()
53
+      set(Onnxruntime_URL "${Onnxruntime_BASEURL}/onnxruntime-linux-x64-gpu-${Onnxruntime_VERSION}.tgz")
54
+      set(Onnxruntime_HASH SHA256=613C53745EA4960ED368F6B3AB673558BB8561C84A8FA781B4EA7FB4A4340BE4)
55
+    endif()
56
   endif()
57
-  FetchContent_MakeAvailable(Onnxruntime)
58
+else()
59
+  set(Onnxruntime_URL "${CUSTOM_ONNXRUNTIME_URL}")
60
+  set(Onnxruntime_HASH "${CUSTOM_ONNXRUNTIME_HASH}")
61
+endif()
62
+
63
+FetchContent_Declare(
64
+  onnxruntime
65
+  URL ${Onnxruntime_URL}
66
+  URL_HASH ${Onnxruntime_HASH})
67
+FetchContent_MakeAvailable(onnxruntime)
68
+
69
+if(APPLE)
70
   set(Onnxruntime_LIB "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.${Onnxruntime_VERSION}.dylib")
71
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "${Onnxruntime_LIB}")
72
   target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PUBLIC "${onnxruntime_SOURCE_DIR}/include")
73
@@ -45,20 +65,7 @@
74
     COMMAND
75
       ${CMAKE_INSTALL_NAME_TOOL} -change "@rpath/libonnxruntime.${Onnxruntime_VERSION}.dylib"
76
       "@loader_path/../Frameworks/libonnxruntime.${Onnxruntime_VERSION}.dylib" $<TARGET_FILE:${CMAKE_PROJECT_NAME}>)
77
-elseif(OS_WINDOWS)
78
-  if(USE_PREDEFINED_ONNXRUNTIME)
79
-    FetchContent_Declare(
80
-      Onnxruntime
81
-      URL "https://github.com/umireon/onnxruntime-static-win/releases/download/v${Onnxruntime_VERSION}-1/onnxruntime-static-win.zip"
82
-      URL_HASH MD5=1be38fe8abe304085b9eb58272fbc941)
83
-  else()
84
-    FetchContent_Declare(
85
-      Onnxruntime
86
-      URL "${CUSTOM_ONNXRUNTIME_URL}"
87
-      URL_HASH MD5=${CUSTOM_ONNXRUNTIME_MD5})
88
-  endif()
89
-  FetchContent_MakeAvailable(Onnxruntime)
90
-
91
+elseif(MSVC)
92
   add_library(Ort INTERFACE)
93
   set(Onnxruntime_LIB_NAMES
94
       session;providers_shared;providers_dml;optimizer;providers;framework;graph;util;mlas;common;flatbuffers)
95
@@ -83,40 +90,16 @@
96
   set_target_properties(Ort::DirectML PROPERTIES IMPORTED_LOCATION ${onnxruntime_SOURCE_DIR}/bin/DirectML.dll)
97
   set_target_properties(Ort::DirectML PROPERTIES IMPORTED_IMPLIB ${onnxruntime_SOURCE_DIR}/bin/DirectML.lib)
98
 
99
-  target_link_libraries(Ort INTERFACE Ort::DirectML d3d12.lib dxgi.lib dxguid.lib)
100
+  target_link_libraries(Ort INTERFACE Ort::DirectML d3d12.lib dxgi.lib dxguid.lib Dxcore.lib)
101
 
102
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Ort)
103
 
104
   install(IMPORTED_RUNTIME_ARTIFACTS Ort::DirectML DESTINATION "obs-plugins/64bit")
105
-elseif(OS_LINUX)
106
+else()
107
   if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
108
-    if(USE_PREDEFINED_ONNXRUNTIME)
109
-      FetchContent_Declare(
110
-        Onnxruntime
111
-        URL "https://github.com/microsoft/onnxruntime/releases/download/v${Onnxruntime_VERSION}/onnxruntime-linux-aarch64-${Onnxruntime_VERSION}.tgz"
112
-        URL_HASH MD5=ebec0b185c9bec94fde884a97b144c04)
113
-    else()
114
-      FetchContent_Declare(
115
-        Onnxruntime
116
-        URL "${CUSTOM_ONNXRUNTIME_URL}"
117
-        URL_HASH MD5=${CUSTOM_ONNXRUNTIME_MD5})
118
-    endif()
119
-    FetchContent_MakeAvailable(Onnxruntime)
120
     set(Onnxruntime_LINK_LIBS "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.so.${Onnxruntime_VERSION}")
121
     set(Onnxruntime_INSTALL_LIBS ${Onnxruntime_LINK_LIBS})
122
   else()
123
-    if(USE_PREDEFINED_ONNXRUNTIME)
124
-      FetchContent_Declare(
125
-        Onnxruntime
126
-        URL "https://github.com/microsoft/onnxruntime/releases/download/v${Onnxruntime_VERSION}/onnxruntime-linux-x64-gpu-${Onnxruntime_VERSION}.tgz"
127
-        URL_HASH MD5=8d2f5ee9f449bdecb10a45715fe74c53)
128
-    else()
129
-      FetchContent_Declare(
130
-        Onnxruntime
131
-        URL "${CUSTOM_ONNXRUNTIME_URL}"
132
-        URL_HASH MD5=${CUSTOM_ONNXRUNTIME_MD5})
133
-    endif()
134
-    FetchContent_MakeAvailable(Onnxruntime)
135
     set(Onnxruntime_LINK_LIBS "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime.so.${Onnxruntime_VERSION}")
136
     set(Onnxruntime_INSTALL_LIBS
137
         ${Onnxruntime_LINK_LIBS} "${onnxruntime_SOURCE_DIR}/lib/libonnxruntime_providers_shared.so"
138
obs-backgroundremoval-1.1.6.tar.gz/cmake/FetchOpenCV.cmake -> obs-backgroundremoval-1.1.13.tar.gz/cmake/FetchOpenCV.cmake Changed
67
 
1
@@ -19,8 +19,8 @@
2
 endif()
3
 
4
 if(USE_PREDEFINED_OPENCV)
5
-  set(OpenCV_VERSION "4.8.0-1")
6
-  set(OpenCV_BASEURL "https://github.com/umireon/obs-backgroundremoval-dep-opencv/releases/download/${OpenCV_VERSION}")
7
+  set(OpenCV_VERSION "v4.8.1-1")
8
+  set(OpenCV_BASEURL "https://github.com/obs-ai/obs-backgroundremoval-dep-opencv/releases/download/${OpenCV_VERSION}")
9
 
10
   if(${CMAKE_BUILD_TYPE} STREQUAL Release OR ${CMAKE_BUILD_TYPE} STREQUAL RelWithDebInfo)
11
     set(OpenCV_BUILD_TYPE Release)
12
@@ -29,28 +29,28 @@
13
   endif()
14
 
15
   if(APPLE)
16
-    if(OpenCV_BUILD_TYPE STREQUAL Release)
17
-      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-macos-Release.tar.gz")
18
-      set(OpenCV_HASH MD5=0875366a03aa44def76ab5a12d3e7b8f)
19
+    if(OpenCV_BUILD_TYPE STREQUAL Debug)
20
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-macos-${OpenCV_VERSION}-Debug.tar.gz")
21
+      set(OpenCV_HASH SHA256=2930e335a19cc03a3d825e2b76eadd0d5cf08d8baf6537747d43f503dff32454)
22
     else()
23
-      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-macos-Debug.tar.gz")
24
-      set(OpenCV_HASH MD5=9ae59653c7f9a4c991fbf59018e45d2c)
25
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-macos-${OpenCV_VERSION}-Release.tar.gz")
26
+      set(OpenCV_HASH SHA256=b0c4fe2370b0bd5aa65c408e875b1ab18508ba31b93083805d7e398a3ecafdac)
27
     endif()
28
   elseif(MSVC)
29
-    if(OpenCV_BUILD_TYPE STREQUAL Release)
30
-      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-windows-Release.zip")
31
-      set(OpenCV_HASH MD5=e653d590cfbcc3a9bf15ef20e64a6e32)
32
+    if(OpenCV_BUILD_TYPE STREQUAL Debug)
33
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-windows-${OpenCV_VERSION}-Debug.zip")
34
+      set(OpenCV_HASH SHA256=0c5ef12cf4b4e4db7ea17a24db156165b6f01759f3f1660b069d0722e5d5dc37)
35
     else()
36
-      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-windows-Debug.zip")
37
-      set(OpenCV_HASH MD5=abad340ccb73da2924544ec9066afcb3)
38
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-windows-${OpenCV_VERSION}-Release.zip")
39
+      set(OpenCV_HASH SHA256=5e468f71d41d3a3ea46cc4f247475877f65d3655a2764a2c01074bda3b3e6864)
40
     endif()
41
   else()
42
-    if(OpenCV_BUILD_TYPE STREQUAL Release)
43
-      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-linux-Release.tar.gz")
44
-      set(OpenCV_HASH MD5=7a668fbc3ac536812643c6b8c8f96be9)
45
+    if(OpenCV_BUILD_TYPE STREQUAL Debug)
46
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-linux-${OpenCV_VERSION}-Debug.tar.gz")
47
+      set(OpenCV_HASH SHA256=e2e246d6b4f279be80e7fd0a78cba8a0eeee7b53ae807f2f57428d6876306422)
48
     else()
49
-      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-linux-Debug.tar.gz")
50
-      set(OpenCV_HASH MD5=259699c71055ff748c200e62af059104)
51
+      set(OpenCV_URL "${OpenCV_BASEURL}/opencv-linux-${OpenCV_VERSION}-Release.tar.gz")
52
+      set(OpenCV_HASH SHA256=809922a7cc9f344a2d82a232ed7b02e122c82e77cba94b4047e666a0527cc00e)
53
     endif()
54
   endif()
55
 else()
56
@@ -68,8 +68,8 @@
57
 if(MSVC)
58
   target_link_libraries(
59
     OpenCV
60
-    INTERFACE ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_imgproc480.lib
61
-              ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_core480.lib
62
+    INTERFACE ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_imgproc481.lib
63
+              ${opencv_SOURCE_DIR}/x64/vc17/staticlib/opencv_core481.lib
64
               ${opencv_SOURCE_DIR}/x64/vc17/staticlib/zlib.lib)
65
   target_include_directories(OpenCV SYSTEM INTERFACE ${opencv_SOURCE_DIR}/include)
66
 else()
67
obs-backgroundremoval-1.1.6.tar.gz/cmake/common/buildspec_common.cmake -> obs-backgroundremoval-1.1.13.tar.gz/cmake/common/buildspec_common.cmake Changed
15
 
1
@@ -73,6 +73,13 @@
2
     set(_cmake_version "3.0.0")
3
   endif()
4
 
5
+  message(STATUS "Patch libobs")
6
+  execute_process(
7
+    COMMAND patch --forward "libobs/CMakeLists.txt" "${CMAKE_CURRENT_SOURCE_DIR}/patch_libobs.diff"
8
+    RESULT_VARIABLE _process_result
9
+    WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}")
10
+  message(STATUS "Patch - done")
11
+
12
   message(STATUS "Configure ${label} (${arch})")
13
   execute_process(
14
     COMMAND
15
obs-backgroundremoval-1.1.13.tar.gz/cmake/macos/resources/Distribution.xml.in Added
18
 
1
@@ -0,0 +1,16 @@
2
+<?xml version="1.0" encoding="utf-8"?>
3
+<installer-gui-script minSpecVersion="1">
4
+    <pkg-ref id="@MACOS_BUNDLEID@"/>
5
+    <options customize="never" require-scripts="false" hostArchitectures="x86_64,arm64"/>
6
+    <choices-outline>
7
+        <line choice="default">
8
+            <line choice="@MACOS_BUNDLEID@"/>
9
+        </line>
10
+    </choices-outline>
11
+    <choice id="default"/>
12
+    <choice id="@MACOS_BUNDLEID@" visible="false">
13
+        <pkg-ref id="@MACOS_BUNDLEID@"/>
14
+    </choice>
15
+    <pkg-ref id="@MACOS_BUNDLEID@" version="@CMAKE_PROJECT_VERSION@" onConclusion="none">@CMAKE_PROJECT_NAME@-flat.pkg</pkg-ref>
16
+    <domains enable_anywhere="false" enable_currentUserHome="true" enable_localSystem="false"/>
17
+</installer-gui-script>
18
obs-backgroundremoval-1.1.6.tar.gz/cmake/macos/resources/create-package.cmake.in -> obs-backgroundremoval-1.1.13.tar.gz/cmake/macos/resources/create-package.cmake.in Changed
9
 
1
@@ -3,5 +3,5 @@
2
 set(MACOS_BUNDLEID ${MACOS_BUNDLEID})
3
 set(UUID_PACKAGE ${UUID_PACKAGE})
4
 set(UUID_INSTALLER ${UUID_INSTALLER})
5
-configure_file(cmake/macos/resources/installer-macos.pkgproj.in
6
-  "${CMAKE_CURRENT_BINARY_DIR}/installer-macos.generated.pkgproj")
7
+configure_file(cmake/macos/resources/Distribution.xml.in
8
+  "${CMAKE_CURRENT_BINARY_DIR}/Distribution.generated.xml")
9
obs-backgroundremoval-1.1.6.tar.gz/cmake/windows/compilerconfig.cmake -> obs-backgroundremoval-1.1.13.tar.gz/cmake/windows/compilerconfig.cmake Changed
24
 
1
@@ -20,15 +20,19 @@
2
 endif()
3
 
4
 add_compile_options(
5
-  /W3 /utf-8 "$<$<COMPILE_LANG_AND_ID:C,MSVC>:/MP>" "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/MP>"
6
+  /W3
7
+  /utf-8
8
+  "$<$<COMPILE_LANG_AND_ID:C,MSVC>:/MP>"
9
+  "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/MP>"
10
   "$<$<COMPILE_LANG_AND_ID:C,Clang>:${_obs_clang_c_options}>"
11
-  "$<$<COMPILE_LANG_AND_ID:CXX,Clang>:${_obs_clang_cxx_options}>")
12
+  "$<$<COMPILE_LANG_AND_ID:CXX,Clang>:${_obs_clang_cxx_options}>"
13
+  /IGNORE:4099)
14
 
15
 add_compile_definitions(UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS $<$<CONFIG:DEBUG>:DEBUG>
16
                         $<$<CONFIG:DEBUG>:_DEBUG>)
17
 
18
 add_link_options("$<$<NOT:$<CONFIG:Debug>>:/OPT:REF>" "$<$<CONFIG:Debug>:/INCREMENTAL:NO>"
19
-                 "$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>" "$<$<CONFIG:RelWithDebInfo>:/OPT:ICF>")
20
+                 "$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>" "$<$<CONFIG:RelWithDebInfo>:/OPT:ICF>" /IGNORE:4099)
21
 
22
 if(CMAKE_COMPILE_WARNING_AS_ERROR)
23
   add_link_options(/WX)
24
obs-backgroundremoval-1.1.6.tar.gz/cmake/windows/resources/installer-Windows.iss.in -> obs-backgroundremoval-1.1.13.tar.gz/cmake/windows/resources/installer-Windows.iss.in Changed
11
 
1
@@ -20,6 +20,9 @@
2
 Compression=lzma
3
 SolidCompression=yes
4
 DirExistsWarning=no
5
+VersionInfoVersion={#MyAppVersion}
6
+AppCopyright=Copyright (C) 2023 {#MyAppPublisher}
7
+DisableProgramGroupPage=Yes
8
 
9
 Languages
10
 Name: "english"; MessagesFile: "compiler:Default.isl"
11
obs-backgroundremoval-1.1.6.tar.gz/data/locale/ar-EG.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/ar-EG.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="تحسين موجّه بالدليل الدلالي"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="تمكين الحد"
5
+Advanced="إعدادات متقدمة"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/bn-IN.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/bn-IN.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="সেমান্টিক গাইডেড উন্নয়ন"
3
 ZERODCE="শূন্য-DCE"
4
 EnableThreshold="থ্রেসহোল্ড সক্ষম করুন"
5
+Advanced="উন্নত সেটিংস"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/en-US.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/en-US.ini Changed
21
 
1
@@ -17,8 +17,8 @@
2
 SelfieSegmentation="Selfie Segmentation"
3
 PPHumanSeg="PPHumanSeg"
4
 RobustVideoMatting="Robust Video Matting"
5
-CalculateMaskEveryXFrame="Calculate mask every X frame"
6
-BlurBackgroundFactor0NoBlurUseColor="Blur background factor (0 - no blur)"
7
+CalculateMaskEveryXFrame="Calculate every X frame"
8
+BlurBackgroundFactor0NoBlurUseColor="Blur background (0 - no blur)"
9
 EnhancePortrait="Enhance portrait"
10
 EffectStrengh="Effect strength (0 - no enhance)"
11
 EnhancementModel="Enhancement model"
12
@@ -32,3 +32,8 @@
13
 TCMonoDepth="TCMonoDepth (Depth)"
14
 EnableFocalBlur="Enable focal blur"
15
 BlurFocusDepth="Blur focus depth"
16
+Advanced="Advanced settings"
17
+FocalBlurGroup="Focal blur settings"
18
+ThresholdGroup="Threshold settings"
19
+EnableImageSimilarity="Skip image based on similarity?"
20
+ImageSimilarityThreshold="Sim. thresh. (high -> sensitive)"
21
obs-backgroundremoval-1.1.6.tar.gz/data/locale/es-SP.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/es-SP.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="Mejora guiada semántica"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="Habilitar umbral"
5
+Advanced="Configuración avanzada"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/fr-FR.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/fr-FR.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="Amélioration Guidée par la Sémantique"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="Activer le seuil"
5
+Advanced="Paramètres avancés"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/hi-IN.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/hi-IN.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="सेमांटिक गाइडेड एन्हांसमेंट"
3
 ZERODCE="ज़ीरो-डीसीई"
4
 EnableThreshold="थ्रेसहोल्ड सक्षम करें"
5
+Advanced="उन्नत सेटिंग्स"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/it-IT.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/it-IT.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="Miglioramento semantico guidato"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="Abilita soglia"
5
+Advanced="Impostazioni avanzate"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/ja-JP.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/ja-JP.ini Changed
19
 
1
@@ -20,3 +20,17 @@
2
 CalculateMaskEveryXFrame="Xフレーム毎にマスクを計算"
3
 BlurBackgroundFactor0NoBlurUseColor="背景ぼかし係数(0でぼかさず背景色を使用)"
4
 EnableThreshold="しきい値を有効にする"
5
+Advanced="詳細設定"
6
+BlurFocusPoint="ぼかし焦点点"
7
+EnableFocalBlur="焦点ぼかしを有効にする"
8
+BlurFocusDepth="ぼかし焦点深度"
9
+EffectStrengh="効果強度(0で効果なし)"
10
+EnhancementModel="強化モデル"
11
+NumThreads="# CPUスレッド"
12
+TCMonoDepth="TCMonoDepth(深度)"
13
+TBEFN="TBEFN"
14
+URETINEX="URetinex-Net"
15
+SGLLIE="Semantic Guided Enhancement"
16
+ZERODCE="Zero-DCE"
17
+FocalBlurGroup="焦点ぼかし設定"
18
+ThresholdGroup="しきい値設定"
19
obs-backgroundremoval-1.1.6.tar.gz/data/locale/ko-KR.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/ko-KR.ini Changed
8
 
1
@@ -28,3 +28,6 @@
2
 SGLLIE="시맨틱 가이드 개선"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="임계값 활성화"
5
+Advanced="고급 설정"
6
+FocalBlurGroup="초점 블러 설정"
7
+ThresholdGroup="임계값 설정"
8
obs-backgroundremoval-1.1.6.tar.gz/data/locale/pt-BR.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/pt-BR.ini Changed
12
 
1
@@ -28,3 +28,10 @@
2
 SGLLIE="Aprimoramento Guiado Semântico"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="Ativar Limiar"
5
+Advanced="Configurações Avançadas"
6
+FocalBlurGroup="Configurações de desfoque focal"
7
+BlurFocusPoint="Ponto de foco desfocado"
8
+EnableFocalBlur="Ativar desfoque focal"
9
+BlurFocusDepth="Profundidade de foco desfocada"
10
+TCMonoDepth="TCMonoDepth (Profundidade)"
11
+ThresholdGroup="Configurações de Limiar"
12
obs-backgroundremoval-1.1.6.tar.gz/data/locale/ru-RU.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/ru-RU.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="Семантическое улучшение"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="Включить порог"
5
+Advanced="Расширенные настройки"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/ta-IN.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/ta-IN.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="பரிமாற்றத்தை உதர்வுபடுத்திய மேம்படுத்தல்"
3
 ZERODCE="பூஜிய மேற்கோளிக் குறியீடு"
4
 EnableThreshold="அளவுருக்கு அனுமதி"
5
+Advanced="மேம்படுத்தப்பட்ட அமைப்புகள்"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/tr-TR.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/tr-TR.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="Semantik Rehberli İyileştirme"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="Eşik Değerini Etkinleştir"
5
+Advanced="Gelişmiş Ayarlar"
6
obs-backgroundremoval-1.1.6.tar.gz/data/locale/zh-CN.ini -> obs-backgroundremoval-1.1.13.tar.gz/data/locale/zh-CN.ini Changed
6
 
1
@@ -28,3 +28,4 @@
2
 SGLLIE="语义引导增强"
3
 ZERODCE="Zero-DCE"
4
 EnableThreshold="启用阈值"
5
+Advanced="高级设置"
6
obs-backgroundremoval-1.1.13.tar.gz/data/models/bria_rmbg_1_4_qint8.onnx Added
obs-backgroundremoval-1.1.6.tar.gz/docs/BUILDING-FEDORA.md -> obs-backgroundremoval-1.1.13.tar.gz/docs/BUILDING-FEDORA.md Changed
10
 
1
@@ -13,7 +13,7 @@
2
 
3
 Clone the repository and set up the submodules:
4
 ```
5
-git clone https://github.com/royshil/obs-backgroundremoval.git
6
+git clone https://github.com/obs-ai/obs-backgroundremoval.git
7
 cd obs-backgroundremoval
8
 git submodule update --init
9
 ```
10
obs-backgroundremoval-1.1.6.tar.gz/docs/BUILDING-OPENSUSE.md -> obs-backgroundremoval-1.1.13.tar.gz/docs/BUILDING-OPENSUSE.md Changed
25
 
1
@@ -19,11 +19,20 @@
2
 ```
3
 sudo zypper install -t pattern devel_basis
4
 sudo zypper install zsh cmake Mesa-libGL-devel \
5
-  ffmpeg-6-libavcodes-devel ffmpeg-6-libavdevice-devel ffmpeg-6-libavformat-devel \
6
+  ffmpeg-6-libavcodec-devel ffmpeg-6-libavdevice-devel ffmpeg-6-libavformat-devel \
7
   libcurl-devel Mesa-libEGL-devel \
8
   libpulse-devel libxkbcommon-devel
9
-</dev/null >.github/scripts/utils.zsh/check_linux
10
-CI=1 .github/scripts/build-linux.zsh --skip-deps
11
+sudo zypper in cmake gcc12-c++ ninja obs-studio-devel opencv-devel qt6-base-devel zsh curl-devel jq
12
+
13
+cmake . -B build_x86_64 \
14
+  -DCMAKE_C_COMPILER=gcc-12 \
15
+  -DCMAKE_CXX_COMPILER=g++-12 \
16
+  -DQT_VERSION=6 \
17
+  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
18
+  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
19
+  -DENABLE_FRONTEND_API=ON \
20
+  -DENABLE_QT=ON
21
+cmake --build build_x86_64
22
 sudo cmake --install build_x86_64 --prefix /usr
23
 ```
24
 
25
obs-backgroundremoval-1.1.13.tar.gz/pages Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/.eslintignore Added
15
 
1
@@ -0,0 +1,13 @@
2
+.DS_Store
3
+node_modules
4
+/build
5
+/.svelte-kit
6
+/package
7
+.env
8
+.env.*
9
+!.env.example
10
+
11
+# Ignore files for PNPM, NPM and YARN
12
+pnpm-lock.yaml
13
+package-lock.json
14
+yarn.lock
15
obs-backgroundremoval-1.1.13.tar.gz/pages/.eslintrc.cjs Added
32
 
1
@@ -0,0 +1,30 @@
2
+module.exports = {
3
+   root: true,
4
+   extends: 
5
+       'eslint:recommended',
6
+       'plugin:@typescript-eslint/recommended',
7
+       'plugin:svelte/recommended',
8
+       'prettier'
9
+   ,
10
+   parser: '@typescript-eslint/parser',
11
+   plugins: '@typescript-eslint',
12
+   parserOptions: {
13
+       sourceType: 'module',
14
+       ecmaVersion: 2020,
15
+       extraFileExtensions: '.svelte'
16
+   },
17
+   env: {
18
+       browser: true,
19
+       es2017: true,
20
+       node: true
21
+   },
22
+   overrides: 
23
+       {
24
+           files: '*.svelte',
25
+           parser: 'svelte-eslint-parser',
26
+           parserOptions: {
27
+               parser: '@typescript-eslint/parser'
28
+           }
29
+       }
30
+   
31
+};
32
obs-backgroundremoval-1.1.13.tar.gz/pages/.gitignore Added
14
 
1
@@ -0,0 +1,12 @@
2
+.DS_Store
3
+node_modules
4
+/build
5
+/.svelte-kit
6
+/package
7
+.env
8
+.env.*
9
+!.env.example
10
+.vercel
11
+.output
12
+vite.config.js.timestamp-*
13
+vite.config.ts.timestamp-*
14
obs-backgroundremoval-1.1.13.tar.gz/pages/.npmrc Added
3
 
1
@@ -0,0 +1,1 @@
2
+engine-strict=true
3
obs-backgroundremoval-1.1.13.tar.gz/pages/.prettierignore Added
15
 
1
@@ -0,0 +1,13 @@
2
+.DS_Store
3
+node_modules
4
+/build
5
+/.svelte-kit
6
+/package
7
+.env
8
+.env.*
9
+!.env.example
10
+
11
+# Ignore files for PNPM, NPM and YARN
12
+pnpm-lock.yaml
13
+package-lock.json
14
+yarn.lock
15
obs-backgroundremoval-1.1.13.tar.gz/pages/.prettierrc Added
11
 
1
@@ -0,0 +1,9 @@
2
+{
3
+   "useTabs": true,
4
+   "singleQuote": true,
5
+   "trailingComma": "none",
6
+   "printWidth": 100,
7
+   "plugins": "prettier-plugin-svelte",
8
+   "pluginSearchDirs": ".",
9
+   "overrides": { "files": "*.svelte", "options": { "parser": "svelte" } }
10
+}
11
obs-backgroundremoval-1.1.13.tar.gz/pages/README.md Added
40
 
1
@@ -0,0 +1,38 @@
2
+# create-svelte
3
+
4
+Everything you need to build a Svelte project, powered by `create-svelte`(https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
5
+
6
+## Creating a project
7
+
8
+If you're seeing this, you've probably already done this step. Congrats!
9
+
10
+```bash
11
+# create a new project in the current directory
12
+npm create svelte@latest
13
+
14
+# create a new project in my-app
15
+npm create svelte@latest my-app
16
+```
17
+
18
+## Developing
19
+
20
+Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
21
+
22
+```bash
23
+npm run dev
24
+
25
+# or start the server and open the app in a new browser tab
26
+npm run dev -- --open
27
+```
28
+
29
+## Building
30
+
31
+To create a production version of your app:
32
+
33
+```bash
34
+npm run build
35
+```
36
+
37
+You can preview the production build with `npm run preview`.
38
+
39
+> To deploy your app, you may need to install an adapter(https://kit.svelte.dev/docs/adapters) for your target environment.
40
obs-backgroundremoval-1.1.13.tar.gz/pages/package-lock.json Added
201
 
1
@@ -0,0 +1,3120 @@
2
+{
3
+   "name": "pages",
4
+   "version": "0.0.1",
5
+   "lockfileVersion": 3,
6
+   "requires": true,
7
+   "packages": {
8
+       "": {
9
+           "name": "pages",
10
+           "version": "0.0.1",
11
+           "devDependencies": {
12
+               "@fontsource/fira-mono": "^4.5.10",
13
+               "@neoconfetti/svelte": "^1.0.0",
14
+               "@sveltejs/adapter-static": "^2.0.3",
15
+               "@sveltejs/kit": "^1.20.4",
16
+               "@types/cookie": "^0.5.1",
17
+               "@typescript-eslint/eslint-plugin": "^6.0.0",
18
+               "@typescript-eslint/parser": "^6.0.0",
19
+               "eslint": "^8.28.0",
20
+               "eslint-config-prettier": "^8.5.0",
21
+               "eslint-plugin-svelte": "^2.30.0",
22
+               "prettier": "^2.8.0",
23
+               "prettier-plugin-svelte": "^2.10.1",
24
+               "svelte": "^4.0.5",
25
+               "svelte-check": "^3.4.3",
26
+               "tslib": "^2.4.1",
27
+               "typescript": "^5.0.0",
28
+               "vite": "^4.4.2"
29
+           }
30
+       },
31
+       "node_modules/@aashutoshrathi/word-wrap": {
32
+           "version": "1.2.6",
33
+           "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz",
34
+           "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==",
35
+           "dev": true,
36
+           "engines": {
37
+               "node": ">=0.10.0"
38
+           }
39
+       },
40
+       "node_modules/@ampproject/remapping": {
41
+           "version": "2.2.1",
42
+           "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
43
+           "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
44
+           "dev": true,
45
+           "dependencies": {
46
+               "@jridgewell/gen-mapping": "^0.3.0",
47
+               "@jridgewell/trace-mapping": "^0.3.9"
48
+           },
49
+           "engines": {
50
+               "node": ">=6.0.0"
51
+           }
52
+       },
53
+       "node_modules/@esbuild/android-arm": {
54
+           "version": "0.18.20",
55
+           "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz",
56
+           "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==",
57
+           "cpu": 
58
+               "arm"
59
+           ,
60
+           "dev": true,
61
+           "optional": true,
62
+           "os": 
63
+               "android"
64
+           ,
65
+           "engines": {
66
+               "node": ">=12"
67
+           }
68
+       },
69
+       "node_modules/@esbuild/android-arm64": {
70
+           "version": "0.18.20",
71
+           "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz",
72
+           "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==",
73
+           "cpu": 
74
+               "arm64"
75
+           ,
76
+           "dev": true,
77
+           "optional": true,
78
+           "os": 
79
+               "android"
80
+           ,
81
+           "engines": {
82
+               "node": ">=12"
83
+           }
84
+       },
85
+       "node_modules/@esbuild/android-x64": {
86
+           "version": "0.18.20",
87
+           "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz",
88
+           "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==",
89
+           "cpu": 
90
+               "x64"
91
+           ,
92
+           "dev": true,
93
+           "optional": true,
94
+           "os": 
95
+               "android"
96
+           ,
97
+           "engines": {
98
+               "node": ">=12"
99
+           }
100
+       },
101
+       "node_modules/@esbuild/darwin-arm64": {
102
+           "version": "0.18.20",
103
+           "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz",
104
+           "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==",
105
+           "cpu": 
106
+               "arm64"
107
+           ,
108
+           "dev": true,
109
+           "optional": true,
110
+           "os": 
111
+               "darwin"
112
+           ,
113
+           "engines": {
114
+               "node": ">=12"
115
+           }
116
+       },
117
+       "node_modules/@esbuild/darwin-x64": {
118
+           "version": "0.18.20",
119
+           "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz",
120
+           "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==",
121
+           "cpu": 
122
+               "x64"
123
+           ,
124
+           "dev": true,
125
+           "optional": true,
126
+           "os": 
127
+               "darwin"
128
+           ,
129
+           "engines": {
130
+               "node": ">=12"
131
+           }
132
+       },
133
+       "node_modules/@esbuild/freebsd-arm64": {
134
+           "version": "0.18.20",
135
+           "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz",
136
+           "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==",
137
+           "cpu": 
138
+               "arm64"
139
+           ,
140
+           "dev": true,
141
+           "optional": true,
142
+           "os": 
143
+               "freebsd"
144
+           ,
145
+           "engines": {
146
+               "node": ">=12"
147
+           }
148
+       },
149
+       "node_modules/@esbuild/freebsd-x64": {
150
+           "version": "0.18.20",
151
+           "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz",
152
+           "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==",
153
+           "cpu": 
154
+               "x64"
155
+           ,
156
+           "dev": true,
157
+           "optional": true,
158
+           "os": 
159
+               "freebsd"
160
+           ,
161
+           "engines": {
162
+               "node": ">=12"
163
+           }
164
+       },
165
+       "node_modules/@esbuild/linux-arm": {
166
+           "version": "0.18.20",
167
+           "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz",
168
+           "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==",
169
+           "cpu": 
170
+               "arm"
171
+           ,
172
+           "dev": true,
173
+           "optional": true,
174
+           "os": 
175
+               "linux"
176
+           ,
177
+           "engines": {
178
+               "node": ">=12"
179
+           }
180
+       },
181
+       "node_modules/@esbuild/linux-arm64": {
182
+           "version": "0.18.20",
183
+           "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz",
184
+           "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==",
185
+           "cpu": 
186
+               "arm64"
187
+           ,
188
+           "dev": true,
189
+           "optional": true,
190
+           "os": 
191
+               "linux"
192
+           ,
193
+           "engines": {
194
+               "node": ">=12"
195
+           }
196
+       },
197
+       "node_modules/@esbuild/linux-ia32": {
198
+           "version": "0.18.20",
199
+           "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz",
200
+           "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==",
201
obs-backgroundremoval-1.1.13.tar.gz/pages/package.json Added
35
 
1
@@ -0,0 +1,33 @@
2
+{
3
+   "name": "pages",
4
+   "version": "0.0.1",
5
+   "scripts": {
6
+       "dev": "vite dev",
7
+       "build": "vite build",
8
+       "preview": "vite preview",
9
+       "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10
+       "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11
+       "lint": "prettier --plugin-search-dir . --check . && eslint .",
12
+       "format": "prettier --plugin-search-dir . --write ."
13
+   },
14
+   "devDependencies": {
15
+       "@fontsource/fira-mono": "^4.5.10",
16
+       "@neoconfetti/svelte": "^1.0.0",
17
+       "@sveltejs/adapter-static": "^2.0.3",
18
+       "@sveltejs/kit": "^1.20.4",
19
+       "@types/cookie": "^0.5.1",
20
+       "@typescript-eslint/eslint-plugin": "^6.0.0",
21
+       "@typescript-eslint/parser": "^6.0.0",
22
+       "eslint": "^8.28.0",
23
+       "eslint-config-prettier": "^8.5.0",
24
+       "eslint-plugin-svelte": "^2.30.0",
25
+       "prettier": "^2.8.0",
26
+       "prettier-plugin-svelte": "^2.10.1",
27
+       "svelte": "^4.0.5",
28
+       "svelte-check": "^3.4.3",
29
+       "tslib": "^2.4.1",
30
+       "typescript": "^5.0.0",
31
+       "vite": "^4.4.2"
32
+   },
33
+   "type": "module"
34
+}
35
obs-backgroundremoval-1.1.13.tar.gz/pages/src Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/app.d.ts Added
14
 
1
@@ -0,0 +1,12 @@
2
+// See https://kit.svelte.dev/docs/types#app
3
+// for information about these interfaces
4
+declare global {
5
+   namespace App {
6
+       // interface Error {}
7
+       // interface Locals {}
8
+       // interface PageData {}
9
+       // interface Platform {}
10
+   }
11
+}
12
+
13
+export {};
14
obs-backgroundremoval-1.1.13.tar.gz/pages/src/app.html Added
14
 
1
@@ -0,0 +1,12 @@
2
+<!DOCTYPE html>
3
+<html lang="en">
4
+   <head>
5
+       <meta charset="utf-8" />
6
+       <link rel="icon" href="%sveltekit.assets%/favicon.png" />
7
+       <meta name="viewport" content="width=device-width" />
8
+       %sveltekit.head%
9
+   </head>
10
+   <body data-sveltekit-preload-data="hover">
11
+       <div style="display: contents">%sveltekit.body%</div>
12
+   </body>
13
+</html>
14
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/github-release.ts Added
35
 
1
@@ -0,0 +1,33 @@
2
+interface GitHubLatestReleaseAsset {
3
+   readonly browser_download_url: string;
4
+   readonly name: string;
5
+}
6
+
7
+export interface GitHubLatestReleaseResult {
8
+   readonly assets: GitHubLatestReleaseAsset;
9
+}
10
+
11
+function getHeaders(): Record<string, string> {
12
+   const { GITHUB_TOKEN } = process.env;
13
+   if (GITHUB_TOKEN) {
14
+       return {
15
+           authorization: `Bearer ${GITHUB_TOKEN}`
16
+       };
17
+   } else {
18
+       return {};
19
+   }
20
+}
21
+
22
+export async function getLatestReleaseMetadata(
23
+   owner: string = 'occ-ai',
24
+   repo: string = 'obs-backgroundremoval'
25
+): Promise<GitHubLatestReleaseResult> {
26
+   const url = `https://api.github.com/repos/${owner}/${repo}/releases/latest`;
27
+   const response = await fetch(url, { headers: getHeaders() });
28
+   const json = await response.json();
29
+   if (!response.ok) {
30
+       console.error(json);
31
+       throw new Error(`The latest release of ${owner}/${repo} cannot be retrieved!`);
32
+   }
33
+   return json;
34
+}
35
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/addAVideoCaptureSource.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/addBackgroundRemoval.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/captureFilters.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/checkDll.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/filterSettings.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/filterSettingsAdvanced.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/github.svg Added
19
 
1
@@ -0,0 +1,16 @@
2
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-3 -3 30 30">
3
+   <path
4
+       fill-rule="evenodd"
5
+       clip-rule="evenodd"
6
+       d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5229 6.47715 22 12 22C17.5229 22 22 17.5229 22 12C22 6.47715 17.5229 2 12 2ZM0 12C0 5.3726 5.3726 0 12 0C18.6274 0 24 5.3726 24 12C24 18.6274 18.6274 24 12 24C5.3726 24 0 18.6274 0 12Z"
7
+       fill="rgba(0,0,0,0.7)"
8
+       stroke="none"
9
+   />
10
+   <path
11
+       fill-rule="evenodd"
12
+       clip-rule="evenodd"
13
+       d="M9.59162 22.7357C9.49492 22.6109 9.49492 21.4986 9.59162 19.399C8.55572 19.4347 7.90122 19.3628 7.62812 19.1833C7.21852 18.9139 6.80842 18.0833 6.44457 17.4979C6.08072 16.9125 5.27312 16.8199 4.94702 16.6891C4.62091 16.5582 4.53905 16.0247 5.84562 16.4282C7.15222 16.8316 7.21592 17.9303 7.62812 18.1872C8.04032 18.4441 9.02572 18.3317 9.47242 18.1259C9.91907 17.9201 9.88622 17.1538 9.96587 16.8503C10.0666 16.5669 9.71162 16.5041 9.70382 16.5018C9.26777 16.5018 6.97697 16.0036 6.34772 13.7852C5.71852 11.5669 6.52907 10.117 6.96147 9.49369C7.24972 9.07814 7.22422 8.19254 6.88497 6.83679C8.11677 6.67939 9.06732 7.06709 9.73672 7.99999C9.73737 8.00534 10.6143 7.47854 12.0001 7.47854C13.386 7.47854 13.8777 7.90764 14.2571 7.99999C14.6365 8.09234 14.94 6.36699 17.2834 6.83679C16.7942 7.79839 16.3844 8.99999 16.6972 9.49369C17.0099 9.98739 18.2372 11.5573 17.4833 13.7852C16.9807 15.2706 15.9927 16.1761 14.5192 16.5018C14.3502 16.5557 14.2658 16.6427 14.2658 16.7627C14.2658 16.9427 14.4942 16.9624 14.8233 17.8058C15.0426 18.368 15.0585 19.9739 14.8708 22.6234C14.3953 22.7445 14.0254 22.8257 13.7611 22.8673C13.2924 22.9409 12.7835 22.9822 12.2834 22.9982C11.7834 23.0141 11.6098 23.0123 10.9185 22.948C10.4577 22.9051 10.0154 22.8343 9.59162 22.7357Z"
14
+       fill="rgba(0,0,0,0.7)"
15
+       stroke="none"
16
+   />
17
+</svg>
18
\ No newline at end of file
19
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/installWizard.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/lib/images/runUnkPublisher.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/+layout.svelte Added
33
 
1
@@ -0,0 +1,31 @@
2
+<script>
3
+   import Header from './Header.svelte';
4
+   import './styles.css';
5
+</script>
6
+
7
+<div class="app">
8
+   <Header />
9
+
10
+   <main>
11
+       <slot />
12
+   </main>
13
+</div>
14
+
15
+<style>
16
+   .app {
17
+       display: flex;
18
+       flex-direction: column;
19
+       min-height: 100vh;
20
+   }
21
+
22
+   main {
23
+       flex: 1;
24
+       display: flex;
25
+       flex-direction: column;
26
+       padding: 1rem;
27
+       width: 100%;
28
+       max-width: 64rem;
29
+       margin: 0 auto;
30
+       box-sizing: border-box;
31
+   }
32
+</style>
33
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/+page.svelte Added
49
 
1
@@ -0,0 +1,47 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+</script>
5
+
6
+<svelte:head>
7
+   <title>OBS Background Removal</title>
8
+   <meta
9
+       name="description"
10
+       content="OBS Plugin: Background Removal / Virtual Green-screen and Low-Light Enhancement"
11
+   />
12
+</svelte:head>
13
+
14
+<section>
15
+   <header>
16
+       <h1>OBS Background Removal</h1>
17
+       <h2>
18
+           OBS Plugin: Background Removal / Virtual Green-screen and Low-Light Enhancement
19
+       </h2>
20
+   </header>
21
+
22
+    <p>See our <a href="{base}/usage">Usage</a> page for instructions on usage in OBS</p>
23
+
24
+   <h1>Download and Install (Official)</h1>
25
+   <a href="{base}/windows"><h2>Windows</h2></a>
26
+   <a href="{base}/macos"><h2>macOS</h2></a>
27
+   <a href="{base}/ubuntu"><h2>Ubuntu Linux</h2></a>
28
+   <a href="{base}/flatpak"><h2>FlatPak</h2></a>
29
+
30
+   <h1>Download and Install (Unofficial)</h1>
31
+   <a href="{base}/arch"><h2>Arch Linux</h2></a>
32
+   <a href="{base}/opensuse-tumbleweed"><h2>openSUSE Tumbleweed</h2></a>
33
+   <a href="{base}/fedora"><h2>Fedora</h2></a>
34
+</section>
35
+
36
+<style>
37
+   section {
38
+       display: flex;
39
+       flex-direction: column;
40
+       justify-content: center;
41
+       align-items: center;
42
+       flex: 0.6;
43
+   }
44
+
45
+   h1 {
46
+       width: 100%;
47
+   }
48
+</style>
49
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/+page.ts Added
5
 
1
@@ -0,0 +1,3 @@
2
+// since there's no dynamic data here, we can prerender
3
+// it so that it gets served as a static asset in production
4
+export const prerender = true;
5
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/Header.svelte Added
53
 
1
@@ -0,0 +1,51 @@
2
+<script>
3
+   import github from '$lib/images/github.svg';
4
+</script>
5
+
6
+<header>
7
+   <div class="corner" />
8
+
9
+   <nav />
10
+
11
+   <div class="corner">
12
+       <a href="https://github.com/obs-ai/obs-backgroundremoval">
13
+           <img src={github} alt="GitHub" />
14
+       </a>
15
+   </div>
16
+</header>
17
+
18
+<style>
19
+   header {
20
+       display: flex;
21
+       justify-content: space-between;
22
+   }
23
+
24
+   .corner {
25
+       width: 3em;
26
+       height: 3em;
27
+   }
28
+
29
+   .corner a {
30
+       display: flex;
31
+       align-items: center;
32
+       justify-content: center;
33
+       width: 100%;
34
+       height: 100%;
35
+   }
36
+
37
+   .corner img {
38
+       width: 2em;
39
+       height: 2em;
40
+       object-fit: contain;
41
+   }
42
+
43
+   nav {
44
+       display: flex;
45
+       justify-content: center;
46
+       --background: rgba(255, 255, 255, 0.7);
47
+   }
48
+
49
+   a:hover {
50
+       color: var(--color-theme-1);
51
+   }
52
+</style>
53
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/arch Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/arch/+page.svelte Added
41
 
1
@@ -0,0 +1,39 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+</script>
5
+
6
+<svelte:head>
7
+   <title>How to use OBS Background Removal on Arch Linux</title>
8
+   <meta name="description" content="How to use OBS Background Removal on Arch Linux" />
9
+</svelte:head>
10
+
11
+<div class="text-column">
12
+   <h1>Download and install on Arch Linux</h1>
13
+
14
+   <p>
15
+       <a
16
+           href="https://github.com/obsproject/obs-studio/wiki/Unofficial-Linux-Builds#arch-linuxmanjaro"
17
+           >Install the latest OBS by following the guide of unofficial builds</a
18
+       >
19
+   </p>
20
+
21
+   <p>
22
+       <a href="https://aur.archlinux.org/packages/obs-backgroundremoval"
23
+           >Download PKGBUILD of obs-backgroundremoval from AUR</a
24
+       >
25
+   </p>
26
+
27
+   <p>Build your package by running:</p>
28
+
29
+   <pre>makepkg --syncdeps</pre>
30
+
31
+   <p>Install your package by running:</p>
32
+
33
+   <pre>makepkg --install</pre>
34
+
35
+   <p>See the <a href="{base}/usage">usage page</a> for how to use the plugin</p>
36
+
37
+   <p>All set!</p>
38
+
39
+   <p><a href="{base}/">Back to the top page</a></p>
40
+</div>
41
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/arch/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/fedora Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/fedora/+page.svelte Added
36
 
1
@@ -0,0 +1,34 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+</script>
5
+
6
+<svelte:head>
7
+   <title>How to use OBS Background Removal on Fedora</title>
8
+   <meta name="description" content="How to use OBS Background Removal on Fedora" />
9
+</svelte:head>
10
+
11
+<div class="text-column">
12
+   <h1>Download and install on Fedora</h1>
13
+
14
+   <p>You need to build the obs-backgroundremoval plugin by yourself</p>
15
+
16
+   <p>
17
+       <a href="https://github.com/obsproject/obs-studio/wiki/Unofficial-Linux-Builds#fedora"
18
+           >Install the latest OBS by following the guide of unofficial builds</a
19
+       >
20
+   </p>
21
+
22
+   <p>
23
+       <a href="https://github.com/obs-ai/obs-backgroundremoval/blob/main/docs/BUILDING-FEDORA.md"
24
+           >Build and install the obs-backgroundremoval plugin by following the guide on the repository</a
25
+       >
26
+   </p>
27
+
28
+   <p>Start your OBS</p>
29
+
30
+   <p>See the <a href="{base}/usage">usage page</a> for how to use the plugin</p>
31
+
32
+   <p>All set!</p>
33
+
34
+   <p><a href="{base}/">Back to the top page</a></p>
35
+</div>
36
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/fedora/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/flatpak Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/flatpak/+page.svelte Added
28
 
1
@@ -0,0 +1,26 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+</script>
5
+
6
+<svelte:head>
7
+   <title>How to use OBS Background Removal on FlatPak</title>
8
+   <meta name="description" content="How to use OBS Background Removal on FlatPak" />
9
+</svelte:head>
10
+
11
+<div class="text-column">
12
+   <h1>Download and install on FlatPak</h1>
13
+
14
+   <p>
15
+       <a href="https://flathub.org/apps/com.obsproject.Studio">Install the latest OBS from FlatHub</a>
16
+   </p>
17
+
18
+   <p>Install com.obsproject.Studio.Plugin.BackgroundRemoval from FlatHub:</p>
19
+
20
+   <pre>flatpak install flathub com.obsproject.Studio.Plugin.BackgroundRemoval</pre>
21
+
22
+   <p>See the <a href="{base}/usage">usage page</a> for how to use the plugin</p>
23
+
24
+   <p>All set!</p>
25
+
26
+   <p><a href="{base}/">Back to the top page</a></p>
27
+</div>
28
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/flatpak/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/macos Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/macos/+page.server.ts Added
8
 
1
@@ -0,0 +1,6 @@
2
+import { getLatestReleaseMetadata } from '../../lib/github-release';
3
+
4
+/** @type {import('./$types').PageLoad} */
5
+export async function load() {
6
+   return { metadata: await getLatestReleaseMetadata() };
7
+}
8
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/macos/+page.svelte Added
34
 
1
@@ -0,0 +1,32 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+   /** @type {import('./$types').PageData} */
5
+   export let data;
6
+   const asset = data.metadata.assets.find((e) => /macos-universal\.pkg/.test(e.name));
7
+   if (!asset) throw new Error('Ubuntu asset not found!');
8
+</script>
9
+
10
+<svelte:head>
11
+   <title>How to use OBS Background Removal on macOS</title>
12
+   <meta name="description" content="How to use OBS Background Removal on macOS" />
13
+</svelte:head>
14
+
15
+<div class="text-column">
16
+   <h1>Download and install on macOS</h1>
17
+
18
+   <p>
19
+       <a href="https://obsproject.com/ja/download"
20
+           >Downlaod and install the latest OBS (Both of Intel and Apple Silicon are applicable)</a
21
+       >
22
+   </p>
23
+
24
+   <p><a href={asset.browser_download_url}>Download the pkg installer for macOS</a></p>
25
+
26
+   <p>Install {asset.name}</p>
27
+
28
+   <p>See the <a href="{base}/usage">usage page</a> for how to use the plugin</p>
29
+
30
+   <p>All set!</p>
31
+
32
+   <p><a href="{base}/">Back to the top page</a></p>
33
+</div>
34
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/macos/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/opensuse-tumbleweed Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/opensuse-tumbleweed/+page.svelte Added
35
 
1
@@ -0,0 +1,33 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+   /** @type {import('./$types').PageData} */
5
+</script>
6
+
7
+<svelte:head>
8
+   <title>How to use OBS Background Removal on openSUSE Tumbleweed</title>
9
+   <meta name="description" content="How to use OBS Background Removal on openSUSE Tumbleweed" />
10
+</svelte:head>
11
+
12
+<div class="text-column">
13
+   <h1>Download and install on openSUSE Tumbleweed</h1>
14
+
15
+   <p>You need to build the obs-backgroundremoval plugin by yourself</p>
16
+
17
+   <p>
18
+       <a href="https://github.com/obsproject/obs-studio/wiki/Unofficial-Linux-Builds#opensuse"
19
+           >Install the latest OBS by following the guide of unofficial builds</a
20
+       >
21
+   </p>
22
+
23
+   <p>
24
+       <a href="https://github.com/obs-ai/obs-backgroundremoval/blob/main/docs/BUILDING-OPENSUSE.md"
25
+           >Build and install the obs-backgroundremoval plugin by following the guide on the repository</a
26
+       >
27
+   </p>
28
+
29
+   <p>See the <a href="{base}/usage">usage page</a> for how to use the plugin</p>
30
+
31
+   <p>All set!</p>
32
+
33
+   <p><a href="{base}/">Back to the top page</a></p>
34
+</div>
35
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/opensuse-tumbleweed/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/styles.css Added
109
 
1
@@ -0,0 +1,107 @@
2
+@import '@fontsource/fira-mono';
3
+
4
+:root {
5
+   --font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
6
+       Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
7
+   --font-mono: 'Fira Mono', monospace;
8
+   --color-bg-0: rgb(202, 216, 228);
9
+   --color-bg-1: hsl(209, 36%, 86%);
10
+   --color-bg-2: hsl(224, 44%, 95%);
11
+   --color-theme-1: #ff3e00;
12
+   --color-theme-2: #4075a6;
13
+   --color-text: rgba(0, 0, 0, 0.7);
14
+   --column-width: 42rem;
15
+   --column-margin-top: 4rem;
16
+   font-family: var(--font-body);
17
+   color: var(--color-text);
18
+}
19
+
20
+body {
21
+   min-height: 100vh;
22
+   margin: 0;
23
+   background-attachment: fixed;
24
+   background-color: var(--color-bg-1);
25
+   background-size: 100vw 100vh;
26
+   background-image: radial-gradient(
27
+           50% 50% at 50% 50%,
28
+           rgba(255, 255, 255, 0.75) 0%,
29
+           rgba(255, 255, 255, 0) 100%
30
+       ),
31
+       linear-gradient(180deg, var(--color-bg-0) 0%, var(--color-bg-1) 15%, var(--color-bg-2) 50%);
32
+}
33
+
34
+h1,
35
+h2,
36
+p {
37
+   font-weight: 400;
38
+}
39
+
40
+p {
41
+   line-height: 1.5;
42
+}
43
+
44
+a {
45
+   color: var(--color-theme-1);
46
+   text-decoration: none;
47
+}
48
+
49
+a:hover {
50
+   text-decoration: underline;
51
+}
52
+
53
+h1 {
54
+   font-size: 2rem;
55
+   text-align: center;
56
+}
57
+
58
+h2 {
59
+   font-size: 1rem;
60
+}
61
+
62
+pre {
63
+   font-size: 16px;
64
+   font-family: var(--font-mono);
65
+   background-color: rgba(255, 255, 255, 0.45);
66
+   border-radius: 3px;
67
+   box-shadow: 2px 2px 6px rgb(255 255 255 / 25%);
68
+   padding: 0.5em;
69
+   overflow-x: auto;
70
+   color: var(--color-text);
71
+}
72
+
73
+.text-column {
74
+   display: flex;
75
+   max-width: 48rem;
76
+   flex: 0.6;
77
+   flex-direction: column;
78
+   justify-content: center;
79
+   margin: 0 auto;
80
+}
81
+
82
+input,
83
+button {
84
+   font-size: inherit;
85
+   font-family: inherit;
86
+}
87
+
88
+button:focus:not(:focus-visible) {
89
+   outline: none;
90
+}
91
+
92
+@media (min-width: 720px) {
93
+   h1 {
94
+       font-size: 2.4rem;
95
+   }
96
+}
97
+
98
+.visually-hidden {
99
+   border: 0;
100
+   clip: rect(0 0 0 0);
101
+   height: auto;
102
+   margin: 0;
103
+   overflow: hidden;
104
+   padding: 0;
105
+   position: absolute;
106
+   width: 1px;
107
+   white-space: nowrap;
108
+}
109
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/ubuntu Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/ubuntu/+page.server.ts Added
8
 
1
@@ -0,0 +1,6 @@
2
+import { getLatestReleaseMetadata } from '../../lib/github-release';
3
+
4
+/** @type {import('./$types').PageLoad} */
5
+export async function load() {
6
+   return { metadata: await getLatestReleaseMetadata() };
7
+}
8
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/ubuntu/+page.svelte Added
30
 
1
@@ -0,0 +1,28 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+   /** @type {import('./$types').PageData} */
5
+   export let data;
6
+   const asset = data.metadata.assets.find((e) => /x86_64-linux-gnu\.deb/.test(e.name));
7
+   if (!asset) throw new Error('Ubuntu asset not found!');
8
+</script>
9
+
10
+<svelte:head>
11
+   <title>How to use OBS Background Removal on Ubuntu Linux</title>
12
+   <meta name="description" content="How to use OBS Background Removal on Ubuntu Linux" />
13
+</svelte:head>
14
+
15
+<div class="text-column">
16
+   <h1>Download and install on Ubuntu Linux</h1>
17
+
18
+   <p><a href="https://obsproject.com/ja/download">Install the latest OBS from PPA</a></p>
19
+
20
+   <p><a href={asset.browser_download_url}>Download the deb package for Ubuntu Linux</a></p>
21
+
22
+   <p>Install {asset.name}</p>
23
+
24
+   <p>See the <a href="{base}/usage">usage page</a> for how to use the plugin</p>
25
+
26
+   <p>All set!</p>
27
+
28
+   <p><a href="{base}/">Back to the top page</a></p>
29
+</div>
30
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/ubuntu/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/usage Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/usage/+page.svelte Added
68
 
1
@@ -0,0 +1,66 @@
2
+<script>
3
+    import { base } from '$app/paths';
4
+    import addAVideoCaptureSource from '$lib/images/addAVideoCaptureSource.png';
5
+    import addBackgroundRemoval from '$lib/images/addBackgroundRemoval.png';
6
+    import captureFilters from '$lib/images/captureFilters.png';
7
+    import filterSettings from '$lib/images/filterSettings.png';
8
+    import filterSettingsAdvanced from '$lib/images/filterSettingsAdvanced.png';
9
+    import installWizard from '$lib/images/installWizard.png';
10
+    import runUnkPublisher from '$lib/images/runUnkPublisher.png';
11
+</script>
12
+
13
+<svelte:head>
14
+    <title>How to use OBS Background Removal</title>
15
+    <meta name="description" content="How to use OBS Background Removal" />
16
+</svelte:head>
17
+
18
+<div class="text-column">
19
+    <h1>Using OBS Background Removal</h1>
20
+
21
+    <p>Start OBS</p>
22
+
23
+    <p>Optionally add a video capture source. The plugin works on any source that provides an image render: Video,
24
+        Image, Media, Browser, Screen Capture, etc.</p>
25
+
26
+    <p><img src={addAVideoCaptureSource} width="400" /></p>
27
+
28
+    <p>Open the filters dialog on that source</p>
29
+
30
+    <p><img src={captureFilters} width="400" /></p>
31
+
32
+    <p>Add the Background Removal filter on the Effects filter. If you can't see the filter then the installation
33
+        process failed, or there is incompatibility with your OBS.</p>
34
+
35
+    <p><img src={addBackgroundRemoval} width="400" /></p>
36
+
37
+    <p>View the BG Removal filter settings</p>
38
+
39
+    <p><img src={filterSettings} width="400" /></p>
40
+
41
+    <p>Optionally use the advanced settings to change the behavior of the filter</p>
42
+
43
+    <p><img src={filterSettingsAdvanced} width="400" /></p>
44
+
45
+    <p>
46
+        Advice on how to get the best results:
47
+        <ul>
48
+            <li>Use a good camera, and good lighting.</li>
49
+            <li>The Mediapipe model is the fastest, but may not be the highest accuracy. We recommend setting the thresold
50
+                very low, like 0.05, to capture the whole portrait.</li>
51
+            <li>The Robust Video Matting (RVM) model gives the highest accuracy and also least "flickering", but it's not
52
+                the fastest.</li>
53
+            <li>The TCMonoDepth is a depth estimation model, not a background segmentation model, and can be used both for
54
+                portrait segmentation as well as "Depth of Field" blur effect. See the <a
55
+                    href="https://youtu.be/jC3EKSpNjQk" target="_blank">tutorial/preview</a>.</li>
56
+            <li>The RMBG model is a general background Removal model for any object, not just for humans. See the
57
+                <a href="https://youtu.be/N74VCDCToX8">tutorial/preview</a>.</li>
58
+        </ul>
59
+
60
+    <p>
61
+        View our tutorial videos <a href="https://youtu.be/veqNEsMqEE0">here</a>
62
+    </p>
63
+
64
+    <p>All set!</p>
65
+
66
+    <p><a href="{base}/">Back to the top page</a></p>
67
+</div>
68
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/usage/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/windows Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/windows/+page.server.ts Added
8
 
1
@@ -0,0 +1,6 @@
2
+import { getLatestReleaseMetadata } from '../../lib/github-release';
3
+
4
+/** @type {import('./$types').PageLoad} */
5
+export async function load() {
6
+   return { metadata: await getLatestReleaseMetadata() };
7
+}
8
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/windows/+page.svelte Added
54
 
1
@@ -0,0 +1,52 @@
2
+<script>
3
+   import { base } from '$app/paths';
4
+   /** @type {import('./$types').PageData} */
5
+   export let data;
6
+   const asset = data.metadata.assets.find((e) => /windows-x64-Installer\.exe/.test(e.name));
7
+   if (!asset) throw new Error('Windows asset not found!');
8
+    import addAVideoCaptureSource from '$lib/images/addAVideoCaptureSource.png';
9
+    import addBackgroundRemoval from '$lib/images/addBackgroundRemoval.png';
10
+    import captureFilters from '$lib/images/captureFilters.png';
11
+    import filterSettings from '$lib/images/filterSettings.png';
12
+    import filterSettingsAdvanced from '$lib/images/filterSettingsAdvanced.png';
13
+    import installWizard from '$lib/images/installWizard.png';
14
+    import runUnkPublisher from '$lib/images/runUnkPublisher.png';
15
+    import checkDll from '$lib/images/checkDll.png';
16
+</script>
17
+
18
+<svelte:head>
19
+   <title>How to use OBS Background Removal on Windows</title>
20
+   <meta name="description" content="How to use OBS Background Removal on Windows" />
21
+</svelte:head>
22
+
23
+<div class="text-column">
24
+   <h1>Download and install on Windows</h1>
25
+
26
+    <p>The plugin supports OBS v29.x+ and a 64bit Windows</p>
27
+
28
+   <p><a href="https://obsproject.com/ja/download">Downlaod and install the latest OBS for 64bit</a></p>
29
+
30
+   <p><a href={asset.browser_download_url}>Download the installer for Windows</a></p>
31
+
32
+   <p>Execute {asset.name}. Allow it to run even if the publisher is unknown.</p>
33
+
34
+    <p><img src={runUnkPublisher} width="400" /></p>
35
+
36
+    <p>Follow the install wizard</p>
37
+
38
+    <p><img src={installWizard} width="400" /></p>
39
+
40
+    <p>Optionally ensure that the obs-backgroundremoval.dll exists in the OBS plugins folder:</p>
41
+
42
+    <p><code>C:\Program Files\obs-studio\obs-plugins\64bit\obs-backgroundremoval.dll</code></p>
43
+
44
+    <p><img src="{checkDll}" width="400" /></p>
45
+
46
+    <p>If your OBS is installed in <code>C:\Program Files (x86)\obs-studio</code> then consider re-installing the latest version of OBS 64bit.</p>
47
+
48
+   <p>See the <a href="{base}/usage">usage page</a> for how to use the plugin</p>
49
+
50
+   <p>All set!</p>
51
+
52
+   <p><a href="{base}/">Back to the top page</a></p>
53
+</div>
54
obs-backgroundremoval-1.1.13.tar.gz/pages/src/routes/windows/+page.ts Added
11
 
1
@@ -0,0 +1,9 @@
2
+import { dev } from '$app/environment';
3
+
4
+// we don't need any JS on this page, though we'll load
5
+// it in dev so that we get hot module replacement
6
+export const csr = dev;
7
+
8
+// since there's no dynamic data here, we can prerender
9
+// it so that it gets served as a static asset in production
10
+export const prerender = true;
11
obs-backgroundremoval-1.1.13.tar.gz/pages/static Added
2
 
1
+(directory)
2
obs-backgroundremoval-1.1.13.tar.gz/pages/static/favicon.png Added
obs-backgroundremoval-1.1.13.tar.gz/pages/static/robots.txt Added
5
 
1
@@ -0,0 +1,3 @@
2
+# https://www.robotstxt.org/robotstxt.html
3
+User-agent: *
4
+Disallow:
5
obs-backgroundremoval-1.1.13.tar.gz/pages/svelte.config.js Added
19
 
1
@@ -0,0 +1,17 @@
2
+import adapter from '@sveltejs/adapter-static';
3
+import { vitePreprocess } from '@sveltejs/kit/vite';
4
+
5
+/** @type {import('@sveltejs/kit').Config} */
6
+const config = {
7
+   preprocess: vitePreprocess(),
8
+
9
+   kit: {
10
+       adapter: adapter(),
11
+
12
+       paths: {
13
+           base: '/obs-backgroundremoval'
14
+       }
15
+   }
16
+};
17
+
18
+export default config;
19
obs-backgroundremoval-1.1.13.tar.gz/pages/tsconfig.json Added
19
 
1
@@ -0,0 +1,17 @@
2
+{
3
+   "extends": "./.svelte-kit/tsconfig.json",
4
+   "compilerOptions": {
5
+       "allowJs": true,
6
+       "checkJs": true,
7
+       "esModuleInterop": true,
8
+       "forceConsistentCasingInFileNames": true,
9
+       "resolveJsonModule": true,
10
+       "skipLibCheck": true,
11
+       "sourceMap": true,
12
+       "strict": true
13
+   }
14
+   // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
15
+   //
16
+   // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
17
+   // from the referenced tsconfig.json - TypeScript does not merge them in
18
+}
19
obs-backgroundremoval-1.1.13.tar.gz/pages/vite.config.ts Added
8
 
1
@@ -0,0 +1,6 @@
2
+import { sveltekit } from '@sveltejs/kit/vite';
3
+import { defineConfig } from 'vite';
4
+
5
+export default defineConfig({
6
+   plugins: sveltekit()
7
+});
8
obs-backgroundremoval-1.1.13.tar.gz/patch_libobs.diff Added
14
 
1
@@ -0,0 +1,12 @@
2
+diff --git a/libobs/CMakeLists.txt b/libobs/CMakeLists.txt
3
+index d2e2671..a08d948 100644
4
+--- a/libobs/CMakeLists.txt
5
++++ b/libobs/CMakeLists.txt
6
+@@ -287,6 +287,7 @@ set(public_headers
7
+     util/base.h
8
+     util/bmem.h
9
+     util/c99defs.h
10
++    util/config-file.h
11
+     util/darray.h
12
+     util/profiler.h
13
+     util/sse-intrin.h
14
obs-backgroundremoval-1.1.6.tar.gz/src/FilterData.h -> obs-backgroundremoval-1.1.13.tar.gz/src/FilterData.h Changed
13
 
1
@@ -30,9 +30,9 @@
2
    std::mutex outputLock;
3
 
4
 #if _WIN32
5
-   const wchar_t *modelFilepath = nullptr;
6
+   std::wstring modelFilepath;
7
 #else
8
-   const char *modelFilepath = nullptr;
9
+   std::string modelFilepath;
10
 #endif
11
 };
12
 
13
obs-backgroundremoval-1.1.6.tar.gz/src/background-filter.cpp -> obs-backgroundremoval-1.1.13.tar.gz/src/background-filter.cpp Changed
201
 
1
@@ -14,6 +14,8 @@
2
 #include <fstream>
3
 #include <new>
4
 #include <mutex>
5
+#include <regex>
6
+#include <thread>
7
 
8
 #include <plugin-support.h>
9
 #include "models/ModelSINET.h"
10
@@ -22,10 +24,12 @@
11
 #include "models/ModelRVM.h"
12
 #include "models/ModelPPHumanSeg.h"
13
 #include "models/ModelTCMonoDepth.h"
14
+#include "models/ModelRMBG.h"
15
 #include "FilterData.h"
16
 #include "ort-utils/ort-session-utils.h"
17
 #include "obs-utils/obs-utils.h"
18
 #include "consts.h"
19
+#include "update-checker/update-checker.h"
20
 
21
 struct background_removal_filter : public filter_data {
22
    bool enableThreshold = true;
23
@@ -36,17 +40,26 @@
24
    float feather = 0.0f;
25
 
26
    cv::Mat backgroundMask;
27
+   cv::Mat lastBackgroundMask;
28
+   cv::Mat lastImageBGRA;
29
+   float temporalSmoothFactor = 0.0f;
30
+   float imageSimilarityThreshold = 35.0f;
31
+   bool enableImageSimilarity = true;
32
    int maskEveryXFrames = 1;
33
    int maskEveryXFramesCount = 0;
34
    int64_t blurBackground = 0;
35
-   bool enableFocalBlur = true;
36
+   bool enableFocalBlur = false;
37
    float blurFocusPoint = 0.1f;
38
    float blurFocusDepth = 0.1f;
39
 
40
    gs_effect_t *effect;
41
    gs_effect_t *kawaseBlurEffect;
42
+
43
+   std::mutex modelMutex;
44
 };
45
 
46
+void background_removal_thread(void *data); // Forward declaration
47
+
48
 const char *background_filter_getname(void *unused)
49
 {
50
    UNUSED_PARAMETER(unused);
51
@@ -55,18 +68,60 @@
52
 
53
 /**                   PROPERTIES                     */
54
 
55
+static bool visible_on_bool(obs_properties_t *ppts, obs_data_t *settings,
56
+               const char *bool_prop, const char *prop_name)
57
+{
58
+   const bool enabled = obs_data_get_bool(settings, bool_prop);
59
+   obs_property_t *p = obs_properties_get(ppts, prop_name);
60
+   obs_property_set_visible(p, enabled);
61
+   return true;
62
+}
63
+
64
 static bool enable_threshold_modified(obs_properties_t *ppts, obs_property_t *p,
65
                      obs_data_t *settings)
66
 {
67
-   const bool enabled = obs_data_get_bool(settings, "enable_threshold");
68
-   p = obs_properties_get(ppts, "threshold");
69
-   obs_property_set_visible(p, enabled);
70
-   p = obs_properties_get(ppts, "contour_filter");
71
-   obs_property_set_visible(p, enabled);
72
-   p = obs_properties_get(ppts, "smooth_contour");
73
-   obs_property_set_visible(p, enabled);
74
-   p = obs_properties_get(ppts, "feather");
75
-   obs_property_set_visible(p, enabled);
76
+   UNUSED_PARAMETER(p);
77
+   return visible_on_bool(ppts, settings, "enable_threshold",
78
+                  "threshold_group");
79
+}
80
+
81
+static bool enable_focal_blur(obs_properties_t *ppts, obs_property_t *p,
82
+                 obs_data_t *settings)
83
+{
84
+   UNUSED_PARAMETER(p);
85
+   return visible_on_bool(ppts, settings, "enable_focal_blur",
86
+                  "focal_blur_group");
87
+}
88
+
89
+static bool enable_image_similarity(obs_properties_t *ppts, obs_property_t *p,
90
+                   obs_data_t *settings)
91
+{
92
+   UNUSED_PARAMETER(p);
93
+   return visible_on_bool(ppts, settings, "enable_image_similarity",
94
+                  "image_similarity_threshold");
95
+}
96
+
97
+static bool enable_advanced_settings(obs_properties_t *ppts, obs_property_t *p,
98
+                    obs_data_t *settings)
99
+{
100
+   const bool enabled = obs_data_get_bool(settings, "advanced");
101
+   p = obs_properties_get(ppts, "blur_background");
102
+   obs_property_set_visible(p, true);
103
+
104
+   for (const char *prop_name :
105
+        {"model_select", "useGPU", "mask_every_x_frames", "numThreads",
106
+         "enable_focal_blur", "enable_threshold", "threshold_group",
107
+         "focal_blur_group", "temporal_smooth_factor",
108
+         "image_similarity_threshold", "enable_image_similarity"}) {
109
+       p = obs_properties_get(ppts, prop_name);
110
+       obs_property_set_visible(p, enabled);
111
+   }
112
+
113
+   if (enabled) {
114
+       enable_threshold_modified(ppts, p, settings);
115
+       enable_focal_blur(ppts, p, settings);
116
+       enable_image_similarity(ppts, p, settings);
117
+   }
118
 
119
    return true;
120
 }
121
@@ -75,28 +130,41 @@
122
 {
123
    obs_properties_t *props = obs_properties_create();
124
 
125
+   obs_property_t *advanced = obs_properties_add_bool(
126
+       props, "advanced", obs_module_text("Advanced"));
127
+
128
+   // If advanced is selected show the advanced settings, otherwise hide them
129
+   obs_property_set_modified_callback(advanced, enable_advanced_settings);
130
+
131
    /* Threshold props */
132
    obs_property_t *p_enable_threshold = obs_properties_add_bool(
133
        props, "enable_threshold", obs_module_text("EnableThreshold"));
134
    obs_property_set_modified_callback(p_enable_threshold,
135
                       enable_threshold_modified);
136
 
137
-   obs_properties_add_float_slider(props, "threshold",
138
+   // Threshold props group
139
+   obs_properties_t *threshold_props = obs_properties_create();
140
+
141
+   obs_properties_add_float_slider(threshold_props, "threshold",
142
                    obs_module_text("Threshold"), 0.0, 1.0,
143
                    0.025);
144
 
145
    obs_properties_add_float_slider(
146
-       props, "contour_filter",
147
+       threshold_props, "contour_filter",
148
        obs_module_text("ContourFilterPercentOfImage"), 0.0, 1.0,
149
        0.025);
150
 
151
-   obs_properties_add_float_slider(props, "smooth_contour",
152
+   obs_properties_add_float_slider(threshold_props, "smooth_contour",
153
                    obs_module_text("SmoothSilhouette"),
154
                    0.0, 1.0, 0.05);
155
 
156
    obs_properties_add_float_slider(
157
-       props, "feather", obs_module_text("FeatherBlendSilhouette"),
158
-       0.0, 1.0, 0.05);
159
+       threshold_props, "feather",
160
+       obs_module_text("FeatherBlendSilhouette"), 0.0, 1.0, 0.05);
161
+
162
+   obs_properties_add_group(props, "threshold_group",
163
+                obs_module_text("ThresholdGroup"),
164
+                OBS_GROUP_NORMAL, threshold_props);
165
 
166
    /* GPU, CPU and performance Props */
167
    obs_property_t *p_use_gpu = obs_properties_add_list(
168
@@ -145,6 +213,22 @@
169
    obs_property_list_add_string(p_model_select,
170
                     obs_module_text("TCMonoDepth"),
171
                     MODEL_DEPTH_TCMONODEPTH);
172
+   obs_property_list_add_string(p_model_select, obs_module_text("RMBG"),
173
+                    MODEL_RMBG);
174
+
175
+   obs_properties_add_float_slider(props, "temporal_smooth_factor",
176
+                   obs_module_text("TemporalSmoothFactor"),
177
+                   0.0, 1.0, 0.01);
178
+
179
+   obs_property_t *p_enable_image_similarity = obs_properties_add_bool(
180
+       props, "enable_image_similarity",
181
+       obs_module_text("EnableImageSimilarity"));
182
+   obs_property_set_modified_callback(p_enable_image_similarity,
183
+                      enable_image_similarity);
184
+
185
+   obs_properties_add_float_slider(
186
+       props, "image_similarity_threshold",
187
+       obs_module_text("ImageSimilarityThreshold"), 0.0, 100.0, 1.0);
188
 
189
    /* Background Blur Props */
190
    obs_properties_add_int_slider(
191
@@ -154,34 +238,43 @@
192
 
193
    obs_property_t *p_enable_focal_blur = obs_properties_add_bool(
194
        props, "enable_focal_blur", obs_module_text("EnableFocalBlur"));
195
-   obs_property_set_modified_callback(
196
-       p_enable_focal_blur,
197
-       (obs_properties_t *ppts, obs_property_t *p,
198
-          obs_data_t *settings) {
199
-           UNUSED_PARAMETER(p);
200
-           const bool enabled = obs_data_get_bool(
201
obs-backgroundremoval-1.1.6.tar.gz/src/consts.h -> obs-backgroundremoval-1.1.13.tar.gz/src/consts.h Changed
21
 
1
@@ -13,6 +13,7 @@
2
 const char *const MODEL_ENHANCE_ZERODCE = "models/zero_dce_180x320.onnx";
3
 const char *const MODEL_DEPTH_TCMONODEPTH =
4
    "models/tcmonodepth_tcsmallnet_192x320.onnx";
5
+const char *const MODEL_RMBG = "models/bria_rmbg_1_4_qint8.onnx";
6
 
7
 const char *const USEGPU_CPU = "cpu";
8
 const char *const USEGPU_DML = "dml";
9
@@ -24,4 +25,11 @@
10
 const char *const KAWASE_BLUR_EFFECT_PATH = "effects/kawase_blur.effect";
11
 const char *const BLEND_EFFECT_PATH = "effects/blend_images.effect";
12
 
13
+const char *const PLUGIN_INFO_TEMPLATE =
14
+   "<a href=\"https://github.com/occ-ai/obs-backgroundremoval/\">Background Removal</a> (%1) by "
15
+   "<a href=\"https://github.com/occ-ai\">OCC AI</a> ❤️ "
16
+   "<a href=\"https://www.patreon.com/RoyShilkrot\">Support & Follow</a>";
17
+const char *const PLUGIN_INFO_TEMPLATE_UPDATE_AVAILABLE =
18
+   "<center><a href=\"https://github.com/occ-ai/obs-backgroundremoval/releases\">🚀 Update available! (%1)</a></center>";
19
+
20
 #endif /* CONSTS_H */
21
obs-backgroundremoval-1.1.6.tar.gz/src/enhance-filter.cpp -> obs-backgroundremoval-1.1.13.tar.gz/src/enhance-filter.cpp Changed
56
 
1
@@ -14,6 +14,7 @@
2
 #include <fstream>
3
 #include <new>
4
 #include <mutex>
5
+#include <regex>
6
 
7
 #include <plugin-support.h>
8
 #include "consts.h"
9
@@ -22,6 +23,7 @@
10
 #include "models/ModelTBEFN.h"
11
 #include "models/ModelZeroDCE.h"
12
 #include "models/ModelURetinex.h"
13
+#include "update-checker/update-checker.h"
14
 
15
 struct enhance_filter : public filter_data {
16
    cv::Mat outputBGRA;
17
@@ -73,6 +75,20 @@
18
    obs_property_list_add_string(p_use_gpu, obs_module_text("CoreML"),
19
                     USEGPU_COREML);
20
 #endif
21
+
22
+   // Add a informative text about the plugin
23
+   // replace the placeholder with the current version using std::regex_replace
24
+   std::string basic_info = std::regex_replace(
25
+       PLUGIN_INFO_TEMPLATE, std::regex("%1"), PLUGIN_VERSION);
26
+   // Check for update
27
+   if (get_latest_version() != nullptr) {
28
+       basic_info += std::regex_replace(
29
+           PLUGIN_INFO_TEMPLATE_UPDATE_AVAILABLE, std::regex("%1"),
30
+           get_latest_version());
31
+   }
32
+   obs_properties_add_text(props, "info", basic_info.c_str(),
33
+               OBS_TEXT_INFO);
34
+
35
    return props;
36
 }
37
 
38
@@ -212,7 +228,7 @@
39
            return;
40
        }
41
    } catch (const std::exception &e) {
42
-       blog(LOG_ERROR, "Exception caught: %s", e.what());
43
+       obs_log(LOG_ERROR, "Exception caught: %s", e.what());
44
        return;
45
    }
46
 
47
@@ -257,7 +273,7 @@
48
            tf->outputBGRA.cols, tf->outputBGRA.rows, GS_BGRA, 1,
49
            (const uint8_t **)&tf->outputBGRA.data, 0);
50
        if (!outputTexture) {
51
-           blog(LOG_ERROR, "Failed to create output texture");
52
+           obs_log(LOG_ERROR, "Failed to create output texture");
53
            obs_source_skip_video_filter(tf->source);
54
            return;
55
        }
56
obs-backgroundremoval-1.1.6.tar.gz/src/models/Model.h -> obs-backgroundremoval-1.1.13.tar.gz/src/models/Model.h Changed
78
 
1
@@ -2,6 +2,7 @@
2
 #define MODEL_H
3
 
4
 #include <onnxruntime_cxx_api.h>
5
+#include "plugin-support.h"
6
 
7
 #ifdef _WIN32
8
 #include <wchar.h>
9
@@ -101,10 +102,14 @@
10
            obs_module_file(modelSelection.c_str());
11
 
12
        if (modelFilepath_rawPtr == nullptr) {
13
-           blog(LOG_ERROR,
14
-                "Unable to get model filename %s from plugin.",
15
-                modelSelection.c_str());
16
-           return nullptr;
17
+           obs_log(LOG_ERROR,
18
+               "Unable to get model filename %s from plugin.",
19
+               modelSelection.c_str());
20
+#if _WIN32
21
+           return std::wstring();
22
+#else
23
+           return std::string();
24
+#endif
25
        }
26
 
27
        std::string modelFilepath_s(modelFilepath_rawPtr);
28
@@ -177,9 +182,9 @@
29
        }
30
 
31
        if (inputDims0.size() < 3 || outputDims0.size() < 3) {
32
-           blog(LOG_ERROR,
33
-                "Input or output tensor dims are < 3. input = %d, output = %d",
34
-                (int)inputDims.size(), (int)outputDims.size());
35
+           obs_log(LOG_ERROR,
36
+               "Input or output tensor dims are < 3. input = %d, output = %d",
37
+               (int)inputDims.size(), (int)outputDims.size());
38
            return false;
39
        }
40
 
41
@@ -211,9 +216,9 @@
42
        for (size_t i = 0; i < inputDims.size(); i++) {
43
            inputTensorValues.push_back(std::vector<float>(
44
                vectorProduct(inputDimsi), 0.0f));
45
-           blog(LOG_INFO,
46
-                "Allocated %d sized float-array for input %d",
47
-                (int)inputTensorValuesi.size(), (int)i);
48
+           obs_log(LOG_INFO,
49
+               "Allocated %d sized float-array for input %d",
50
+               (int)inputTensorValuesi.size(), (int)i);
51
            inputTensor.push_back(Ort::Value::CreateTensor<float>(
52
                memoryInfo, inputTensorValuesi.data(),
53
                inputTensorValuesi.size(),
54
@@ -223,9 +228,9 @@
55
        for (size_t i = 0; i < outputDims.size(); i++) {
56
            outputTensorValues.push_back(std::vector<float>(
57
                vectorProduct(outputDimsi), 0.0f));
58
-           blog(LOG_INFO,
59
-                "Allocated %d sized float-array for output %d",
60
-                (int)outputTensorValuesi.size(), (int)i);
61
+           obs_log(LOG_INFO,
62
+               "Allocated %d sized float-array for output %d",
63
+               (int)outputTensorValuesi.size(), (int)i);
64
            outputTensor.push_back(Ort::Value::CreateTensor<float>(
65
                memoryInfo, outputTensorValuesi.data(),
66
                outputTensorValuesi.size(),
67
@@ -297,8 +302,8 @@
68
    {
69
        if (inputNames.size() == 0 || outputNames.size() == 0 ||
70
            inputTensor.size() == 0 || outputTensor.size() == 0) {
71
-           blog(LOG_INFO,
72
-                "Skip network inference. Inputs or outputs are null.");
73
+           obs_log(LOG_INFO,
74
+               "Skip network inference. Inputs or outputs are null.");
75
            return;
76
        }
77
 
78
obs-backgroundremoval-1.1.13.tar.gz/src/models/ModelRMBG.h Added
29
 
1
@@ -0,0 +1,27 @@
2
+#ifndef MODELRMBG_H
3
+#define MODELRMBG_H
4
+
5
+#include "Model.h"
6
+
7
+class ModelRMBG : public ModelBCHW {
8
+public:
9
+   ModelRMBG(/* args */) {}
10
+   ~ModelRMBG() {}
11
+
12
+   bool
13
+   populateInputOutputShapes(const std::unique_ptr<Ort::Session> &session,
14
+                 std::vector<std::vector<int64_t>> &inputDims,
15
+                 std::vector<std::vector<int64_t>> &outputDims)
16
+   {
17
+       ModelBCHW::populateInputOutputShapes(session, inputDims,
18
+                            outputDims);
19
+
20
+       // fix the output width and height to the input width and height
21
+       outputDims0.at(2) = inputDims0.at(2);
22
+       outputDims0.at(3) = inputDims0.at(3);
23
+
24
+       return true;
25
+   }
26
+};
27
+
28
+#endif // MODELRMBG_H
29
obs-backgroundremoval-1.1.6.tar.gz/src/models/ModelRVM.h -> obs-backgroundremoval-1.1.13.tar.gz/src/models/ModelRVM.h Changed
39
 
1
@@ -58,26 +58,29 @@
2
            outputDims.push_back(outputTensorInfo.GetShape());
3
        }
4
 
5
+       const int base_width = 320;
6
+       const int base_height = 192;
7
+
8
        inputDims00 = 1;
9
-       inputDims02 = 192;
10
-       inputDims03 = 192;
11
+       inputDims02 = base_height;
12
+       inputDims03 = base_width;
13
        for (size_t i = 1; i < 5; i++) {
14
            inputDimsi0 = 1;
15
            inputDimsi1 = (i == 1)   ? 16
16
                      : (i == 2) ? 20
17
                      : (i == 3) ? 40
18
                             : 64;
19
-           inputDimsi2 = 192 / (2 << (i - 1));
20
-           inputDimsi3 = 192 / (2 << (i - 1));
21
+           inputDimsi2 = base_height / (2 << (i - 1));
22
+           inputDimsi3 = base_width / (2 << (i - 1));
23
        }
24
 
25
        outputDims00 = 1;
26
-       outputDims02 = 192;
27
-       outputDims03 = 192;
28
+       outputDims02 = base_height;
29
+       outputDims03 = base_width;
30
        for (size_t i = 1; i < 5; i++) {
31
            outputDimsi0 = 1;
32
-           outputDimsi2 = 192 / (2 << (i - 1));
33
-           outputDimsi3 = 192 / (2 << (i - 1));
34
+           outputDimsi2 = base_height / (2 << (i - 1));
35
+           outputDimsi3 = base_width / (2 << (i - 1));
36
        }
37
        return true;
38
    }
39
obs-backgroundremoval-1.1.6.tar.gz/src/obs-utils/obs-config-utils.cpp -> obs-backgroundremoval-1.1.13.tar.gz/src/obs-utils/obs-config-utils.cpp Changed
104
 
1
@@ -1,49 +1,77 @@
2
 #include "obs-config-utils.h"
3
+#include "plugin-support.h"
4
 
5
 #include <obs-module.h>
6
+#include <util/config-file.h>
7
+#include <filesystem>
8
 
9
-int getFlagFromConfig(const char *name, bool *returnValue)
10
+void create_config_folder()
11
 {
12
-   // Check configuration to see if update checks are disabled
13
-   char *config_file = obs_module_file("config.json");
14
-   if (!config_file) {
15
-       blog(LOG_INFO, "Unable to find config file");
16
-       return OBS_BGREMOVAL_CONFIG_FAIL;
17
+   char *config_folder_path = obs_module_config_path("");
18
+   if (config_folder_path == nullptr) {
19
+       obs_log(LOG_ERROR, "Failed to get config folder path");
20
+       return;
21
    }
22
+   std::filesystem::path config_folder_std_path(config_folder_path);
23
+   bfree(config_folder_path);
24
 
25
-   obs_data_t *data = obs_data_create_from_json_file(config_file);
26
-   if (!data) {
27
-       blog(LOG_INFO, "Failed to parse config file");
28
-       return OBS_BGREMOVAL_CONFIG_FAIL;
29
+   // create the folder if it doesn't exist
30
+   if (!std::filesystem::exists(config_folder_std_path)) {
31
+#ifdef _WIN32
32
+       obs_log(LOG_INFO, "Config folder does not exist, creating: %S",
33
+           config_folder_std_path.c_str());
34
+#else
35
+       obs_log(LOG_INFO, "Config folder does not exist, creating: %s",
36
+           config_folder_std_path.c_str());
37
+#endif
38
+       // Create the config folder
39
+       std::filesystem::create_directories(config_folder_std_path);
40
    }
41
+}
42
+
43
+int getConfig(config_t **config)
44
+{
45
+   create_config_folder(); // ensure the config folder exists
46
+
47
+   // Get the config file
48
+   char *config_file_path = obs_module_config_path("config.ini");
49
 
50
-   *returnValue = obs_data_get_bool(data, name);
51
-   obs_data_release(data);
52
+   int ret = config_open(config, config_file_path, CONFIG_OPEN_EXISTING);
53
+   if (ret != CONFIG_SUCCESS) {
54
+       obs_log(LOG_INFO, "Failed to open config file %s",
55
+           config_file_path);
56
+       return OBS_BGREMOVAL_CONFIG_FAIL;
57
+   }
58
 
59
    return OBS_BGREMOVAL_CONFIG_SUCCESS;
60
 }
61
 
62
-int setFlagFromConfig(const char *name, const bool value)
63
+int getFlagFromConfig(const char *name, bool *returnValue, bool defaultValue)
64
 {
65
    // Get the config file
66
-   char *config_file = obs_module_file("config.json");
67
-   if (!config_file) {
68
-       blog(LOG_INFO, "Unable to find config file");
69
+   config_t *config;
70
+   if (getConfig(&config) != OBS_BGREMOVAL_CONFIG_SUCCESS) {
71
+       *returnValue = defaultValue;
72
        return OBS_BGREMOVAL_CONFIG_FAIL;
73
    }
74
 
75
-   // Parse the config file
76
-   obs_data_t *json_data = obs_data_create_from_json_file(config_file);
77
-   if (!json_data) {
78
-       blog(LOG_INFO, "Failed to parse config file");
79
+   *returnValue = config_get_bool(config, "config", name);
80
+   config_close(config);
81
+
82
+   return OBS_BGREMOVAL_CONFIG_SUCCESS;
83
+}
84
+
85
+int setFlagInConfig(const char *name, const bool value)
86
+{
87
+   // Get the config file
88
+   config_t *config;
89
+   if (getConfig(&config) != OBS_BGREMOVAL_CONFIG_SUCCESS) {
90
        return OBS_BGREMOVAL_CONFIG_FAIL;
91
    }
92
 
93
-   // Update the config
94
-   obs_data_set_bool(json_data, name, value);
95
-   obs_data_save_json(json_data, config_file);
96
-
97
-   obs_data_release(json_data);
98
+   config_set_bool(config, "config", name, value);
99
+   config_save(config);
100
+   config_close(config);
101
 
102
    return OBS_BGREMOVAL_CONFIG_SUCCESS;
103
 }
104
obs-backgroundremoval-1.1.6.tar.gz/src/obs-utils/obs-config-utils.h -> obs-backgroundremoval-1.1.13.tar.gz/src/obs-utils/obs-config-utils.h Changed
22
 
1
@@ -11,10 +11,11 @@
2
  *
3
  * @param name The name of the config item.
4
  * @param returnValue The value of the config item.
5
+ * @param defaultValue The default value of the config item.
6
  * @return OBS_BGREMOVAL_CONFIG_SUCCESS if the config item was found,
7
  * OBS_BGREMOVAL_CONFIG_FAIL otherwise.
8
  */
9
-int getFlagFromConfig(const char *name, bool *returnValue);
10
+int getFlagFromConfig(const char *name, bool *returnValue, bool defaultValue);
11
 
12
 /**
13
  * Set a boolean flag in the module configuration file.
14
@@ -24,6 +25,6 @@
15
  * @return OBS_BGREMOVAL_CONFIG_SUCCESS if the config item was found,
16
  * OBS_BGREMOVAL_CONFIG_FAIL otherwise.
17
  */
18
-int setFlagFromConfig(const char *name, const bool value);
19
+int setFlagInConfig(const char *name, const bool value);
20
 
21
 #endif /* OBS_CONFIG_UTILS_H */
22
obs-backgroundremoval-1.1.6.tar.gz/src/ort-utils/ort-session-utils.cpp -> obs-backgroundremoval-1.1.13.tar.gz/src/ort-utils/ort-session-utils.cpp Changed
170
 
1
@@ -5,25 +5,23 @@
2
 #include <coreml_provider_factory.h>
3
 #endif
4
 
5
-#if defined(__linux__) && defined(__x86_64__)
6
-#include <tensorrt_provider_factory.h>
7
-#endif
8
-
9
 #ifdef _WIN32
10
 #include <dml_provider_factory.h>
11
 #include <wchar.h>
12
+#include <windows.h>
13
 #endif // _WIN32
14
 
15
 #include <obs-module.h>
16
 
17
 #include "ort-session-utils.h"
18
 #include "consts.h"
19
+#include "plugin-support.h"
20
 
21
-void createOrtSession(filter_data *tf)
22
+int createOrtSession(filter_data *tf)
23
 {
24
    if (tf->model.get() == nullptr) {
25
-       blog(LOG_ERROR, "Model object is not initialized");
26
-       return;
27
+       obs_log(LOG_ERROR, "Model object is not initialized");
28
+       return OBS_BGREMOVAL_ORT_SESSION_ERROR_INVALID_MODEL;
29
    }
30
 
31
    Ort::SessionOptions sessionOptions;
32
@@ -42,25 +40,29 @@
33
        obs_module_file(tf->modelSelection.c_str());
34
 
35
    if (modelFilepath_rawPtr == nullptr) {
36
-       blog(LOG_ERROR, "Unable to get model filename %s from plugin.",
37
-            tf->modelSelection.c_str());
38
-       return;
39
+       obs_log(LOG_ERROR,
40
+           "Unable to get model filename %s from plugin.",
41
+           tf->modelSelection.c_str());
42
+       return OBS_BGREMOVAL_ORT_SESSION_ERROR_FILE_NOT_FOUND;
43
    }
44
 
45
    std::string modelFilepath_s(modelFilepath_rawPtr);
46
-   bfree(modelFilepath_rawPtr);
47
 
48
 #if _WIN32
49
-   std::wstring modelFilepath_ws(modelFilepath_s.size(), L' ');
50
-   std::copy(modelFilepath_s.begin(), modelFilepath_s.end(),
51
-         modelFilepath_ws.begin());
52
-   tf->modelFilepath = modelFilepath_ws.c_str();
53
+   int outLength = MultiByteToWideChar(
54
+       CP_ACP, MB_PRECOMPOSED, modelFilepath_rawPtr, -1, nullptr, 0);
55
+   tf->modelFilepath = std::wstring(outLength, L'\0');
56
+   MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, modelFilepath_rawPtr, -1,
57
+               tf->modelFilepath.data(), outLength);
58
 #else
59
-   tf->modelFilepath = modelFilepath_s.c_str();
60
+   tf->modelFilepath = std::string(modelFilepath_rawPtr);
61
 #endif
62
 
63
+   bfree(modelFilepath_rawPtr);
64
+
65
    try {
66
-#if defined(__linux__) && defined(__x86_64__)
67
+#if defined(__linux__) && defined(__x86_64__) && \
68
+   !defined(DISABLE_ONNXRUNTIME_GPU)
69
        if (tf->useGPU == USEGPU_TENSORRT) {
70
            Ort::ThrowOnError(
71
                OrtSessionOptionsAppendExecutionProvider_Tensorrt(
72
@@ -88,11 +90,11 @@
73
                    sessionOptions, coreml_flags));
74
        }
75
 #endif
76
-       tf->session.reset(new Ort::Session(*tf->env, tf->modelFilepath,
77
-                          sessionOptions));
78
+       tf->session.reset(new Ort::Session(
79
+           *tf->env, tf->modelFilepath.c_str(), sessionOptions));
80
    } catch (const std::exception &e) {
81
-       blog(LOG_ERROR, "%s", e.what());
82
-       return;
83
+       obs_log(LOG_ERROR, "%s", e.what());
84
+       return OBS_BGREMOVAL_ORT_SESSION_ERROR_STARTUP;
85
    }
86
 
87
    Ort::AllocatorWithDefaultOptions allocator;
88
@@ -102,41 +104,42 @@
89
 
90
    if (!tf->model->populateInputOutputShapes(tf->session, tf->inputDims,
91
                          tf->outputDims)) {
92
-       blog(LOG_ERROR, "Unable to get model input and output shapes");
93
-       return;
94
+       obs_log(LOG_ERROR,
95
+           "Unable to get model input and output shapes");
96
+       return OBS_BGREMOVAL_ORT_SESSION_ERROR_INVALID_INPUT_OUTPUT;
97
    }
98
 
99
    for (size_t i = 0; i < tf->inputNames.size(); i++) {
100
-       blog(LOG_INFO,
101
-            "Model %s input %d: name %s shape (%d dim) %d x %d x %d x %d",
102
-            tf->modelSelection.c_str(), (int)i,
103
-            tf->inputNamesi.get(), (int)tf->inputDimsi.size(),
104
-            (int)tf->inputDimsi0,
105
-            ((int)tf->inputDimsi.size() > 1)
106
-                ? (int)tf->inputDimsi1
107
-                : 0,
108
-            ((int)tf->inputDimsi.size() > 2)
109
-                ? (int)tf->inputDimsi2
110
-                : 0,
111
-            ((int)tf->inputDimsi.size() > 3)
112
-                ? (int)tf->inputDimsi3
113
-                : 0);
114
+       obs_log(LOG_INFO,
115
+           "Model %s input %d: name %s shape (%d dim) %d x %d x %d x %d",
116
+           tf->modelSelection.c_str(), (int)i,
117
+           tf->inputNamesi.get(), (int)tf->inputDimsi.size(),
118
+           (int)tf->inputDimsi0,
119
+           ((int)tf->inputDimsi.size() > 1)
120
+               ? (int)tf->inputDimsi1
121
+               : 0,
122
+           ((int)tf->inputDimsi.size() > 2)
123
+               ? (int)tf->inputDimsi2
124
+               : 0,
125
+           ((int)tf->inputDimsi.size() > 3)
126
+               ? (int)tf->inputDimsi3
127
+               : 0);
128
    }
129
    for (size_t i = 0; i < tf->outputNames.size(); i++) {
130
-       blog(LOG_INFO,
131
-            "Model %s output %d: name %s shape (%d dim) %d x %d x %d x %d",
132
-            tf->modelSelection.c_str(), (int)i,
133
-            tf->outputNamesi.get(), (int)tf->outputDimsi.size(),
134
-            (int)tf->outputDimsi0,
135
-            ((int)tf->outputDimsi.size() > 1)
136
-                ? (int)tf->outputDimsi1
137
-                : 0,
138
-            ((int)tf->outputDimsi.size() > 2)
139
-                ? (int)tf->outputDimsi2
140
-                : 0,
141
-            ((int)tf->outputDimsi.size() > 3)
142
-                ? (int)tf->outputDimsi3
143
-                : 0);
144
+       obs_log(LOG_INFO,
145
+           "Model %s output %d: name %s shape (%d dim) %d x %d x %d x %d",
146
+           tf->modelSelection.c_str(), (int)i,
147
+           tf->outputNamesi.get(), (int)tf->outputDimsi.size(),
148
+           (int)tf->outputDimsi0,
149
+           ((int)tf->outputDimsi.size() > 1)
150
+               ? (int)tf->outputDimsi1
151
+               : 0,
152
+           ((int)tf->outputDimsi.size() > 2)
153
+               ? (int)tf->outputDimsi2
154
+               : 0,
155
+           ((int)tf->outputDimsi.size() > 3)
156
+               ? (int)tf->outputDimsi3
157
+               : 0);
158
    }
159
 
160
    // Allocate buffers
161
@@ -144,6 +147,8 @@
162
                     tf->outputTensorValues,
163
                     tf->inputTensorValues, tf->inputTensor,
164
                     tf->outputTensor);
165
+
166
+   return OBS_BGREMOVAL_ORT_SESSION_SUCCESS;
167
 }
168
 
169
 bool runFilterModelInference(filter_data *tf, const cv::Mat &imageBGRA,
170
obs-backgroundremoval-1.1.6.tar.gz/src/ort-utils/ort-session-utils.h -> obs-backgroundremoval-1.1.13.tar.gz/src/ort-utils/ort-session-utils.h Changed
16
 
1
@@ -5,7 +5,13 @@
2
 
3
 #include "FilterData.h"
4
 
5
-void createOrtSession(filter_data *tf);
6
+#define OBS_BGREMOVAL_ORT_SESSION_ERROR_FILE_NOT_FOUND 1
7
+#define OBS_BGREMOVAL_ORT_SESSION_ERROR_INVALID_MODEL 2
8
+#define OBS_BGREMOVAL_ORT_SESSION_ERROR_INVALID_INPUT_OUTPUT 3
9
+#define OBS_BGREMOVAL_ORT_SESSION_ERROR_STARTUP 5
10
+#define OBS_BGREMOVAL_ORT_SESSION_SUCCESS 0
11
+
12
+int createOrtSession(filter_data *tf);
13
 
14
 bool runFilterModelInference(filter_data *tf, const cv::Mat &imageBGRA,
15
                 cv::Mat &output);
16
obs-backgroundremoval-1.1.6.tar.gz/src/plugin-support.c.in -> obs-backgroundremoval-1.1.13.tar.gz/src/plugin-support.c.in Changed
10
 
1
@@ -18,6 +18,8 @@
2
 
3
 #include <plugin-support.h>
4
 
5
+extern void blogva(int log_level, const char *format, va_list args);
6
+
7
 const char *PLUGIN_NAME = "@CMAKE_PROJECT_NAME@";
8
 const char *PLUGIN_VERSION = "@CMAKE_PROJECT_VERSION@";
9
 
10
obs-backgroundremoval-1.1.6.tar.gz/src/plugin-support.h -> obs-backgroundremoval-1.1.13.tar.gz/src/plugin-support.h Changed
9
 
1
@@ -31,7 +31,6 @@
2
 extern const char *PLUGIN_VERSION;
3
 
4
 void obs_log(int log_level, const char *format, ...);
5
-extern void blogva(int log_level, const char *format, va_list args);
6
 
7
 #ifdef __cplusplus
8
 }
9
obs-backgroundremoval-1.1.6.tar.gz/src/update-checker/github-utils.cpp -> obs-backgroundremoval-1.1.13.tar.gz/src/update-checker/github-utils.cpp Changed
55
 
1
@@ -5,9 +5,10 @@
2
 
3
 #include "Client.hpp"
4
 #include "github-utils.h"
5
+#include "plugin-support.h"
6
 
7
 static const std::string GITHUB_LATEST_RELEASE_URL =
8
-   "https://api.github.com/repos/royshil/obs-backgroundremoval/releases/latest";
9
+   "https://api.github.com/repos/occ-ai/obs-backgroundremoval/releases/latest";
10
 
11
 void github_utils_get_release_information(
12
    std::function<void(github_utils_release_information)> callback)
13
@@ -22,35 +23,22 @@
14
        obs_data_t *data =
15
            obs_data_create_from_json(responseBody.c_str());
16
        if (!data) {
17
-           blog(LOG_INFO, "Failed to parse latest release info");
18
-           callback(
19
-               {OBS_BGREMOVAL_GITHUB_UTILS_ERROR, NULL, NULL});
20
+           obs_log(LOG_INFO,
21
+               "Failed to parse latest release info");
22
+           callback({OBS_BGREMOVAL_GITHUB_UTILS_ERROR, "", ""});
23
            return;
24
        }
25
 
26
        // The version is in the "tag_name" property
27
-       char *version = strdup(obs_data_get_string(data, "tag_name"));
28
-       char *body = strdup(obs_data_get_string(data, "body"));
29
+       std::string version = obs_data_get_string(data, "tag_name");
30
+       std::string body = obs_data_get_string(data, "body");
31
        obs_data_release(data);
32
 
33
        // remove the "v" prefix in version, if it exists
34
        if (version0 == 'v') {
35
-           char *newVersion = (char *)malloc(strlen(version) - 1);
36
-           strcpy(newVersion, version + 1);
37
-           free(version);
38
-           version = newVersion;
39
+           version = version.substr(1);
40
        }
41
 
42
        callback({OBS_BGREMOVAL_GITHUB_UTILS_SUCCESS, body, version});
43
    });
44
 }
45
-
46
-void github_utils_release_information_free(
47
-   struct github_utils_release_information info)
48
-{
49
-   if (info.responseBody != NULL)
50
-       free(info.responseBody);
51
-   if (info.version != NULL)
52
-       free(info.version);
53
-   info.responseCode = OBS_BGREMOVAL_GITHUB_UTILS_ERROR;
54
-}
55
obs-backgroundremoval-1.1.6.tar.gz/src/update-checker/github-utils.h -> obs-backgroundremoval-1.1.13.tar.gz/src/update-checker/github-utils.h Changed
24
 
1
@@ -1,6 +1,7 @@
2
 #pragma once
3
 
4
 #include <functional>
5
+#include <string>
6
 
7
 enum {
8
    OBS_BGREMOVAL_GITHUB_UTILS_SUCCESS = 0,
9
@@ -9,12 +10,9 @@
10
 
11
 struct github_utils_release_information {
12
    int responseCode;
13
-   char *responseBody;
14
-   char *version;
15
+   std::string responseBody;
16
+   std::string version;
17
 };
18
 
19
 void github_utils_get_release_information(
20
    std::function<void(github_utils_release_information)> callback);
21
-
22
-void github_utils_release_information_free(
23
-   struct github_utils_release_information info);
24
obs-backgroundremoval-1.1.6.tar.gz/src/update-checker/update-checker.cpp -> obs-backgroundremoval-1.1.13.tar.gz/src/update-checker/update-checker.cpp Changed
94
 
1
@@ -1,5 +1,4 @@
2
 #include "update-checker.h"
3
-#include "UpdateDialog.hpp"
4
 #include "github-utils.h"
5
 #include "obs-utils/obs-config-utils.h"
6
 
7
@@ -8,45 +7,52 @@
8
 
9
 #include <plugin-support.h>
10
 
11
-#include <QTimer>
12
-
13
-UpdateDialog *update_dialog;
14
-
15
 extern "C" const char *PLUGIN_VERSION;
16
 
17
+static std::string latestVersionForUpdate;
18
+
19
 void check_update(void)
20
 {
21
-   github_utils_get_release_information((github_utils_release_information
22
-                           info) {
23
-       if (info.responseCode == OBS_BGREMOVAL_GITHUB_UTILS_SUCCESS) {
24
-           obs_log(LOG_INFO, "Latest release is %s", info.version);
25
-           bool shouldCheckForUpdates = false;
26
-           if (getFlagFromConfig("check_for_updates",
27
-                         &shouldCheckForUpdates) !=
28
-               OBS_BGREMOVAL_CONFIG_SUCCESS) {
29
-               // Failed to get the config value, assume it's enabled
30
-               shouldCheckForUpdates = true;
31
-           }
32
-
33
-           if (!shouldCheckForUpdates) {
34
-               // Update checks are disabled
35
-               return;
36
-           }
37
-
38
-           if (strcmp(info.version, PLUGIN_VERSION) == 0) {
39
-               // No update available, latest version is the same as the current version
40
-               return;
41
-           }
42
-
43
-           update_dialog = new UpdateDialog(
44
-               info,
45
-               (QWidget *)obs_frontend_get_main_window());
46
-           QTimer::singleShot(2000, update_dialog,
47
-                      &UpdateDialog::exec);
48
-       } else {
49
+   bool shouldCheckForUpdates = false;
50
+   if (getFlagFromConfig("check_for_updates", &shouldCheckForUpdates,
51
+                 true) != OBS_BGREMOVAL_CONFIG_SUCCESS) {
52
+       // Failed to get the config value, assume it's enabled
53
+       shouldCheckForUpdates = true;
54
+       // store the default value
55
+       setFlagInConfig("check_for_updates", shouldCheckForUpdates);
56
+   }
57
+
58
+   if (!shouldCheckForUpdates) {
59
+       // Update checks are disabled
60
+       return;
61
+   }
62
+
63
+   const auto callback = (github_utils_release_information info) {
64
+       if (info.responseCode != OBS_BGREMOVAL_GITHUB_UTILS_SUCCESS) {
65
            obs_log(LOG_INFO,
66
                "failed to get latest release information");
67
+           return;
68
+       }
69
+       obs_log(LOG_INFO, "Latest release is %s", info.version.c_str());
70
+
71
+       if (info.version == PLUGIN_VERSION) {
72
+           // No update available, latest version is the same as the current version
73
+           latestVersionForUpdate.clear();
74
+           return;
75
        }
76
-       github_utils_release_information_free(info);
77
-   });
78
+
79
+       latestVersionForUpdate = info.version;
80
+   };
81
+
82
+   github_utils_get_release_information(callback);
83
+}
84
+
85
+const char *get_latest_version(void)
86
+{
87
+   obs_log(LOG_INFO, "get_latest_version: %s",
88
+       latestVersionForUpdate.c_str());
89
+   if (latestVersionForUpdate.empty()) {
90
+       return nullptr;
91
+   }
92
+   return latestVersionForUpdate.c_str();
93
 }
94
obs-backgroundremoval-1.1.6.tar.gz/src/update-checker/update-checker.h -> obs-backgroundremoval-1.1.13.tar.gz/src/update-checker/update-checker.h Changed
9
 
1
@@ -5,6 +5,7 @@
2
 #endif
3
 
4
 void check_update(void);
5
+const char *get_latest_version(void);
6
 
7
 #ifdef __cplusplus
8
 }
9
obs-backgroundremoval-1.1.6.tar.gz/cmake/BuildMyCurl.cmake Deleted
23
 
1
@@ -1,21 +0,0 @@
2
-if(OS_MACOS)
3
-  set(CURL_USE_OPENSSL OFF)
4
-  set(CURL_USE_SECTRANSP ON)
5
-elseif(OS_WINDOWS)
6
-  set(CURL_USE_OPENSSL OFF)
7
-  set(CURL_USE_SCHANNEL ON)
8
-elseif(OS_LINUX)
9
-  add_compile_options(-fPIC)
10
-  set(CURL_USE_OPENSSL ON)
11
-endif()
12
-set(BUILD_CURL_EXE OFF)
13
-set(BUILD_SHARED_LIBS OFF)
14
-set(HTTP_ONLY OFF)
15
-set(CURL_USE_LIBSSH2 OFF)
16
-add_subdirectory(vendor/curl EXCLUDE_FROM_ALL)
17
-if(OS_MACOS)
18
-  target_compile_options(
19
-    libcurl PRIVATE -Wno-error=ambiguous-macro -Wno-error=deprecated-declarations -Wno-error=unreachable-code
20
-                    -Wno-error=unused-parameter -Wno-error=unused-variable)
21
-endif()
22
-include_directories(SYSTEM ${CMAKE_SOURCE_DIR}/vendor/curl/include)
23
obs-backgroundremoval-1.1.6.tar.gz/cmake/macos/resources/Distribution.xml Deleted
18
 
1
@@ -1,16 +0,0 @@
2
-<?xml version="1.0" encoding="utf-8"?>
3
-<installer-gui-script minSpecVersion="1">
4
-    <pkg-ref id="com.royshilkrot.obs-backgroundremoval"/>
5
-    <options customize="never" require-scripts="false" hostArchitectures="x86_64,arm64"/>
6
-    <choices-outline>
7
-        <line choice="default">
8
-            <line choice="com.royshilkrot.obs-backgroundremoval"/>
9
-        </line>
10
-    </choices-outline>
11
-    <choice id="default"/>
12
-    <choice id="com.royshilkrot.obs-backgroundremoval" visible="false">
13
-        <pkg-ref id="com.royshilkrot.obs-backgroundremoval"/>
14
-    </choice>
15
-    <pkg-ref id="com.royshilkrot.obs-backgroundremoval" version="1.0.0" onConclusion="none">obs-backgroundremoval-flat.pkg</pkg-ref>
16
-    <domains enable_anywhere="false" enable_currentUserHome="true" enable_localSystem="false"/>
17
-</installer-gui-script>
18
obs-backgroundremoval-1.1.6.tar.gz/src/update-checker/UpdateDialog.cpp Deleted
64
 
1
@@ -1,62 +0,0 @@
2
-#include "UpdateDialog.hpp"
3
-#include "obs-utils/obs-config-utils.h"
4
-
5
-#include <obs.h>
6
-#include <obs-module.h>
7
-
8
-#include <QLabel>
9
-#include <QVBoxLayout>
10
-#include <QString>
11
-
12
-static QString dialogContent =
13
-   "<h1>Background Removal - Update available! 🚀</h1>"
14
-   "<p>A new version of the Background Removal plugin (<a "
15
-   "href=\"https://github.com/royshil/obs-backgroundremoval/releases\">v{version}</a>) is "
16
-   "now available for download. We've made some exciting updates and improvements that we think "
17
-   "you'll love. To get the latest features and enhancements, please follow the link below:</p>"
18
-   "<p>Download the latest version from GitHub: <a "
19
-   "href=\"https://github.com/royshil/obs-backgroundremoval/releases\">v{version}</a></p>"
20
-   "<p>Once you've downloaded the new version, install the update as usual, there's no need to "
21
-   "uninstall the previous version.</p>"
22
-   "<p>If you have any questions or need assistance during the update process, feel free to reach out"
23
-   " to our <a href=\"https://github.com/royshil/obs-backgroundremoval/issues\">support team</a>.</p>"
24
-   "<p>Thank you for using our plugin and we hope you enjoy the latest release! 🙏</p>"
25
-   "<h2>Changelog</h2>";
26
-
27
-UpdateDialog::UpdateDialog(
28
-   struct github_utils_release_information latestVersion, QWidget *parent)
29
-   : QDialog(parent), layout(new QVBoxLayout)
30
-{
31
-   setWindowTitle("Background Removal - Update available! 🚀");
32
-   setLayout(layout);
33
-   QLabel *label = new QLabel(dialogContent.replace(
34
-       QString("{version}"), QString(latestVersion.version)));
35
-   label->setOpenExternalLinks(true);
36
-   label->setTextInteractionFlags(Qt::TextBrowserInteraction);
37
-   label->setTextFormat(Qt::RichText);
38
-   label->setWordWrap(true);
39
-   layout->addWidget(label);
40
-
41
-   QScrollArea *scrollArea = new QScrollArea;
42
-   QLabel *scrollAreaLabel =
43
-       new QLabel(QString(latestVersion.responseBody));
44
-   scrollAreaLabel->setOpenExternalLinks(true);
45
-   scrollAreaLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
46
-   scrollAreaLabel->setTextFormat(Qt::MarkdownText);
47
-   scrollAreaLabel->setWordWrap(true);
48
-   scrollArea->setWidget(scrollAreaLabel);
49
-   scrollArea->setWidgetResizable(true);
50
-   layout->addWidget(scrollArea);
51
-
52
-   // Add a checkbox to disable update checks
53
-   QCheckBox *disableCheckbox = new QCheckBox("Disable update checks");
54
-   layout->addWidget(disableCheckbox);
55
-   connect(disableCheckbox, &QCheckBox::stateChanged, this, (int state) {
56
-       setFlagFromConfig("check_for_updates", state == Qt::Unchecked);
57
-   });
58
-
59
-   // Add a button to close the dialog
60
-   QPushButton *closeButton = new QPushButton("Close");
61
-   layout->addWidget(closeButton);
62
-   connect(closeButton, &QPushButton::clicked, this, &QDialog::close);
63
-}
64
obs-backgroundremoval-1.1.6.tar.gz/src/update-checker/UpdateDialog.hpp Deleted
15
 
1
@@ -1,13 +0,0 @@
2
-#include <QtWidgets>
3
-
4
-#include "github-utils.h"
5
-
6
-class UpdateDialog : public QDialog {
7
-   Q_OBJECT
8
-public:
9
-   UpdateDialog(struct github_utils_release_information latestVersion,
10
-            QWidget *parent = nullptr);
11
-
12
-private:
13
-   QVBoxLayout *layout;
14
-};
15
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/tensorrt_provider_factory.h Deleted
16
 
1
@@ -1,14 +0,0 @@
2
-// Copyright (c) Microsoft Corporation. All rights reserved.
3
-// Licensed under the MIT License.
4
-
5
-#include "onnxruntime_c_api.h"
6
-
7
-#ifdef __cplusplus
8
-extern "C" {
9
-#endif
10
-
11
-ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_Tensorrt, _In_ OrtSessionOptions* options, int device_id);
12
-
13
-#ifdef __cplusplus
14
-}
15
-#endif
16
onnxruntime-linux-x64-gpu-1.15.1.tgz/lib/libonnxruntime.so.1.15.1 Deleted
onnxruntime-linux-x64-gpu-1.15.1.tgz/GIT_COMMIT_ID -> onnxruntime-linux-x64-gpu-1.17.1.tgz/GIT_COMMIT_ID Changed
4
 
1
@@ -1,1 +1,1 @@
2
-baeece44ba075009c6bfe95891a8c1b3d4571cb3
3
+8f5c79cb63f09ef1302e85081093a3fe4da1bc7d
4
onnxruntime-linux-x64-gpu-1.15.1.tgz/README.md -> onnxruntime-linux-x64-gpu-1.17.1.tgz/README.md Changed
43
 
1
@@ -6,23 +6,22 @@
2
 
3
 **ONNX Runtime training** can accelerate the model training time on multi-node NVIDIA GPUs for transformer models with a one-line addition for existing PyTorch training scripts. Learn more &rarr;(https://www.onnxruntime.ai/docs/#onnx-runtime-for-training)
4
 
5
-
6
 ## Get Started & Resources
7
 
8
 * **General Information**: onnxruntime.ai(https://onnxruntime.ai)
9
 
10
-* **Usage documention and tutorials**: onnxruntime.ai/docs(https://onnxruntime.ai/docs)
11
+* **Usage documentation and tutorials**: onnxruntime.ai/docs(https://onnxruntime.ai/docs)
12
 
13
 * **YouTube video tutorials**: youtube.com/@ONNXRuntime(https://www.youtube.com/@ONNXRuntime)
14
 
15
 * **Upcoming Release Roadmap**(https://github.com/microsoft/onnxruntime/wiki/Upcoming-Release-Roadmap)
16
 
17
-* **Companion sample repositories**: 
18
+* **Companion sample repositories**:
19
   - ONNX Runtime Inferencing: microsoft/onnxruntime-inference-examples(https://github.com/microsoft/onnxruntime-inference-examples)
20
   - ONNX Runtime Training: microsoft/onnxruntime-training-examples(https://github.com/microsoft/onnxruntime-training-examples)
21
 
22
+## Builtin Pipeline Status
23
 
24
-## Build Pipeline Status
25
 |System|Inference|Training|
26
 |---|---|---|
27
 |Windows|!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/Windows%20CPU%20CI%20Pipeline?label=Windows+CPU)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=9)<br>!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/Windows%20GPU%20CI%20Pipeline?label=Windows+GPU)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=10)<br>!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/Windows%20GPU%20TensorRT%20CI%20Pipeline?label=Windows+GPU+TensorRT)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=47)||
28
@@ -31,8 +30,13 @@
29
 |Android|!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/Android%20CI%20Pipeline?label=Android)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=53)||
30
 |iOS|!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/iOS%20CI%20Pipeline?label=iOS)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=134)||
31
 |Web|!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/ONNX%20Runtime%20Web%20CI%20Pipeline?label=Web)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=161)||
32
-|Other|!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/onnxruntime-binary-size-checks-ci-pipeline?repoName=microsoft%2Fonnxruntime&label=Binary+Size+Check)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=187&repoName=microsoft%2Fonnxruntime)<br>!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/onnxruntime-python-checks-ci-pipeline?label=Python+Checks)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=164)||
33
+|Other|!Build Status(https://dev.azure.com/onnxruntime/onnxruntime/_apis/build/status/onnxruntime-binary-size-checks-ci-pipeline?repoName=microsoft%2Fonnxruntime&label=Binary+Size+Check)(https://dev.azure.com/onnxruntime/onnxruntime/_build/latest?definitionId=187&repoName=microsoft%2Fonnxruntime)||
34
+
35
+## Third-party Pipeline Status
36
 
37
+|System|Inference|Training|
38
+|---|---|---|
39
+|Linux|!Build Status(https://github.com/Ascend/onnxruntime/actions/workflows/build-and-test.yaml/badge.svg)(https://github.com/Ascend/onnxruntime/actions/workflows/build-and-test.yaml)||
40
 
41
 ## Data/Telemetry
42
 
43
onnxruntime-linux-x64-gpu-1.15.1.tgz/ThirdPartyNotices.txt -> onnxruntime-linux-x64-gpu-1.17.1.tgz/ThirdPartyNotices.txt Changed
201
 
1
@@ -6021,4 +6021,488 @@
2
 
3
 Except as contained in this notice, the name of a copyright holder shall not
4
 be used in advertising or otherwise to promote the sale, use or other dealings
5
-in this Software without prior written authorization of the copyright holder.
6
\ No newline at end of file
7
+in this Software without prior written authorization of the copyright holder.
8
+
9
+_____
10
+
11
+Intel neural-compressor
12
+
13
+https://github.com/intel/neural-compressor
14
+
15
+                                 Apache License
16
+                           Version 2.0, January 2004
17
+                        http://www.apache.org/licenses/
18
+
19
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
20
+
21
+   1. Definitions.
22
+
23
+      "License" shall mean the terms and conditions for use, reproduction,
24
+      and distribution as defined by Sections 1 through 9 of this document.
25
+
26
+      "Licensor" shall mean the copyright owner or entity authorized by
27
+      the copyright owner that is granting the License.
28
+
29
+      "Legal Entity" shall mean the union of the acting entity and all
30
+      other entities that control, are controlled by, or are under common
31
+      control with that entity. For the purposes of this definition,
32
+      "control" means (i) the power, direct or indirect, to cause the
33
+      direction or management of such entity, whether by contract or
34
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
35
+      outstanding shares, or (iii) beneficial ownership of such entity.
36
+
37
+      "You" (or "Your") shall mean an individual or Legal Entity
38
+      exercising permissions granted by this License.
39
+
40
+      "Source" form shall mean the preferred form for making modifications,
41
+      including but not limited to software source code, documentation
42
+      source, and configuration files.
43
+
44
+      "Object" form shall mean any form resulting from mechanical
45
+      transformation or translation of a Source form, including but
46
+      not limited to compiled object code, generated documentation,
47
+      and conversions to other media types.
48
+
49
+      "Work" shall mean the work of authorship, whether in Source or
50
+      Object form, made available under the License, as indicated by a
51
+      copyright notice that is included in or attached to the work
52
+      (an example is provided in the Appendix below).
53
+
54
+      "Derivative Works" shall mean any work, whether in Source or Object
55
+      form, that is based on (or derived from) the Work and for which the
56
+      editorial revisions, annotations, elaborations, or other modifications
57
+      represent, as a whole, an original work of authorship. For the purposes
58
+      of this License, Derivative Works shall not include works that remain
59
+      separable from, or merely link (or bind by name) to the interfaces of,
60
+      the Work and Derivative Works thereof.
61
+
62
+      "Contribution" shall mean any work of authorship, including
63
+      the original version of the Work and any modifications or additions
64
+      to that Work or Derivative Works thereof, that is intentionally
65
+      submitted to Licensor for inclusion in the Work by the copyright owner
66
+      or by an individual or Legal Entity authorized to submit on behalf of
67
+      the copyright owner. For the purposes of this definition, "submitted"
68
+      means any form of electronic, verbal, or written communication sent
69
+      to the Licensor or its representatives, including but not limited to
70
+      communication on electronic mailing lists, source code control systems,
71
+      and issue tracking systems that are managed by, or on behalf of, the
72
+      Licensor for the purpose of discussing and improving the Work, but
73
+      excluding communication that is conspicuously marked or otherwise
74
+      designated in writing by the copyright owner as "Not a Contribution."
75
+
76
+      "Contributor" shall mean Licensor and any individual or Legal Entity
77
+      on behalf of whom a Contribution has been received by Licensor and
78
+      subsequently incorporated within the Work.
79
+
80
+   2. Grant of Copyright License. Subject to the terms and conditions of
81
+      this License, each Contributor hereby grants to You a perpetual,
82
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
83
+      copyright license to reproduce, prepare Derivative Works of,
84
+      publicly display, publicly perform, sublicense, and distribute the
85
+      Work and such Derivative Works in Source or Object form.
86
+
87
+   3. Grant of Patent License. Subject to the terms and conditions of
88
+      this License, each Contributor hereby grants to You a perpetual,
89
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
90
+      (except as stated in this section) patent license to make, have made,
91
+      use, offer to sell, sell, import, and otherwise transfer the Work,
92
+      where such license applies only to those patent claims licensable
93
+      by such Contributor that are necessarily infringed by their
94
+      Contribution(s) alone or by combination of their Contribution(s)
95
+      with the Work to which such Contribution(s) was submitted. If You
96
+      institute patent litigation against any entity (including a
97
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
98
+      or a Contribution incorporated within the Work constitutes direct
99
+      or contributory patent infringement, then any patent licenses
100
+      granted to You under this License for that Work shall terminate
101
+      as of the date such litigation is filed.
102
+
103
+   4. Redistribution. You may reproduce and distribute copies of the
104
+      Work or Derivative Works thereof in any medium, with or without
105
+      modifications, and in Source or Object form, provided that You
106
+      meet the following conditions:
107
+
108
+      (a) You must give any other recipients of the Work or
109
+          Derivative Works a copy of this License; and
110
+
111
+      (b) You must cause any modified files to carry prominent notices
112
+          stating that You changed the files; and
113
+
114
+      (c) You must retain, in the Source form of any Derivative Works
115
+          that You distribute, all copyright, patent, trademark, and
116
+          attribution notices from the Source form of the Work,
117
+          excluding those notices that do not pertain to any part of
118
+          the Derivative Works; and
119
+
120
+      (d) If the Work includes a "NOTICE" text file as part of its
121
+          distribution, then any Derivative Works that You distribute must
122
+          include a readable copy of the attribution notices contained
123
+          within such NOTICE file, excluding those notices that do not
124
+          pertain to any part of the Derivative Works, in at least one
125
+          of the following places: within a NOTICE text file distributed
126
+          as part of the Derivative Works; within the Source form or
127
+          documentation, if provided along with the Derivative Works; or,
128
+          within a display generated by the Derivative Works, if and
129
+          wherever such third-party notices normally appear. The contents
130
+          of the NOTICE file are for informational purposes only and
131
+          do not modify the License. You may add Your own attribution
132
+          notices within Derivative Works that You distribute, alongside
133
+          or as an addendum to the NOTICE text from the Work, provided
134
+          that such additional attribution notices cannot be construed
135
+          as modifying the License.
136
+
137
+      You may add Your own copyright statement to Your modifications and
138
+      may provide additional or different license terms and conditions
139
+      for use, reproduction, or distribution of Your modifications, or
140
+      for any such Derivative Works as a whole, provided Your use,
141
+      reproduction, and distribution of the Work otherwise complies with
142
+      the conditions stated in this License.
143
+
144
+   5. Submission of Contributions. Unless You explicitly state otherwise,
145
+      any Contribution intentionally submitted for inclusion in the Work
146
+      by You to the Licensor shall be under the terms and conditions of
147
+      this License, without any additional terms or conditions.
148
+      Notwithstanding the above, nothing herein shall supersede or modify
149
+      the terms of any separate license agreement you may have executed
150
+      with Licensor regarding such Contributions.
151
+
152
+   6. Trademarks. This License does not grant permission to use the trade
153
+      names, trademarks, service marks, or product names of the Licensor,
154
+      except as required for reasonable and customary use in describing the
155
+      origin of the Work and reproducing the content of the NOTICE file.
156
+
157
+   7. Disclaimer of Warranty. Unless required by applicable law or
158
+      agreed to in writing, Licensor provides the Work (and each
159
+      Contributor provides its Contributions) on an "AS IS" BASIS,
160
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
161
+      implied, including, without limitation, any warranties or conditions
162
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
163
+      PARTICULAR PURPOSE. You are solely responsible for determining the
164
+      appropriateness of using or redistributing the Work and assume any
165
+      risks associated with Your exercise of permissions under this License.
166
+
167
+   8. Limitation of Liability. In no event and under no legal theory,
168
+      whether in tort (including negligence), contract, or otherwise,
169
+      unless required by applicable law (such as deliberate and grossly
170
+      negligent acts) or agreed to in writing, shall any Contributor be
171
+      liable to You for damages, including any direct, indirect, special,
172
+      incidental, or consequential damages of any character arising as a
173
+      result of this License or out of the use or inability to use the
174
+      Work (including but not limited to damages for loss of goodwill,
175
+      work stoppage, computer failure or malfunction, or any and all
176
+      other commercial damages or losses), even if such Contributor
177
+      has been advised of the possibility of such damages.
178
+
179
+   9. Accepting Warranty or Additional Liability. While redistributing
180
+      the Work or Derivative Works thereof, You may choose to offer,
181
+      and charge a fee for, acceptance of support, warranty, indemnity,
182
+      or other liability obligations and/or rights consistent with this
183
+      License. However, in accepting such obligations, You may act only
184
+      on Your own behalf and on Your sole responsibility, not on behalf
185
+      of any other Contributor, and only if You agree to indemnify,
186
+      defend, and hold each Contributor harmless for any liability
187
+      incurred by, or claims asserted against, such Contributor by reason
188
+      of your accepting any such warranty or additional liability.
189
+
190
+   END OF TERMS AND CONDITIONS
191
+
192
+   ============================================================================
193
+
194
+   Copyright 2016-2019 Intel Corporation
195
+   Copyright 2018 YANDEX LLC
196
+
197
+   Licensed under the Apache License, Version 2.0 (the "License");
198
+   you may not use this file except in compliance with the License.
199
+   You may obtain a copy of the License at
200
+
201
onnxruntime-linux-x64-gpu-1.15.1.tgz/VERSION_NUMBER -> onnxruntime-linux-x64-gpu-1.17.1.tgz/VERSION_NUMBER Changed
4
 
1
@@ -1,1 +1,1 @@
2
-1.15.1
3
+1.17.1
4
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/core Added
2
 
1
+(directory)
2
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/core/providers Added
2
 
1
+(directory)
2
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/core/providers/cuda Added
2
 
1
+(directory)
2
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/core/providers/cuda/cuda_context.h Added
99
 
1
@@ -0,0 +1,97 @@
2
+// Copyright (c) Microsoft Corporation. All rights reserved.
3
+// Licensed under the MIT License.
4
+
5
+// This header is to expose a context for cuda custom ops.
6
+// By the context, a custom cuda operator could fetch existing resources,
7
+// such as cuda stream and cudnn handle, for reusing.
8
+
9
+// For concrete usage, pls find page here:
10
+// https://onnxruntime.ai/docs/reference/operators/add-custom-op.html#custom-ops-for-cuda-and-rocm
11
+
12
+#pragma once
13
+
14
+#define ORT_CUDA_CTX
15
+
16
+#include "cuda_resource.h"
17
+#include "core/providers/custom_op_context.h"
18
+#include <cuda.h>
19
+#include <cuda_runtime.h>
20
+#include <cublas_v2.h>
21
+#include <cudnn.h>
22
+
23
+namespace Ort {
24
+
25
+namespace Custom {
26
+
27
+struct CudaContext : public CustomOpContext {
28
+  cudaStream_t cuda_stream = {};
29
+  cudnnHandle_t cudnn_handle = {};
30
+  cublasHandle_t cublas_handle = {};
31
+  OrtAllocator* deferred_cpu_allocator = {};
32
+  // below are cuda ep options
33
+  int16_t device_id = 0;
34
+  int32_t arena_extend_strategy = 0;
35
+  int32_t cudnn_conv_algo_search = 0;
36
+  bool cudnn_conv_use_max_workspace = true;
37
+  bool cudnn_conv1d_pad_to_nc1d = false;
38
+  bool enable_skip_layer_norm_strict_mode = false;
39
+  bool prefer_nhwc = false;
40
+
41
+  void Init(const OrtKernelContext& kernel_ctx) {
42
+    cuda_stream = FetchResource<cudaStream_t>(kernel_ctx, CudaResource::cuda_stream_t);
43
+    cudnn_handle = FetchResource<cudnnHandle_t>(kernel_ctx, CudaResource::cudnn_handle_t);
44
+    cublas_handle = FetchResource<cublasHandle_t>(kernel_ctx, CudaResource::cublas_handle_t);
45
+    deferred_cpu_allocator = FetchResource<OrtAllocator*>(kernel_ctx, CudaResource::deferred_cpu_allocator_t);
46
+
47
+    device_id = FetchResource<int16_t>(kernel_ctx, CudaResource::device_id_t);
48
+    arena_extend_strategy = FetchResource<int32_t>(kernel_ctx, CudaResource::arena_extend_strategy_t);
49
+    cudnn_conv_algo_search = FetchResource<int32_t>(kernel_ctx, CudaResource::cudnn_conv_algo_search_t);
50
+    cudnn_conv_use_max_workspace = FetchResource<bool>(kernel_ctx, CudaResource::cudnn_conv_use_max_workspace_t);
51
+
52
+    cudnn_conv1d_pad_to_nc1d = FetchResource<bool>(kernel_ctx, CudaResource::cudnn_conv1d_pad_to_nc1d_t);
53
+    enable_skip_layer_norm_strict_mode = FetchResource<bool>(kernel_ctx, CudaResource::enable_skip_layer_norm_strict_mode_t);
54
+    prefer_nhwc = FetchResource<bool>(kernel_ctx, CudaResource::prefer_nhwc_t);
55
+  }
56
+
57
+  template <typename T>
58
+  T FetchResource(const OrtKernelContext& kernel_ctx, CudaResource resource_type) {
59
+    if (sizeof(T) > sizeof(void*)) {
60
+      ORT_CXX_API_THROW("void* is not large enough to hold resource type: " + std::to_string(resource_type), OrtErrorCode::ORT_INVALID_ARGUMENT);
61
+    }
62
+    const auto& ort_api = Ort::GetApi();
63
+    void* resource = {};
64
+    OrtStatus* status = ort_api.KernelContext_GetResource(&kernel_ctx, ORT_CUDA_RESOUCE_VERSION, resource_type, &resource);
65
+    if (status) {
66
+      ORT_CXX_API_THROW("Failed to fetch cuda ep resource, resouce type: " + std::to_string(resource_type), OrtErrorCode::ORT_RUNTIME_EXCEPTION);
67
+    }
68
+    T t = {};
69
+    memcpy(&t, &resource, sizeof(T));
70
+    return t;
71
+  }
72
+
73
+  void* AllocDeferredCpuMem(size_t size) const {
74
+    if (0 == size) {
75
+      return {};
76
+    }
77
+    const auto& ort_api = Ort::GetApi();
78
+    void* mem = {};
79
+    auto status = ort_api.AllocatorAlloc(deferred_cpu_allocator, size, &mem);
80
+    if (status) {
81
+      ORT_CXX_API_THROW("failed to allocate deferred cpu memory", OrtErrorCode::ORT_RUNTIME_EXCEPTION);
82
+    }
83
+    return mem;
84
+  }
85
+
86
+  void FreeDeferredCpuMem(void* mem) const {
87
+    if (mem) {
88
+      const auto& ort_api = Ort::GetApi();
89
+      auto status = ort_api.AllocatorFree(deferred_cpu_allocator, mem);
90
+      if (status) {
91
+        ORT_CXX_API_THROW("failed to free deferred cpu memory", OrtErrorCode::ORT_RUNTIME_EXCEPTION);
92
+      }
93
+    }
94
+  }
95
+};
96
+
97
+}  // namespace Custom
98
+}  // namespace Ort
99
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/core/providers/cuda/cuda_resource.h Added
24
 
1
@@ -0,0 +1,21 @@
2
+// Copyright (c) Microsoft Corporation. All rights reserved.
3
+// Licensed under the MIT License.
4
+
5
+#include "core/providers/resource.h"
6
+
7
+#define ORT_CUDA_RESOUCE_VERSION 3
8
+
9
+enum CudaResource : int {
10
+  cuda_stream_t = cuda_resource_offset,  // 10000
11
+  cudnn_handle_t,
12
+  cublas_handle_t,
13
+  deferred_cpu_allocator_t,
14
+  // below are cuda ep options
15
+  device_id_t,  // 10004
16
+  arena_extend_strategy_t,
17
+  cudnn_conv_algo_search_t,
18
+  cudnn_conv_use_max_workspace_t,
19
+  cudnn_conv1d_pad_to_nc1d_t,
20
+  enable_skip_layer_norm_strict_mode_t,
21
+  prefer_nhwc_t,
22
+};
23
\ No newline at end of file
24
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/core/providers/custom_op_context.h Added
13
 
1
@@ -0,0 +1,10 @@
2
+// Copyright (c) Microsoft Corporation. All rights reserved.
3
+// Licensed under the MIT License.
4
+
5
+#pragma once
6
+
7
+// CustomOpContext defines an interface allowing a custom op to access ep-specific resources.
8
+struct CustomOpContext {
9
+  CustomOpContext() = default;
10
+  virtual ~CustomOpContext(){};
11
+};
12
\ No newline at end of file
13
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/core/providers/resource.h Added
17
 
1
@@ -0,0 +1,14 @@
2
+// Copyright (c) Microsoft Corporation. All rights reserved.
3
+// Licensed under the MIT License.
4
+
5
+#pragma once
6
+
7
+enum ResourceOffset {
8
+  cpu_resource_offset = 0,
9
+  cuda_resource_offset = 10000,
10
+  dml_resource_offset = 20000,
11
+  rocm_resource_offset = 30000,
12
+  // offsets for other ort eps
13
+  custom_ep_resource_offset = 10000000,
14
+  // offsets for customized eps
15
+};
16
\ No newline at end of file
17
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/onnxruntime_c_api.h -> onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_c_api.h Changed
201
 
1
@@ -5,11 +5,11 @@
2
 
3
 /** \mainpage ONNX Runtime
4
  *
5
- * ONNX Runtime is a high-performance inference and training graph execution engine for deeplearning models.
6
+ * ONNX Runtime is a high-performance inference and training graph execution engine for deep learning models.
7
  *
8
  * ONNX Runtime's C, C++ APIs offer an easy to use interface to onboard and execute onnx models.
9
  * - \subpage c_cpp_api "Core C, C++ APIs"
10
- * - \subpage training_c_cpp_api "Training C, C++ APIs for learning on the edge"
11
+ * - \subpage training_c_cpp_api "Training C, C++ APIs for on-device training"
12
  *
13
  * \page c_cpp_api Core C, C++ APIs
14
  * <h1>C</h1>
15
@@ -29,15 +29,16 @@
16
  */
17
 
18
 #pragma once
19
-#include <stdlib.h>
20
+#include <stdbool.h>
21
 #include <stdint.h>
22
+#include <stdlib.h>
23
 #include <string.h>
24
 
25
 /** \brief The API version defined in this header
26
  *
27
  * This value is used by some API functions to behave as this version of the header expects.
28
  */
29
-#define ORT_API_VERSION 15
30
+#define ORT_API_VERSION 17
31
 
32
 #ifdef __cplusplus
33
 extern "C" {
34
@@ -61,6 +62,8 @@
35
 #define _Check_return_
36
 #define _Outptr_result_maybenull_
37
 #define _In_reads_(X)
38
+#define _Inout_updates_(X)
39
+#define _Out_writes_(X)
40
 #define _Inout_updates_all_(X)
41
 #define _Out_writes_bytes_all_(X)
42
 #define _Out_writes_all_(X)
43
@@ -188,7 +191,12 @@
44
   ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64,      // maps to c type uint64_t
45
   ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64,   // complex with float32 real and imaginary components
46
   ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128,  // complex with float64 real and imaginary components
47
-  ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16     // Non-IEEE floating-point format based on IEEE754 single-precision
48
+  ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16,    // Non-IEEE floating-point format based on IEEE754 single-precision
49
+  // float 8 types were introduced in onnx 1.14, see https://onnx.ai/onnx/technical/float8.html
50
+  ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FN,    // Non-IEEE floating-point format based on IEEE754 single-precision
51
+  ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FNUZ,  // Non-IEEE floating-point format based on IEEE754 single-precision
52
+  ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2,      // Non-IEEE floating-point format based on IEEE754 single-precision
53
+  ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2FNUZ   // Non-IEEE floating-point format based on IEEE754 single-precision
54
 } ONNXTensorElementDataType;
55
 
56
 // Synced with onnx TypeProto oneof
57
@@ -292,6 +300,7 @@
58
 ORT_RUNTIME_CLASS(Op);
59
 ORT_RUNTIME_CLASS(OpAttr);
60
 ORT_RUNTIME_CLASS(Logger);
61
+ORT_RUNTIME_CLASS(ShapeInferContext);
62
 
63
 #ifdef _WIN32
64
 typedef _Return_type_success_(return == 0) OrtStatus* OrtStatusPtr;
65
@@ -401,7 +410,8 @@
66
         user_compute_stream{},
67
         default_memory_arena_cfg{},
68
         tunable_op_enable{false},
69
-        tunable_op_tuning_enable{false} {}
70
+        tunable_op_tuning_enable{false},
71
+        tunable_op_max_tuning_duration_ms{} {}
72
 #endif
73
 
74
   /** \brief CUDA device Id
75
@@ -464,6 +474,11 @@
76
    */
77
   int tunable_op_tuning_enable;
78
 
79
+  /** \brief Max tuning duration time limit for each instance of TunableOp.
80
+   *   Defaults to 0 to disable the limit.
81
+   */
82
+  int tunable_op_max_tuning_duration_ms;
83
+
84
 } OrtCUDAProviderOptions;
85
 
86
 /** \brief ROCM Provider Options
87
@@ -482,7 +497,8 @@
88
         user_compute_stream{},
89
         default_memory_arena_cfg{},
90
         tunable_op_enable{false},
91
-        tunable_op_tuning_enable{false} {}
92
+        tunable_op_tuning_enable{false},
93
+        tunable_op_max_tuning_duration_ms{} {}
94
 #endif
95
 
96
   /** \brief ROCM device Id
97
@@ -544,6 +560,11 @@
98
    */
99
   int tunable_op_tuning_enable;
100
 
101
+  /** \brief Max tuning duration time limit for each instance of TunableOp.
102
+   *   Defaults to 0 to disable the limit.
103
+   */
104
+  int tunable_op_max_tuning_duration_ms;
105
+
106
 } OrtROCMProviderOptions;
107
 
108
 /** \brief TensorRT Provider Options
109
@@ -579,9 +600,11 @@
110
  * \see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX
111
  */
112
 typedef struct OrtMIGraphXProviderOptions {
113
-  int device_id;             // hip device id.
114
-  int migraphx_fp16_enable;  // enable MIGraphX FP16 precision. Default 0 = false, nonzero = true
115
-  int migraphx_int8_enable;  // enable MIGraphX INT8 precision. Default 0 = false, nonzero = true
116
+  int device_id;                                     // hip device id.
117
+  int migraphx_fp16_enable;                          // MIGraphX FP16 precision. Default 0 = false, nonzero = true
118
+  int migraphx_int8_enable;                          // MIGraphX INT8 precision. Default 0 = false, nonzero = true
119
+  int migraphx_use_native_calibration_table;         // MIGraphx INT8 cal table. Default 0 = false, noznero = true
120
+  const char* migraphx_int8_calibration_table_name;  // MIGraphx INT8 calibration table name
121
 } OrtMIGraphXProviderOptions;
122
 
123
 /** \brief OpenVINO Provider Options
124
@@ -591,7 +614,7 @@
125
 typedef struct OrtOpenVINOProviderOptions {
126
 #ifdef __cplusplus
127
   OrtOpenVINOProviderOptions() : device_type{},
128
-                                 enable_vpu_fast_compile{},
129
+                                 enable_npu_fast_compile{},
130
                                  device_id{},
131
                                  num_of_threads{},
132
                                  cache_dir{},
133
@@ -604,7 +627,7 @@
134
    * Valid settings are one of: "CPU_FP32", "CPU_FP16", "GPU_FP32", "GPU_FP16"
135
    */
136
   const char* device_type;
137
-  unsigned char enable_vpu_fast_compile;  ///< 0 = disabled, nonzero = enabled
138
+  unsigned char enable_npu_fast_compile;  ///< 0 = disabled, nonzero = enabled
139
   const char* device_id;
140
   size_t num_of_threads;  ///< 0 = Use default number of threads
141
   const char* cache_dir;  // path is set to empty by default
142
@@ -677,6 +700,15 @@
143
 
144
 typedef OrtStatus*(ORT_API_CALL* RegisterCustomOpsFn)(OrtSessionOptions* options, const OrtApiBase* api);
145
 
146
+/** \brief Callback function for RunAsync
147
+ *
148
+ * \paramin user_data User specific data that passed back to the callback
149
+ * \paramout outputs On succeed, outputs host inference results, on error, the value will be nullptr
150
+ * \paramout num_outputs Number of outputs, on error, the value will be zero
151
+ * \paramout status On error, status will provide details
152
+ */
153
+typedef void (*RunAsyncCallbackFn)(void* user_data, OrtValue** outputs, size_t num_outputs, OrtStatusPtr status);
154
+
155
 /** \brief The C API
156
  *
157
  * All C API functions are defined inside this structure as pointers to functions.
158
@@ -717,6 +749,8 @@
159
 
160
   /** \brief Create an OrtEnv
161
    *
162
+   * \note Invoking this function will return the same instance of the environment as that returned by a previous call
163
+   * to another env creation function; all arguments to this function will be ignored.
164
    * \paramin log_severity_level The log severity level.
165
    * \paramin logid The log identifier.
166
    * \paramout out Returned newly created OrtEnv. Must be freed with OrtApi::ReleaseEnv
167
@@ -727,17 +761,20 @@
168
 
169
   /** \brief Create an OrtEnv
170
    *
171
+   * \note Invoking this function will return the same instance of the environment as that returned by a previous call
172
+   * to another env creation function; all arguments to this function will be ignored. If you want to provide your
173
+   * own logging function, consider setting it using the SetUserLoggingFunction API instead.
174
    * \paramin logging_function A pointer to a logging function.
175
    * \paramin logger_param A pointer to arbitrary data passed as the ::OrtLoggingFunction `param` parameter to
176
-   *                         `logging_function`.
177
+   *                         `logging_function`. This parameter is optional.
178
    * \paramin log_severity_level The log severity level.
179
    * \paramin logid The log identifier.
180
    * \paramout out Returned newly created OrtEnv. Must be freed with OrtApi::ReleaseEnv
181
    *
182
    * \snippet{doc} snippets.dox OrtStatus Return Value
183
    */
184
-  ORT_API2_STATUS(CreateEnvWithCustomLogger, OrtLoggingFunction logging_function, _In_opt_ void* logger_param,
185
-                  OrtLoggingLevel log_severity_level, _In_ const char* logid, _Outptr_ OrtEnv** out);
186
+  ORT_API2_STATUS(CreateEnvWithCustomLogger, _In_ OrtLoggingFunction logging_function, _In_opt_ void* logger_param,
187
+                  _In_ OrtLoggingLevel log_severity_level, _In_ const char* logid, _Outptr_ OrtEnv** out);
188
 
189
   /** \brief Enable Telemetry
190
    *
191
@@ -959,7 +996,7 @@
192
 
193
   /** \brief Set the optimization level to apply when loading a graph
194
    *
195
-   * Please see https://onnxruntime.ai/docs/performance/graph-optimizations.html for an in-depth explanation
196
+   * Please see https://onnxruntime.ai/docs/performance/model-optimizations/graph-optimizations.html for an in-depth explanation
197
    * \paramin,out options The session options object
198
    * \paramin graph_optimization_level The optimization level
199
    *
200
@@ -2728,6 +2765,10 @@
201
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/onnxruntime_cxx_api.h -> onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_cxx_api.h Changed
201
 
1
@@ -24,6 +24,8 @@
2
 
3
 #pragma once
4
 #include "onnxruntime_c_api.h"
5
+#include "onnxruntime_float16.h"
6
+
7
 #include <cstddef>
8
 #include <cstdio>
9
 #include <array>
10
@@ -142,74 +144,358 @@
11
 std::vector<std::string> GetAvailableProviders();
12
 
13
 /** \brief IEEE 754 half-precision floating point data type
14
- * \details It is necessary for type dispatching to make use of C++ API
15
- * The type is implicitly convertible to/from uint16_t.
16
+ *
17
+ * \details This struct is used for converting float to float16 and back
18
+ * so the user could feed inputs and fetch outputs using these type.
19
+ *
20
  * The size of the structure should align with uint16_t and one can freely cast
21
  * uint16_t buffers to/from Ort::Float16_t to feed and retrieve data.
22
  *
23
- * Generally, you can feed any of your types as float16/blfoat16 data to create a tensor
24
- * on top of it, providing it can form a continuous buffer with 16-bit elements with no padding.
25
- * And you can also feed a array of uint16_t elements directly. For example,
26
- *
27
  * \code{.unparsed}
28
- * uint16_t values = { 15360, 16384, 16896, 17408, 17664};
29
- * constexpr size_t values_length = sizeof(values) / sizeof(values0);
30
- * std::vector<int64_t> dims = {values_length};  // one dimensional example
31
- * Ort::MemoryInfo info("Cpu", OrtDeviceAllocator, 0, OrtMemTypeDefault);
32
- * // Note we are passing bytes count in this api, not number of elements -> sizeof(values)
33
- * auto float16_tensor = Ort::Value::CreateTensor(info, values, sizeof(values),
34
- *                                                dims.data(), dims.size(), ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16);
35
- * \endcode
36
+ * // This example demonstrates converion from float to float16
37
+ * constexpr float values = {1.f, 2.f, 3.f, 4.f, 5.f};
38
+ * std::vector<Ort::Float16_t> fp16_values;
39
+ * fp16_values.reserve(std::size(values));
40
+ * std::transform(std::begin(values), std::end(values), std::back_inserter(fp16_values),
41
+ *     (float value) { return Ort::Float16_t(value); });
42
  *
43
- * Here is another example, a little bit more elaborate. Let's assume that you use your own float16 type and you want to use
44
- * a templated version of the API above so the type is automatically set based on your type. You will need to supply an extra
45
- * template specialization.
46
- *
47
- * \code{.unparsed}
48
- * namespace yours { struct half {}; } // assume this is your type, define this:
49
- * namespace Ort {
50
- * template<>
51
- * struct TypeToTensorType<yours::half> { static constexpr ONNXTensorElementDataType type = ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16; };
52
- * } //namespace Ort
53
- *
54
- * std::vector<yours::half> values;
55
- * std::vector<int64_t> dims = {values.size()}; // one dimensional example
56
- * Ort::MemoryInfo info("Cpu", OrtDeviceAllocator, 0, OrtMemTypeDefault);
57
- * // Here we are passing element count -> values.size()
58
- * auto float16_tensor = Ort::Value::CreateTensor<yours::half>(info, values.data(), values.size(), dims.data(), dims.size());
59
- *
60
- *  \endcode
61
- */
62
-struct Float16_t {
63
-  uint16_t value;
64
-  constexpr Float16_t() noexcept : value(0) {}
65
-  constexpr Float16_t(uint16_t v) noexcept : value(v) {}
66
-  constexpr operator uint16_t() const noexcept { return value; }
67
-  constexpr bool operator==(const Float16_t& rhs) const noexcept { return value == rhs.value; };
68
-  constexpr bool operator!=(const Float16_t& rhs) const noexcept { return value != rhs.value; };
69
+ * \endcode
70
+ */
71
+struct Float16_t : onnxruntime_float16::Float16Impl<Float16_t> {
72
+ private:
73
+  /// <summary>
74
+  /// Constructor from a 16-bit representation of a float16 value
75
+  /// No conversion is done here.
76
+  /// </summary>
77
+  /// <param name="v">16-bit representation</param>
78
+  constexpr explicit Float16_t(uint16_t v) noexcept { val = v; }
79
+
80
+ public:
81
+  using Base = onnxruntime_float16::Float16Impl<Float16_t>;
82
+
83
+  /// <summary>
84
+  /// Default constructor
85
+  /// </summary>
86
+  Float16_t() = default;
87
+
88
+  /// <summary>
89
+  /// Explicit conversion to uint16_t representation of float16.
90
+  /// </summary>
91
+  /// <param name="v">uint16_t bit representation of float16</param>
92
+  /// <returns>new instance of Float16_t</returns>
93
+  constexpr static Float16_t FromBits(uint16_t v) noexcept { return Float16_t(v); }
94
+
95
+  /// <summary>
96
+  /// __ctor from float. Float is converted into float16 16-bit representation.
97
+  /// </summary>
98
+  /// <param name="v">float value</param>
99
+  explicit Float16_t(float v) noexcept { val = Base::ToUint16Impl(v); }
100
+
101
+  /// <summary>
102
+  /// Converts float16 to float
103
+  /// </summary>
104
+  /// <returns>float representation of float16 value</returns>
105
+  float ToFloat() const noexcept { return Base::ToFloatImpl(); }
106
+
107
+  /// <summary>
108
+  /// Checks if the value is negative
109
+  /// </summary>
110
+  /// <returns>true if negative</returns>
111
+  using Base::IsNegative;
112
+
113
+  /// <summary>
114
+  /// Tests if the value is NaN
115
+  /// </summary>
116
+  /// <returns>true if NaN</returns>
117
+  using Base::IsNaN;
118
+
119
+  /// <summary>
120
+  /// Tests if the value is finite
121
+  /// </summary>
122
+  /// <returns>true if finite</returns>
123
+  using Base::IsFinite;
124
+
125
+  /// <summary>
126
+  /// Tests if the value represents positive infinity.
127
+  /// </summary>
128
+  /// <returns>true if positive infinity</returns>
129
+  using Base::IsPositiveInfinity;
130
+
131
+  /// <summary>
132
+  /// Tests if the value represents negative infinity
133
+  /// </summary>
134
+  /// <returns>true if negative infinity</returns>
135
+  using Base::IsNegativeInfinity;
136
+
137
+  /// <summary>
138
+  /// Tests if the value is either positive or negative infinity.
139
+  /// </summary>
140
+  /// <returns>True if absolute value is infinity</returns>
141
+  using Base::IsInfinity;
142
+
143
+  /// <summary>
144
+  /// Tests if the value is NaN or zero. Useful for comparisons.
145
+  /// </summary>
146
+  /// <returns>True if NaN or zero.</returns>
147
+  using Base::IsNaNOrZero;
148
+
149
+  /// <summary>
150
+  /// Tests if the value is normal (not zero, subnormal, infinite, or NaN).
151
+  /// </summary>
152
+  /// <returns>True if so</returns>
153
+  using Base::IsNormal;
154
+
155
+  /// <summary>
156
+  /// Tests if the value is subnormal (denormal).
157
+  /// </summary>
158
+  /// <returns>True if so</returns>
159
+  using Base::IsSubnormal;
160
+
161
+  /// <summary>
162
+  /// Creates an instance that represents absolute value.
163
+  /// </summary>
164
+  /// <returns>Absolute value</returns>
165
+  using Base::Abs;
166
+
167
+  /// <summary>
168
+  /// Creates a new instance with the sign flipped.
169
+  /// </summary>
170
+  /// <returns>Flipped sign instance</returns>
171
+  using Base::Negate;
172
+
173
+  /// <summary>
174
+  /// IEEE defines that positive and negative zero are equal, this gives us a quick equality check
175
+  /// for two values by or'ing the private bits together and stripping the sign. They are both zero,
176
+  /// and therefore equivalent, if the resulting value is still zero.
177
+  /// </summary>
178
+  /// <param name="lhs">first value</param>
179
+  /// <param name="rhs">second value</param>
180
+  /// <returns>True if both arguments represent zero</returns>
181
+  using Base::AreZero;
182
+
183
+  /// <summary>
184
+  /// User defined conversion operator. Converts Float16_t to float.
185
+  /// </summary>
186
+  explicit operator float() const noexcept { return ToFloat(); }
187
+
188
+  using Base::operator==;
189
+  using Base::operator!=;
190
+  using Base::operator<;
191
 };
192
 
193
 static_assert(sizeof(Float16_t) == sizeof(uint16_t), "Sizes must match");
194
 
195
 /** \brief bfloat16 (Brain Floating Point) data type
196
- * \details It is necessary for type dispatching to make use of C++ API
197
- * The type is implicitly convertible to/from uint16_t.
198
+ *
199
+ * \details This struct is used for converting float to bfloat16 and back
200
+ * so the user could feed inputs and fetch outputs using these type.
201
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/onnxruntime_cxx_inline.h -> onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_cxx_inline.h Changed
201
 
1
@@ -7,6 +7,17 @@
2
 // These are the inline implementations of the C++ header APIs. They're in this separate file as to not clutter
3
 // the main C++ file with implementation details.
4
 
5
+#include <cstring>
6
+#include <functional>
7
+
8
+#define RETURN_ON_API_FAIL(expression) \
9
+  {                                    \
10
+    auto err = (expression);           \
11
+    if (err) {                         \
12
+      return Status(err);              \
13
+    }                                  \
14
+  }
15
+
16
 namespace Ort {
17
 
18
 namespace detail {
19
@@ -114,6 +125,47 @@
20
   static constexpr ONNXTensorElementDataType type = ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL;
21
 };
22
 
23
+template <>
24
+struct TypeToTensorType<Float8E4M3FN_t> {
25
+  static constexpr ONNXTensorElementDataType type = ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FN;
26
+};
27
+template <>
28
+struct TypeToTensorType<Float8E4M3FNUZ_t> {
29
+  static constexpr ONNXTensorElementDataType type = ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E4M3FNUZ;
30
+};
31
+template <>
32
+struct TypeToTensorType<Float8E5M2_t> {
33
+  static constexpr ONNXTensorElementDataType type = ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2;
34
+};
35
+template <>
36
+struct TypeToTensorType<Float8E5M2FNUZ_t> {
37
+  static constexpr ONNXTensorElementDataType type = ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT8E5M2FNUZ;
38
+};
39
+
40
+inline bool BFloat16_t::operator==(const BFloat16_t& rhs) const noexcept {
41
+  if (IsNaN() || rhs.IsNaN()) {
42
+    // IEEE defines that NaN is not equal to anything, including itself.
43
+    return false;
44
+  }
45
+  return val == rhs.val;
46
+}
47
+
48
+inline bool BFloat16_t::operator<(const BFloat16_t& rhs) const noexcept {
49
+  if (IsNaN() || rhs.IsNaN()) {
50
+    // IEEE defines that NaN is unordered with respect to everything, including itself.
51
+    return false;
52
+  }
53
+
54
+  const bool left_is_negative = IsNegative();
55
+  if (left_is_negative != rhs.IsNegative()) {
56
+    // When the signs of left and right differ, we know that left is less than right if it is
57
+    // the negative value. The exception to this is if both values are zero, in which case IEEE
58
+    // says they should be equal, even if the signs differ.
59
+    return left_is_negative && !AreZero(*this, rhs);
60
+  }
61
+  return (val != rhs.val) && ((val < rhs.val) ^ left_is_negative);
62
+}
63
+
64
 inline MemoryAllocation::MemoryAllocation(OrtAllocator* allocator, void* p, size_t size)
65
     : allocator_(allocator), p_(p), size_(size) {
66
 }
67
@@ -472,6 +524,21 @@
68
   return *this;
69
 }
70
 
71
+inline Env& Env::CreateAndRegisterAllocatorV2(const std::string& provider_type, const OrtMemoryInfo* mem_info, const std::unordered_map<std::string, std::string>& options, const OrtArenaCfg* arena_cfg) {
72
+  std::vector<const char*> keys, values;
73
+  auto num_entries = options.size();
74
+  if (num_entries > 0) {
75
+    keys.reserve(num_entries);
76
+    values.reserve(num_entries);
77
+    for (const auto& entry : options) {
78
+      keys.push_back(entry.first.c_str());
79
+      values.push_back(entry.second.c_str());
80
+    }
81
+  }
82
+  ThrowOnError(GetApi().CreateAndRegisterAllocatorV2(p_, provider_type.c_str(), mem_info, arena_cfg, keys.data(), values.data(), num_entries));
83
+  return *this;
84
+}
85
+
86
 inline CustomOpDomain::CustomOpDomain(const char* domain) {
87
   ThrowOnError(GetApi().CreateCustomOpDomain(domain, &p_));
88
 }
89
@@ -590,6 +657,12 @@
90
 }
91
 
92
 template <typename T>
93
+inline SessionOptionsImpl<T>& SessionOptionsImpl<T>::SetDeterministicCompute(bool value) {
94
+  ThrowOnError(GetApi().SetDeterministicCompute(this->p_, value));
95
+  return *this;
96
+}
97
+
98
+template <typename T>
99
 inline SessionOptionsImpl<T>& SessionOptionsImpl<T>::SetOptimizedModelFilePath(const ORTCHAR_T* optimized_model_filepath) {
100
   ThrowOnError(GetApi().SetOptimizedModelFilePath(this->p_, optimized_model_filepath));
101
   return *this;
102
@@ -793,6 +866,26 @@
103
 }
104
 
105
 template <typename T>
106
+inline SessionOptionsImpl<T>& SessionOptionsImpl<T>::AppendExecutionProvider_OpenVINO_V2(const std::unordered_map<std::string, std::string>& provider_options) {
107
+  auto num_entries = provider_options.size();
108
+  std::vector<const char*> keys, values;
109
+  if (num_entries > 0) {
110
+    keys.reserve(num_entries);
111
+    values.reserve(num_entries);
112
+
113
+    for (const auto& entry : provider_options) {
114
+      keys.push_back(entry.first.c_str());
115
+      values.push_back(entry.second.c_str());
116
+    }
117
+  }
118
+
119
+  ThrowOnError(GetApi().SessionOptionsAppendExecutionProvider_OpenVINO_V2(this->p_,
120
+                                                                          keys.data(), values.data(), num_entries));
121
+
122
+  return *this;
123
+}
124
+
125
+template <typename T>
126
 inline SessionOptionsImpl<T>& SessionOptionsImpl<T>::RegisterCustomOpsLibrary(const ORTCHAR_T* library_name,
127
                                                                               const CustomOpConfigs& custom_op_configs) {
128
   // Add custom op config entries before registering the custom op library. Otherwise, the config entries _may_ be ignored by
129
@@ -915,6 +1008,16 @@
130
 }
131
 
132
 template <typename T>
133
+inline void SessionImpl<T>::RunAsync(const RunOptions& run_options, const char* const* input_names, const Value* input_values, size_t input_count,
134
+                                     const char* const* output_names, Value* output_values, size_t output_count, RunAsyncCallbackFn callback, void* user_data) {
135
+  auto ort_input_values = reinterpret_cast<const OrtValue* const*>(input_values);
136
+  auto ort_output_values = reinterpret_cast<OrtValue**>(output_values);
137
+  ThrowOnError(GetApi().RunAsync(this->p_, run_options, input_names,
138
+                                 ort_input_values, input_count, output_names, output_count,
139
+                                 ort_output_values, callback, user_data));
140
+}
141
+
142
+template <typename T>
143
 inline AllocatedStringPtr SessionImpl<T>::EndProfilingAllocated(OrtAllocator* allocator) {
144
   char* out = nullptr;
145
   ThrowOnError(GetApi().SessionEndProfiling(this->p_, allocator, &out));
146
@@ -1434,16 +1537,16 @@
147
 }
148
 #endif  // !defined(DISABLE_SPARSE_TENSORS)
149
 
150
-inline Value Value::CreateMap(Value& keys, Value& values) {
151
+inline Value Value::CreateMap(const Value& keys, const Value& values) {
152
   OrtValue* out;
153
-  OrtValue* inputs2 = {keys, values};
154
+  const OrtValue* inputs2 = {keys, values};
155
   ThrowOnError(GetApi().CreateValue(inputs, 2, ONNX_TYPE_MAP, &out));
156
   return Value{out};
157
 }
158
 
159
-inline Value Value::CreateSequence(std::vector<Value>& values) {
160
+inline Value Value::CreateSequence(const std::vector<Value>& values) {
161
   OrtValue* out;
162
-  std::vector<OrtValue*> values_ort{values.data(), values.data() + values.size()};
163
+  std::vector<const OrtValue*> values_ort{values.data(), values.data() + values.size()};
164
   ThrowOnError(GetApi().CreateValue(values_ort.data(), values_ort.size(), ONNX_TYPE_SEQUENCE, &out));
165
   return Value{out};
166
 }
167
@@ -1575,6 +1678,10 @@
168
   return Logger{out};
169
 }
170
 
171
+inline void KernelContext::ParallelFor(void (*fn)(void*, size_t), size_t total, size_t num_batch, void* usr_data) const {
172
+  ThrowOnError(GetApi().KernelContext_ParallelFor(ctx_, fn, total, num_batch, usr_data));
173
+}
174
+
175
 inline OpAttr::OpAttr(const char* name, const void* data, int len, OrtOpAttrType type) {
176
   Ort::ThrowOnError(GetApi().CreateOpAttr(name, data, len, type, &p_));
177
 }
178
@@ -1770,223 +1877,6 @@
179
                                       output_values, static_cast<int>(output_count)));
180
 }
181
 
182
-inline void CustomOpApi::ThrowOnError(OrtStatus* status) {
183
-  Ort::ThrowOnError(status);
184
-}
185
-
186
-template <>
187
-inline float CustomOpApi::KernelInfoGetAttribute<float>(_In_ const OrtKernelInfo* info, _In_ const char* name) {
188
-  float out;
189
-  Ort::ThrowOnError(api_.KernelInfoGetAttribute_float(info, name, &out));
190
-  return out;
191
-}
192
-
193
-template <>
194
-inline int64_t CustomOpApi::KernelInfoGetAttribute<int64_t>(_In_ const OrtKernelInfo* info, _In_ const char* name) {
195
-  int64_t out;
196
-  Ort::ThrowOnError(api_.KernelInfoGetAttribute_int64(info, name, &out));
197
-  return out;
198
-}
199
-
200
-template <>
201
onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_float16.h Added
201
 
1
@@ -0,0 +1,540 @@
2
+// Copyright (c) Microsoft Corporation. All rights reserved.
3
+// Licensed under the MIT License.
4
+
5
+#pragma once
6
+
7
+#include <stdint.h>
8
+#include <cmath>
9
+#include <cstring>
10
+#include <limits>
11
+
12
+namespace onnxruntime_float16 {
13
+
14
+namespace detail {
15
+
16
+enum class endian {
17
+#if defined(_WIN32)
18
+  little = 0,
19
+  big = 1,
20
+  native = little,
21
+#elif defined(__GNUC__) || defined(__clang__)
22
+  little = __ORDER_LITTLE_ENDIAN__,
23
+  big = __ORDER_BIG_ENDIAN__,
24
+  native = __BYTE_ORDER__,
25
+#else
26
+#error onnxruntime_float16::detail::endian is not implemented in this environment.
27
+#endif
28
+};
29
+
30
+static_assert(
31
+    endian::native == endian::little || endian::native == endian::big,
32
+    "Only little-endian or big-endian native byte orders are supported.");
33
+
34
+}  // namespace detail
35
+
36
+/// <summary>
37
+/// Shared implementation between public and internal classes. CRTP pattern.
38
+/// </summary>
39
+template <class Derived>
40
+struct Float16Impl {
41
+ protected:
42
+  /// <summary>
43
+  /// Converts from float to uint16_t float16 representation
44
+  /// </summary>
45
+  /// <param name="v"></param>
46
+  /// <returns></returns>
47
+  constexpr static uint16_t ToUint16Impl(float v) noexcept;
48
+
49
+  /// <summary>
50
+  /// Converts float16 to float
51
+  /// </summary>
52
+  /// <returns>float representation of float16 value</returns>
53
+  float ToFloatImpl() const noexcept;
54
+
55
+  /// <summary>
56
+  /// Creates an instance that represents absolute value.
57
+  /// </summary>
58
+  /// <returns>Absolute value</returns>
59
+  uint16_t AbsImpl() const noexcept {
60
+    return static_cast<uint16_t>(val & ~kSignMask);
61
+  }
62
+
63
+  /// <summary>
64
+  /// Creates a new instance with the sign flipped.
65
+  /// </summary>
66
+  /// <returns>Flipped sign instance</returns>
67
+  uint16_t NegateImpl() const noexcept {
68
+    return IsNaN() ? val : static_cast<uint16_t>(val ^ kSignMask);
69
+  }
70
+
71
+ public:
72
+  // uint16_t special values
73
+  static constexpr uint16_t kSignMask = 0x8000U;
74
+  static constexpr uint16_t kBiasedExponentMask = 0x7C00U;
75
+  static constexpr uint16_t kPositiveInfinityBits = 0x7C00U;
76
+  static constexpr uint16_t kNegativeInfinityBits = 0xFC00U;
77
+  static constexpr uint16_t kPositiveQNaNBits = 0x7E00U;
78
+  static constexpr uint16_t kNegativeQNaNBits = 0xFE00U;
79
+  static constexpr uint16_t kEpsilonBits = 0x4170U;
80
+  static constexpr uint16_t kMinValueBits = 0xFBFFU;  // Minimum normal number
81
+  static constexpr uint16_t kMaxValueBits = 0x7BFFU;  // Largest normal number
82
+  static constexpr uint16_t kOneBits = 0x3C00U;
83
+  static constexpr uint16_t kMinusOneBits = 0xBC00U;
84
+
85
+  uint16_t val{0};
86
+
87
+  Float16Impl() = default;
88
+
89
+  /// <summary>
90
+  /// Checks if the value is negative
91
+  /// </summary>
92
+  /// <returns>true if negative</returns>
93
+  bool IsNegative() const noexcept {
94
+    return static_cast<int16_t>(val) < 0;
95
+  }
96
+
97
+  /// <summary>
98
+  /// Tests if the value is NaN
99
+  /// </summary>
100
+  /// <returns>true if NaN</returns>
101
+  bool IsNaN() const noexcept {
102
+    return AbsImpl() > kPositiveInfinityBits;
103
+  }
104
+
105
+  /// <summary>
106
+  /// Tests if the value is finite
107
+  /// </summary>
108
+  /// <returns>true if finite</returns>
109
+  bool IsFinite() const noexcept {
110
+    return AbsImpl() < kPositiveInfinityBits;
111
+  }
112
+
113
+  /// <summary>
114
+  /// Tests if the value represents positive infinity.
115
+  /// </summary>
116
+  /// <returns>true if positive infinity</returns>
117
+  bool IsPositiveInfinity() const noexcept {
118
+    return val == kPositiveInfinityBits;
119
+  }
120
+
121
+  /// <summary>
122
+  /// Tests if the value represents negative infinity
123
+  /// </summary>
124
+  /// <returns>true if negative infinity</returns>
125
+  bool IsNegativeInfinity() const noexcept {
126
+    return val == kNegativeInfinityBits;
127
+  }
128
+
129
+  /// <summary>
130
+  /// Tests if the value is either positive or negative infinity.
131
+  /// </summary>
132
+  /// <returns>True if absolute value is infinity</returns>
133
+  bool IsInfinity() const noexcept {
134
+    return AbsImpl() == kPositiveInfinityBits;
135
+  }
136
+
137
+  /// <summary>
138
+  /// Tests if the value is NaN or zero. Useful for comparisons.
139
+  /// </summary>
140
+  /// <returns>True if NaN or zero.</returns>
141
+  bool IsNaNOrZero() const noexcept {
142
+    auto abs = AbsImpl();
143
+    return (abs == 0 || abs > kPositiveInfinityBits);
144
+  }
145
+
146
+  /// <summary>
147
+  /// Tests if the value is normal (not zero, subnormal, infinite, or NaN).
148
+  /// </summary>
149
+  /// <returns>True if so</returns>
150
+  bool IsNormal() const noexcept {
151
+    auto abs = AbsImpl();
152
+    return (abs < kPositiveInfinityBits)           // is finite
153
+           && (abs != 0)                           // is not zero
154
+           && ((abs & kBiasedExponentMask) != 0);  // is not subnormal (has a non-zero exponent)
155
+  }
156
+
157
+  /// <summary>
158
+  /// Tests if the value is subnormal (denormal).
159
+  /// </summary>
160
+  /// <returns>True if so</returns>
161
+  bool IsSubnormal() const noexcept {
162
+    auto abs = AbsImpl();
163
+    return (abs < kPositiveInfinityBits)           // is finite
164
+           && (abs != 0)                           // is not zero
165
+           && ((abs & kBiasedExponentMask) == 0);  // is subnormal (has a zero exponent)
166
+  }
167
+
168
+  /// <summary>
169
+  /// Creates an instance that represents absolute value.
170
+  /// </summary>
171
+  /// <returns>Absolute value</returns>
172
+  Derived Abs() const noexcept { return Derived::FromBits(AbsImpl()); }
173
+
174
+  /// <summary>
175
+  /// Creates a new instance with the sign flipped.
176
+  /// </summary>
177
+  /// <returns>Flipped sign instance</returns>
178
+  Derived Negate() const noexcept { return Derived::FromBits(NegateImpl()); }
179
+
180
+  /// <summary>
181
+  /// IEEE defines that positive and negative zero are equal, this gives us a quick equality check
182
+  /// for two values by or'ing the private bits together and stripping the sign. They are both zero,
183
+  /// and therefore equivalent, if the resulting value is still zero.
184
+  /// </summary>
185
+  /// <param name="lhs">first value</param>
186
+  /// <param name="rhs">second value</param>
187
+  /// <returns>True if both arguments represent zero</returns>
188
+  static bool AreZero(const Float16Impl& lhs, const Float16Impl& rhs) noexcept {
189
+    return static_cast<uint16_t>((lhs.val | rhs.val) & ~kSignMask) == 0;
190
+  }
191
+
192
+  bool operator==(const Float16Impl& rhs) const noexcept {
193
+    if (IsNaN() || rhs.IsNaN()) {
194
+      // IEEE defines that NaN is not equal to anything, including itself.
195
+      return false;
196
+    }
197
+    return val == rhs.val;
198
+  }
199
+
200
+  bool operator!=(const Float16Impl& rhs) const noexcept { return !(*this == rhs); }
201
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/onnxruntime_session_options_config_keys.h -> onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_session_options_config_keys.h Changed
97
 
1
@@ -67,20 +67,30 @@
2
 // GeluApproximation has side effects which may change the inference results. It is disabled by default due to this.
3
 static const char* const kOrtSessionOptionsEnableGeluApproximation = "optimization.enable_gelu_approximation";
4
 
5
+// This setting controls whether to enable AheadOfTime function inlining.
6
+// AOT function inlining examines the graph and attempts to inline as many locally defined functions in the model
7
+// as possible with the help of enabled execution providers.
8
+// This can reduce the number of function calls and improve performance because it is done before
9
+// Level1 optimizers and constant folding. However, under some circumstances, when the EPs are not available,
10
+// one can disable the AOT inlining, produce an optimized model and postpone AOT until run time.
11
+// "0": enable; "1": disable.
12
+// Its default value is "0".
13
+static const char* const kOrtSessionOptionsDisableAheadOfTimeFunctionInlining = "session.disable_aot_function_inlining";
14
+
15
 #ifdef ENABLE_TRAINING
16
 // Specifies a list of op types for memory footprint reduction.
17
 // The value should be a ","-delimited list of pair of
18
-// <subgraph string : optimization strategy : number of subgraph to apply>.
19
+// <subgraph string: optimization strategy: number of subgraph to apply>.
20
 // For example, "Gelu+Cast+:1:0,Dropout+:1:1".
21
 //   A valid "subgraph string" should be one subgraph representation output by ORT graph transformations.
22
 //   "optimization strategy" currently has valid values: 0 - disabled, 1 - recompute.
23
 //   "number of subgraph to apply" is used to control how many subgraphs to apply optimization, to avoid "oversaving"
24
 //   the memory.
25
-static const char* const kOrtSessionOptionsMemoryOptimizerEnabler = "optimization.enable_memory_optimizer";
26
+static const char* const kOrtSessionOptionsMemoryOptimizerEnabler = "optimization.memory_optimizer_config";
27
 
28
-// Specifies the level for detecting subgraphs for memory footprint reduction.
29
-// The value should be an integer. The default value is 0.
30
-static const char* const kOrtSessionOptionsMemoryOptimizerProbeLevel = "optimization.enable_memory_probe_recompute_level";
31
+// Specifies the config for detecting subgraphs for memory footprint reduction.
32
+// The value should be a string contains int separated using commas. The default value is "0:0".
33
+static const char* const kOrtSessionOptionsMemoryOptimizerProbeConfig = "optimization.enable_memory_probe_recompute_config";
34
 #endif
35
 
36
 // Enable or disable using device allocator for allocating initialized tensor memory. "1": enable; "0": disable. The default is "0".
37
@@ -165,6 +175,11 @@
38
 // May be useful to expose bugs in models.
39
 static const char* const kOrtSessionOptionsConfigStrictShapeTypeInference = "session.strict_shape_type_inference";
40
 
41
+// "1": every model using a more recent opset than the latest released one will fail
42
+// "0": the model may or may not work if onnxruntime cannot find an implementation, this option
43
+// is used for development purpose.
44
+static const char* const kOrtSessionOptionsConfigStrictAllowReleasedOpsetsOnly = "session.allow_released_opsets_only";
45
+
46
 // The file saves configuration for partitioning node among logic streams
47
 static const char* const kNodePartitionConfigFile = "session.node_partition_config_file";
48
 
49
@@ -197,3 +212,47 @@
50
 //   3) after the L1 transformers are applied to the updated graph.
51
 // The model will be saved to filename post_layout_transform_step_<step_number>.onnx.
52
 static const char* const kDebugLayoutTransformation = "session.debug_layout_transformation";
53
+
54
+// Graph nodes that are not supported by the execution providers (EPs) explicitly added to the session are
55
+// assigned (i.e., "fallback") to the CPU EP by default.
56
+//
57
+// This option allows the user to disable the fallback of unsupported graph nodes to the CPU EP.
58
+// If this option is set to "1", session creation will fail if the execution providers other than the CPU EP cannot
59
+// fully support all of the nodes in the graph.
60
+//
61
+// It is invalid to set this option and explicitly add the CPU EP to the session. In this case, session creation
62
+// will also fail with an error.
63
+//
64
+// Option values:
65
+// - "0": CPU EP fallback is not disabled. DEFAULT
66
+// - "1": CPU EP fallback is disabled.
67
+static const char* const kOrtSessionOptionsDisableCPUEPFallback = "session.disable_cpu_ep_fallback";
68
+
69
+// Use this config when serializing a large model after optimization to specify an external initializers file
70
+static const char* const kOrtSessionOptionsOptimizedModelExternalInitializersFileName =
71
+    "session.optimized_model_external_initializers_file_name";
72
+
73
+// Use this config to control the minimum size of the initializer when externalizing it during serialization
74
+static const char* const kOrtSessionOptionsOptimizedModelExternalInitializersMinSizeInBytes =
75
+    "session.optimized_model_external_initializers_min_size_in_bytes";
76
+
77
+// Enable EP context feature to dump the partitioned graph which includes the EP context into Onnx file.
78
+// The dumped Onnx model with EP context can be used for future inference to avoid the EP graph partitioning/compile overhead.
79
+// "0": disable. (default)
80
+// "1": enable.
81
+static const char* const kOrtSessionOptionEpContextEnable = "ep.context_enable";
82
+
83
+// Specify the file path for the Onnx model which has EP context.
84
+// Default to original_file_name_ctx.onnx if not specified
85
+static const char* const kOrtSessionOptionEpContextFilePath = "ep.context_file_path";
86
+
87
+// Flag to specify whether to dump the EP context into the Onnx model.
88
+// "0": dump the EP context into separate file, keep the file name in the Onnx model.
89
+// "1": dump the EP context into the Onnx model. (default).
90
+static const char* const kOrtSessionOptionEpContextEmbedMode = "ep.context_embed_mode";
91
+
92
+// Gemm fastmath mode provides fp32 gemm acceleration with bfloat16 based matmul.
93
+// Option values:
94
+// - "0": Gemm FastMath mode is not enabled. DEFAULT
95
+// - "1": Gemm FastMath mode is enabled.
96
+static const char* const kOrtSessionOptionsMlasGemmFastMathArm64Bfloat16 = "mlas.enable_gemm_fastmath_arm64_bfloat16";
97
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/onnxruntime_training_c_api.h -> onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_training_c_api.h Changed
200
 
1
@@ -13,7 +13,7 @@
2
  *
3
  * In order to train a model with onnxruntime, the following training artifacts must be generated:
4
  * - The training onnx model
5
- * - The checkpoint directory
6
+ * - The checkpoint file
7
  * - The optimizer onnx model
8
  * - The eval onnx model model (optional)
9
  *
10
@@ -123,9 +123,9 @@
11
   /// \name Accessing The Training Session State
12
   /// @{
13
 
14
-  /** \brief Load a checkpoint state from directory on disk into checkpoint_state.
15
+  /** \brief Load a checkpoint state from a file on disk into checkpoint_state.
16
    *
17
-   * This function will parse a checkpoint directory, pull relevant files and load the training
18
+   * This function will parse a checkpoint file, pull relevant data and load the training
19
    * state into the checkpoint_state. This checkpoint state can then be used to create the
20
    * training session by invoking OrtTrainingApi::CreateTrainingSession. By doing so, the training
21
    * session will resume training from the given checkpoint state.
22
@@ -133,7 +133,7 @@
23
    * training state (including model parameters, its gradients, the optimizer states and the properties).
24
    * As a result, it is required that the checkpoint state outlive the lifetime of the training session.
25
    *
26
-   * \paramin checkpoint_path Path to the checkpoint directory
27
+   * \paramin checkpoint_path Path to the checkpoint file
28
    * \paramout checkpoint_state Checkpoint state that contains the states of the training session.
29
    *
30
    * \snippet{doc} snippets.dox OrtStatus Return Value
31
@@ -142,14 +142,14 @@
32
   ORT_API2_STATUS(LoadCheckpoint, _In_ const ORTCHAR_T* checkpoint_path,
33
                   _Outptr_ OrtCheckpointState** checkpoint_state);
34
 
35
-  /** \brief Save the given state to a checkpoint directory on disk.
36
+  /** \brief Save the given state to a checkpoint file on disk.
37
    *
38
-   * This function serializes the provided checkpoint state to a directory on disk.
39
+   * This function serializes the provided checkpoint state to a file on disk.
40
    * This checkpoint can later be loaded by invoking OrtTrainingApi::LoadCheckpoint to resume
41
    * training from this snapshot of the state.
42
    *
43
    * \paramin checkpoint_state The checkpoint state to save.
44
-   * \paramin checkpoint_path Path to the checkpoint directory.
45
+   * \paramin checkpoint_path Path to the checkpoint file.
46
    * \paramin include_optimizer_state Flag to indicate whether to save the optimizer state or not.
47
    *
48
    * \snippet{doc} snippets.dox OrtStatus Return Value
49
@@ -172,7 +172,7 @@
50
    * - The training onnx model
51
    * - The evaluation onnx model (optional)
52
    * - The optimizer onnx model
53
-   * - The checkpoint directory
54
+   * - The checkpoint file
55
    *
56
    * These artifacts can be generated using the `onnxruntime-training` python utility(https://github.com/microsoft/onnxruntime/blob/main/orttraining/orttraining/python/training/onnxblock/README.md).
57
    *
58
@@ -190,7 +190,29 @@
59
   ORT_API2_STATUS(CreateTrainingSession, _In_ const OrtEnv* env, _In_ const OrtSessionOptions* options,
60
                   _Inout_ OrtCheckpointState* checkpoint_state, _In_ const ORTCHAR_T* train_model_path,
61
                   _In_ const ORTCHAR_T* eval_model_path, _In_ const ORTCHAR_T* optimizer_model_path,
62
-                  _Outptr_ OrtTrainingSession** out);
63
+                  _Outptr_result_maybenull_ OrtTrainingSession** out);
64
+
65
+  /** \brief Create a training session that can be used to begin or resume training.
66
+   * This api provides a way to load all the training artifacts from buffers instead of files.
67
+   *
68
+   * \paramin env Environment to be used for the training session.
69
+   * \paramin options Session options that the user can customize for this training session.
70
+   * \paramin checkpoint_state Training states that the training session uses as a starting point for training.
71
+   * \paramin train_model_data Buffer containing the model data to be used to perform training
72
+   * \paramin train_data_length Length of the buffer containing train_model_data
73
+   * \paramin eval_model_data Buffer containing the model data to be used to perform evaluation
74
+   * \paramin eval_data_length Length of the buffer containing eval_model_data
75
+   * \paramin optim_model_data Buffer containing the model data to be used to perform weight update
76
+   * \paramin optim_data_length Length of the buffer containing optim_model_data
77
+   * \paramout out Created training session.
78
+   *
79
+   */
80
+  ORT_API2_STATUS(CreateTrainingSessionFromBuffer, _In_ const OrtEnv* env,
81
+                  _In_ const OrtSessionOptions* options, _Inout_ OrtCheckpointState* checkpoint_state,
82
+                  _In_ const void* train_model_data, size_t train_data_length,
83
+                  _In_ const void* eval_model_data, size_t eval_data_length,
84
+                  _In_ const void* optim_model_data, size_t optim_data_length,
85
+                  _Outptr_result_maybenull_ OrtTrainingSession** out);
86
 
87
   /// @}
88
 
89
@@ -586,14 +608,14 @@
90
   /// \name Accessing The Training Session State
91
   /// @{
92
 
93
-  /** \brief Adds the given property to the checkpoint state.
94
+  /** \brief Adds or updates the given property to/in the checkpoint state.
95
    *
96
    * Runtime properties such as epoch, training step, best score, and others can be added to the checkpoint
97
-   * state by the user if they desire by calling this function with the appropriate property name and
98
-   * value. The given property name must be unique to be able to successfully add the property.
99
+   * state by the user by calling this function with the corresponding property name and value.
100
+   * The given property name must be unique to be able to successfully add the property.
101
    *
102
    * \paramin checkpoint_state The checkpoint state which should hold the property.
103
-   * \paramin property_name Unique name of the property being added.
104
+   * \paramin property_name Name of the property being added or updated.
105
    * \paramin property_type Type of the property associated with the given name.
106
    * \paramin property_value Property value associated with the given name.
107
    *
108
@@ -610,7 +632,7 @@
109
    * exist in the checkpoint state to be able to retrieve it successfully.
110
    *
111
    * \paramin checkpoint_state The checkpoint state that is currently holding the property.
112
-   * \paramin property_name Unique name of the property being retrieved.
113
+   * \paramin property_name Name of the property being retrieved.
114
    * \paramin allocator Allocator used to allocate the memory for the property_value.
115
    * \paramout property_type Type of the property associated with the given name.
116
    * \paramout property_value Property value associated with the given name.
117
@@ -623,6 +645,82 @@
118
                   _Out_ enum OrtPropertyType* property_type, _Outptr_ void** property_value);
119
 
120
   /// @}
121
+
122
+  /// \name Accessing The Training Session State
123
+  /// @{
124
+
125
+  /** \brief Load a checkpoint state from a buffer into checkpoint_state.
126
+   *
127
+   * This function will parse a checkpoint bytes buffer, pull relevant data and load the training
128
+   * state into the checkpoint_state. This checkpoint state can then be used to create the
129
+   * training session by invoking OrtTrainingApi::CreateTrainingSession. By doing so, the training
130
+   * session will resume training from the given checkpoint state.
131
+   * \note Note that the training session created with a checkpoint state uses this state to store the entire
132
+   * training state (including model parameters, its gradients, the optimizer states and the properties).
133
+   * As a result, it is required that the checkpoint state outlive the lifetime of the training session.
134
+   *
135
+   * \paramin checkpoint_buffer Path to the checkpoint bytes buffer.
136
+   * \paramin num_bytes Number of bytes in the checkpoint buffer.
137
+   * \paramout checkpoint_state Checkpoint state that contains the states of the training session.
138
+   *
139
+   * \snippet{doc} snippets.dox OrtStatus Return Value
140
+   *
141
+   */
142
+  ORT_API2_STATUS(LoadCheckpointFromBuffer, _In_ const void* checkpoint_buffer,
143
+                  _In_ const size_t num_bytes, _Outptr_ OrtCheckpointState** checkpoint_state);
144
+
145
+  /** \brief Retrieves the type and shape information of the parameter associated with the given parameter name.
146
+   *
147
+   * This function retrieves the type and shape of the parameter associated with the given parameter name.
148
+   * The parameter must exist in the checkpoint state to be able to retrieve its type and shape information successfully.
149
+   *
150
+   * \paramin checkpoint_state The checkpoint state.
151
+   * \paramin parameter_name Name of the parameter being retrieved.
152
+   * \paramout parameter_type_and_shape The type and shape of the parameter being retrieved.
153
+   *
154
+   * \snippet{doc} snippets.dox OrtStatus Return Value
155
+   *
156
+   */
157
+  ORT_API2_STATUS(GetParameterTypeAndShape, _In_ const OrtCheckpointState* checkpoint_state,
158
+                  _In_ const char* parameter_name, _Outptr_ OrtTensorTypeAndShapeInfo** parameter_type_and_shape);
159
+
160
+  /** \brief Updates the data associated with the model parameter in the checkpoint state for the given parameter name.
161
+   *
162
+   * This function updates a model parameter in the checkpoint state with the given parameter data.
163
+   * The training session must be already created with the checkpoint state that contains the parameter
164
+   * being updated. The given parameter is copied over to the registered device for the training session.
165
+   * The parameter must exist in the checkpoint state to be able to update it successfully.
166
+   *
167
+   * \paramin checkpoint_state The checkpoint state.
168
+   * \paramin parameter_name Name of the parameter being updated.
169
+   * \paramin parameter The parameter data that should replace the existing parameter data.
170
+   *
171
+   * \snippet{doc} snippets.dox OrtStatus Return Value
172
+   *
173
+   */
174
+  ORT_API2_STATUS(UpdateParameter, _Inout_ OrtCheckpointState* checkpoint_state,
175
+                  _In_ const char* parameter_name, _In_ OrtValue* parameter);
176
+
177
+  /** \brief Gets the data associated with the model parameter from the checkpoint state for the given parameter name.
178
+   *
179
+   * This function retrieves the model parameter data from the checkpoint state for the given parameter name.
180
+   * The parameter is copied over and returned as an OrtValue. The training session must be already created
181
+   * with the checkpoint state that contains the parameter being retrieved.
182
+   * The parameter must exist in the checkpoint state to be able to retrieve it successfully.
183
+   *
184
+   * \paramin checkpoint_state The checkpoint state.
185
+   * \paramin parameter_name Name of the parameter being retrieved.
186
+   * \paramin allocator Allocator used to allocate the memory for the parameter.
187
+   * \paramout parameter The parameter data that is retrieved from the checkpoint state.
188
+   *
189
+   * \snippet{doc} snippets.dox OrtStatus Return Value
190
+   *
191
+   */
192
+  ORT_API2_STATUS(GetParameter, _In_ const OrtCheckpointState* checkpoint_state,
193
+                  _In_ const char* parameter_name, _Inout_ OrtAllocator* allocator,
194
+                  _Outptr_ OrtValue** parameter);
195
+
196
+  /// @}
197
 };
198
 
199
 typedef struct OrtTrainingApi OrtTrainingApi;
200
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/onnxruntime_training_cxx_api.h -> onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_training_cxx_api.h Changed
144
 
1
@@ -71,27 +71,40 @@
2
   /// \name Accessing The Training Session State
3
   /// @{
4
 
5
-  /** \brief Load a checkpoint state from directory on disk into checkpoint_state.
6
+  /** \brief Load a checkpoint state from a file on disk into checkpoint_state.
7
    *
8
-   * This function will parse a checkpoint directory, pull relevant files and load the training
9
+   * This function will parse a checkpoint file, pull relevant data and load the training
10
    * state and return an instance of Ort::CheckpointState. This checkpoint state can then be used to create the
11
    * training session by instantiating Ort::TrainingSession. By doing so, the training session will resume
12
    * training from the given checkpoint state.
13
    *
14
-   * \paramin path_to_checkpoint Path to the checkpoint directory
15
+   * \paramin path_to_checkpoint Path to the checkpoint file
16
    * \return Ort::CheckpointState object which holds the state of the training session parameters.
17
    *
18
    */
19
   static CheckpointState LoadCheckpoint(const std::basic_string<ORTCHAR_T>& path_to_checkpoint);
20
 
21
-  /** \brief Save the given state to a checkpoint directory on disk.
22
+  /** \brief Load a checkpoint state from a buffer.
23
    *
24
-   * This function serializes the provided checkpoint state to a directory on disk.
25
+   * This function will parse a checkpoint buffer, pull relevant data and load the training
26
+   * state and return an instance of Ort::CheckpointState. This checkpoint state can then be used to create the
27
+   * training session by instantiating Ort::TrainingSession. By doing so, the training session will resume
28
+   * training from the given checkpoint state.
29
+   *
30
+   * \paramin buffer Buffer containing the checkpoint data.
31
+   * \return Ort::CheckpointState object which holds the state of the training session parameters.
32
+   *
33
+   */
34
+  static CheckpointState LoadCheckpointFromBuffer(const std::vector<uint8_t>& buffer);
35
+
36
+  /** \brief Save the given state to a checkpoint file on disk.
37
+   *
38
+   * This function serializes the provided checkpoint state to a file on disk.
39
    * This checkpoint can later be loaded by invoking Ort::CheckpointState::LoadCheckpoint to resume
40
    * training from this snapshot of the state.
41
    *
42
    * \paramin checkpoint_state The checkpoint state to save.
43
-   * \paramin path_to_checkpoint Path to the checkpoint directory.
44
+   * \paramin path_to_checkpoint Path to the checkpoint file.
45
    * \paramin include_optimizer_state Flag to indicate whether to save the optimizer state or not.
46
    *
47
    */
48
@@ -99,13 +112,13 @@
49
                              const std::basic_string<ORTCHAR_T>& path_to_checkpoint,
50
                              const bool include_optimizer_state = false);
51
 
52
-  /** \brief Adds the given property to the checkpoint state.
53
+  /** \brief Adds or updates the given property to/in the checkpoint state.
54
    *
55
    * Runtime properties such as epoch, training step, best score, and others can be added to the checkpoint
56
-   * state by the user if they desire by calling this function with the appropriate property name and
57
-   * value. The given property name must be unique to be able to successfully add the property.
58
+   * state by the user by calling this function with the corresponding property name and value.
59
+   * The given property name must be unique to be able to successfully add the property.
60
    *
61
-   * \paramin property_name Unique name of the property being added.
62
+   * \paramin property_name Name of the property being added or updated.
63
    * \paramin property_value Property value associated with the given name.
64
    *
65
    */
66
@@ -116,12 +129,38 @@
67
    * Gets the property value from an existing entry in the checkpoint state. The property must
68
    * exist in the checkpoint state to be able to retrieve it successfully.
69
    *
70
-   * \paramin property_name Unique name of the property being retrieved.
71
+   * \paramin property_name Name of the property being retrieved.
72
    * \return Property value associated with the given property name.
73
    *
74
    */
75
   Property GetProperty(const std::string& property_name);
76
 
77
+  /** \brief Updates the data associated with the model parameter in the checkpoint state for the given parameter name.
78
+   *
79
+   * This function updates a model parameter in the checkpoint state with the given parameter data.
80
+   * The training session must be already created with the checkpoint state that contains the parameter
81
+   * being updated. The given parameter is copied over to the registered device for the training session.
82
+   * The parameter must exist in the checkpoint state to be able to update it successfully.
83
+   *
84
+   * \paramin parameter_name Name of the parameter being updated.
85
+   * \paramin parameter The parameter data that should replace the existing parameter data.
86
+   *
87
+   */
88
+  void UpdateParameter(const std::string& parameter_name, const Value& parameter);
89
+
90
+  /** \brief Gets the data associated with the model parameter from the checkpoint state for the given parameter name.
91
+   *
92
+   * This function retrieves the model parameter data from the checkpoint state for the given parameter name.
93
+   * The parameter is copied over to the provided OrtValue. The training session must be already created
94
+   * with the checkpoint state that contains the parameter being retrieved.
95
+   * The parameter must exist in the checkpoint state to be able to retrieve it successfully.
96
+   *
97
+   * \paramin parameter_name Name of the parameter being retrieved.
98
+   * \return The parameter data that is retrieved from the checkpoint state.
99
+   *
100
+   */
101
+  Value GetParameter(const std::string& parameter_name);
102
+
103
   /// @}
104
 };
105
 
106
@@ -131,7 +170,7 @@
107
  * - The training onnx model
108
  * - The evaluation onnx model (optional)
109
  * - The optimizer onnx model
110
- * - The checkpoint directory
111
+ * - The checkpoint file
112
  *
113
  * These artifacts can be generated using the `onnxruntime-training` python utility(https://github.com/microsoft/onnxruntime/blob/main/orttraining/orttraining/python/training/onnxblock/README.md).
114
  *
115
@@ -163,6 +202,20 @@
116
                   const std::optional<std::basic_string<ORTCHAR_T>>& eval_model_path = std::nullopt,
117
                   const std::optional<std::basic_string<ORTCHAR_T>>& optimizer_model_path = std::nullopt);
118
 
119
+  /** \brief Create a training session that can be used to begin or resume training.
120
+   * This constructor allows the users to load the models from buffers instead of files.
121
+   *
122
+   * \paramin env Env to be used for the training session.
123
+   * \paramin session_options SessionOptions that the user can customize for this training session.
124
+   * \paramin checkpoint_state Training states that the training session uses as a starting point for training.
125
+   * \paramin train_model_data Buffer containing training model data.
126
+   * \paramin eval_model_data Buffer containing evaluation model data.
127
+   * \paramin optim_model_data Buffer containing optimizer model (used for performing weight/parameter update).
128
+   *
129
+   */
130
+  TrainingSession(const Env& env, const SessionOptions& session_options, CheckpointState& checkpoint_state,
131
+                  const std::vector<uint8_t>& train_model_data, const std::vector<uint8_t>& eval_model_data = {},
132
+                  const std::vector<uint8_t>& optim_model_data = {});
133
   /// @}
134
 
135
   /// \name Implementing The Training Loop
136
@@ -181,7 +234,6 @@
137
    * \paramin input_values The user inputs to the training model.
138
    * \return A std::vector of Ort::Value objects that represents the output of the forward pass of the training model.
139
    *
140
-   * \snippet{doc} snippets.dox OrtStatus Return Value
141
    *
142
    */
143
   std::vector<Value> TrainStep(const std::vector<Value>& input_values);
144
onnxruntime-linux-x64-gpu-1.15.1.tgz/include/onnxruntime_training_cxx_inline.h -> onnxruntime-linux-x64-gpu-1.17.1.tgz/include/onnxruntime_training_cxx_inline.h Changed
80
 
1
@@ -24,6 +24,23 @@
2
   ThrowOnError(GetTrainingApi().TrainingSessionGetEvalModelOutputCount(p_, &eval_model_output_count_));
3
 }
4
 
5
+inline TrainingSession::TrainingSession(const Env& env, const SessionOptions& session_options,
6
+                                        CheckpointState& checkpoint_state,
7
+                                        const std::vector<uint8_t>& train_model_data,
8
+                                        const std::vector<uint8_t>& eval_model_data,
9
+                                        const std::vector<uint8_t>& optim_model_data) {
10
+  ThrowOnError(GetTrainingApi().CreateTrainingSessionFromBuffer(
11
+      env, session_options, checkpoint_state,
12
+      train_model_data.data(), train_model_data.size(),
13
+      eval_model_data.data(), eval_model_data.size(),
14
+      optim_model_data.data(), optim_model_data.size(),
15
+      &p_));
16
+
17
+  ThrowOnError(GetTrainingApi().TrainingSessionGetTrainingModelOutputCount(p_, &training_model_output_count_));
18
+
19
+  ThrowOnError(GetTrainingApi().TrainingSessionGetEvalModelOutputCount(p_, &eval_model_output_count_));
20
+}
21
+
22
 inline std::vector<Value> TrainingSession::TrainStep(const std::vector<Value>& input_values) {
23
   std::vector<Value> output_values;
24
   output_values.reserve(training_model_output_count_);
25
@@ -51,7 +68,7 @@
26
   RunOptions run_options;
27
   ThrowOnError(GetTrainingApi().EvalStep(
28
       p_, run_options, input_values.size(), ort_input_values,
29
-      training_model_output_count_, ort_output_values));
30
+      eval_model_output_count_, ort_output_values));
31
 
32
   return output_values;
33
 }
34
@@ -175,6 +192,12 @@
35
   return CheckpointState(checkpoint_state);
36
 }
37
 
38
+inline CheckpointState CheckpointState::LoadCheckpointFromBuffer(const std::vector<uint8_t>& buffer) {
39
+  OrtCheckpointState* checkpoint_state;
40
+  ThrowOnError(GetTrainingApi().LoadCheckpointFromBuffer(buffer.data(), buffer.size(), &checkpoint_state));
41
+  return CheckpointState(checkpoint_state);
42
+}
43
+
44
 inline void CheckpointState::SaveCheckpoint(const CheckpointState& checkpoint_states,
45
                                             const std::basic_string<ORTCHAR_T>& path_to_checkpoint,
46
                                             const bool include_optimizer_state) {
47
@@ -208,9 +231,12 @@
48
     ThrowOnError(GetTrainingApi().AddProperty(p_, property_name.c_str(), OrtPropertyType::OrtFloatProperty, value_p));
49
   } else if (std::holds_alternative<std::string>(property_value)) {
50
     std::string value = std::get<std::string>(property_value);
51
-    auto buffer = std::make_unique<char>(value.length() + 1).release();
52
-    memcpy(buffer, value.c_str(), value.length());
53
-    ThrowOnError(GetTrainingApi().AddProperty(p_, property_name.c_str(), OrtPropertyType::OrtStringProperty, buffer));
54
+    auto buffer = std::make_unique<char>(value.length() + 1);
55
+    memcpy(buffer.get(), value.c_str(), value.length());
56
+    // AddProperty takes a char* and calls PropertyBag::AddProperty which takes a std::string. The data will be
57
+    // copied at that point so buffer can free the local allocation once the call is made.
58
+    ThrowOnError(GetTrainingApi().AddProperty(p_, property_name.c_str(), OrtPropertyType::OrtStringProperty,
59
+                                              buffer.get()));
60
   } else {
61
     ThrowStatus(Status("Unknown property type received.", OrtErrorCode::ORT_INVALID_ARGUMENT));
62
   }
63
@@ -253,4 +279,16 @@
64
   return property;
65
 }
66
 
67
+inline void CheckpointState::UpdateParameter(const std::string& parameter_name, const Value& parameter) {
68
+  ThrowOnError(GetTrainingApi().UpdateParameter(p_, parameter_name.c_str(), parameter));
69
+}
70
+
71
+inline Value CheckpointState::GetParameter(const std::string& parameter_name) {
72
+  AllocatorWithDefaultOptions allocator;
73
+  OrtValue* parameter;
74
+  ThrowOnError(GetTrainingApi().GetParameter(p_, parameter_name.c_str(), allocator, &parameter));
75
+
76
+  return Value{parameter};
77
+}
78
+
79
 }  // namespace Ort
80
onnxruntime-linux-x64-gpu-1.15.1.tgz/lib/libonnxruntime.so -> onnxruntime-linux-x64-gpu-1.17.1.tgz/lib/libonnxruntime.so Changed
3
 
1
-(symlink to libonnxruntime.so.1.15.1)
2
+(symlink to libonnxruntime.so.1.17.1)
3
onnxruntime-linux-x64-gpu-1.17.1.tgz/lib/libonnxruntime.so.1.17.1 Added
onnxruntime-linux-x64-gpu-1.15.1.tgz/lib/libonnxruntime_providers_cuda.so -> onnxruntime-linux-x64-gpu-1.17.1.tgz/lib/libonnxruntime_providers_cuda.so Changed
onnxruntime-linux-x64-gpu-1.15.1.tgz/lib/libonnxruntime_providers_shared.so -> onnxruntime-linux-x64-gpu-1.17.1.tgz/lib/libonnxruntime_providers_shared.so Changed
onnxruntime-linux-x64-gpu-1.15.1.tgz/lib/libonnxruntime_providers_tensorrt.so -> onnxruntime-linux-x64-gpu-1.17.1.tgz/lib/libonnxruntime_providers_tensorrt.so Changed