lol

obs-backgroundremoval: init at 0.4.0

authored by

Brian McKenna and committed by
Franz Pletz
11d8a148 7b06baf3

+82
+1
pkgs/applications/video/obs-studio/plugins/default.nix
··· 11 11 obs-nvfbc = callPackage ./obs-nvfbc.nix {}; 12 12 obs-pipewire-audio-capture = callPackage ./obs-pipewire-audio-capture.nix {}; 13 13 obs-vkcapture = callPackage ./obs-vkcapture.nix {}; 14 + obs-backgroundremoval = callPackage ./obs-backgroundremoval.nix {}; 14 15 }
+36
pkgs/applications/video/obs-studio/plugins/obs-backgroundremoval-includes.patch
··· 1 + diff --git a/src/Model.h b/src/Model.h 2 + index 5c21eae..74b8078 100644 3 + --- a/src/Model.h 4 + +++ b/src/Model.h 5 + @@ -1,13 +1,8 @@ 6 + #ifndef MODEL_H 7 + #define MODEL_H 8 + 9 + -#if defined(__APPLE__) 10 + #include <onnxruntime/core/session/onnxruntime_cxx_api.h> 11 + #include <onnxruntime/core/providers/cpu/cpu_provider_factory.h> 12 + -#else 13 + -#include <onnxruntime_cxx_api.h> 14 + -#include <cpu_provider_factory.h> 15 + -#endif 16 + #ifdef _WIN32 17 + #ifdef WITH_CUDA 18 + #include <cuda_provider_factory.h> 19 + diff --git a/src/background-filter.cpp b/src/background-filter.cpp 20 + index 9fa5794..5d66aee 100644 21 + --- a/src/background-filter.cpp 22 + +++ b/src/background-filter.cpp 23 + @@ -1,13 +1,8 @@ 24 + #include <obs-module.h> 25 + #include <media-io/video-scaler.h> 26 + 27 + -#if defined(__APPLE__) 28 + #include <onnxruntime/core/session/onnxruntime_cxx_api.h> 29 + #include <onnxruntime/core/providers/cpu/cpu_provider_factory.h> 30 + -#else 31 + -#include <onnxruntime_cxx_api.h> 32 + -#include <cpu_provider_factory.h> 33 + -#endif 34 + #ifdef _WIN32 35 + #ifdef WITH_CUDA 36 + #include <cuda_provider_factory.h>
+45
pkgs/applications/video/obs-studio/plugins/obs-backgroundremoval.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , fetchpatch 5 + , cmake 6 + , obs-studio 7 + , onnxruntime 8 + , opencv 9 + }: 10 + 11 + stdenv.mkDerivation rec { 12 + pname = "obs-backgroundremoval"; 13 + version = "0.4.0"; 14 + 15 + src = fetchFromGitHub { 16 + owner = "royshil"; 17 + repo = "obs-backgroundremoval"; 18 + rev = "v${version}"; 19 + sha256 = "sha256-TI1FlhE0+JL50gAZCSsI+g8savX8GRQkH3jYli/66hQ="; 20 + }; 21 + 22 + nativeBuildInputs = [ cmake ]; 23 + buildInputs = [ obs-studio onnxruntime opencv ]; 24 + 25 + dontWrapQtApps = true; 26 + 27 + cmakeFlags = [ 28 + "-DLIBOBS_INCLUDE_DIR=${obs-studio.src}/libobs" 29 + "-DOnnxruntime_INCLUDE_DIRS=${onnxruntime.dev}/include/onnxruntime/core/session" 30 + ]; 31 + 32 + patches = [ ./obs-backgroundremoval-includes.patch ]; 33 + 34 + prePatch = '' 35 + sed -i 's/version_from_git()/set(VERSION "${version}")/' CMakeLists.txt 36 + ''; 37 + 38 + meta = with lib; { 39 + description = "OBS plugin to replace the background in portrait images and video"; 40 + homepage = "https://github.com/royshil/obs-backgroundremoval"; 41 + maintainers = with maintainers; [ puffnfresh ]; 42 + license = licenses.mit; 43 + platforms = [ "x86_64-linux" "i686-linux" ]; 44 + }; 45 + }