Coder Social home page Coder Social logo

Comments (10)

mctrafik avatar mctrafik commented on July 2, 2024 1

Woo! Got it to work.

I use GHE, so had to run git clone --single-branch -b 26.1.2 https://github.com/obsproject/obs-studio.git. Thanks for the tip.

Specifying DobsLibPath and DobsIncludePath still didn't work for me. 🤷🏻 Had to point directly to the framework lib:

cmake .. \
    -DQTDIR=/usr/local/opt/qt \
    -DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" \
    -DLIBOBS_LIB="/Applications/OBS.app/Contents/Frameworks/libobs.0.dylib"

Then it started!

My only issue now is that doesn't recognize my face:

Screen Shot 2021-04-30 at 5 26 04 PM
It doesn't think my hair and forehead are part of my face. --.--

from obs-backgroundremoval.

mctrafik avatar mctrafik commented on July 2, 2024 1

Of course. Thank you for your help!

from obs-backgroundremoval.

royshil avatar royshil commented on July 2, 2024

first i suggest not to supply LIBOBS_LIB and LIBOBS_INCLUDE_DIR directly, rather to stick to obsPath, obsLibPath and obsIncludePath
and let CMake find the file it needs.
if that doesn't work, check your paths again.

but it seems you got CMake happy at some point which is good.

for the crash, it might be that it can't find the model file or the onnxruntime dependency.

can you run OBS from the command line to capture the runtime logs?

from obs-backgroundremoval.

royshil avatar royshil commented on July 2, 2024

I've added scripts to build opencv and onnxruntime as static libraries.
this removes the dependency on the homebrew dynamic libraries and encapsulate everything in the plugin .so file.
it should be more robust.
please give it a try

from obs-backgroundremoval.

mctrafik avatar mctrafik commented on July 2, 2024

Hey Roy.

Thanks for the super quick turnaround. I tried the new instructions. I think I'm having issues building.

I had to do brew install wget (minor thing to add to instructions probably).

When installing opencv, the only thing that popped at me was:

-- Performing Test HAVE_LINK_AS_NEEDED
-- Performing Test HAVE_LINK_AS_NEEDED - Failed

THere were many more failures when compiling onnx:

-- Performing Test HAS_UNUSED_BUT_SET_VARIABLE
-- Performing Test HAS_UNUSED_BUT_SET_VARIABLE - Failed
-- Performing Test HAS_UNUSED_PARAMETER
-- Performing Test HAS_UNUSED_PARAMETER - Success
-- Performing Test HAS_UNUSED_VARIABLE
-- Performing Test HAS_UNUSED_VARIABLE - Success
-- Performing Test HAS_CAST_FUNCTION_TYPE
-- Performing Test HAS_CAST_FUNCTION_TYPE - Failed
-- Performing Test HAS_PARENTHESES
-- Performing Test HAS_PARENTHESES - Success
-- Performing Test HAS_USELESS_CAST
-- Performing Test HAS_USELESS_CAST - Failed
-- Performing Test HAS_NONNULL_COMPARE
-- Performing Test HAS_NONNULL_COMPARE - Failed
-- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE
-- Performing Test HAS_TAUTOLOGICAL_POINTER_COMPARE - Success
-- Performing Test HAS_CATCH_VALUE
-- Performing Test HAS_CATCH_VALUE - Failed
-- Performing Test HAS_MISSING_BRACES
-- Performing Test HAS_MISSING_BRACES - Success
-- Performing Test HAS_IGNORED_ATTRIBUTES
-- Performing Test HAS_IGNORED_ATTRIBUTES - Success
-- Performing Test HAS_DEPRECATED_COPY
-- Performing Test HAS_DEPRECATED_COPY - Failed
-- Performing Test HAS_DEPRECATED_DECLARATIONS
-- Performing Test HAS_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAS_CLASS_MEMACCESS
-- Performing Test HAS_CLASS_MEMACCESS - Failed
-- Performing Test HAS_MAYBE_UNINITIALIZED
-- Performing Test HAS_MAYBE_UNINITIALIZED - Failed

I have no clue if these are warning or failures.

Either way, when I try to build now, I get this error:

% cmake .. \
-DobsLibPath=/Applications/OBS.app/Contents/Frameworks \
-DobsIncludePath="../../obs-studio/libobs" \
-DLIBOBS_INCLUDE_DIR="../../obs-studio/libobs" \
-DLIBOBS_LIB="../../obs-studio/build/libobs/libobs.dylib"
-- Onnxruntime_INCLUDE_DIRS /path/obs-backgroundremoval/build/onnxruntime//include;/path/obs-backgroundremoval/build/onnxruntime//include/onnxruntime/core/session
CMake Error at build/opencv/lib/cmake/opencv4/OpenCVModules.cmake:111 (message):
  The imported target "ade" references the file

     "/path/obs-backgroundremoval/build/opencv/lib/opencv4/3rdparty/libade.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/path/obs-backgroundremoval/build/opencv/lib/cmake/opencv4/OpenCVModules.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  build/opencv/lib/cmake/opencv4/OpenCVConfig.cmake:133 (include)
  CMakeLists.txt:97 (find_package)


-- Configuring incomplete, errors occurred!

I'm not sure what that's all about.

from obs-backgroundremoval.

royshil avatar royshil commented on July 2, 2024

i added a flag to make opencv not use libade
please try building opencv again

those errors you see in cmake are fine.

from obs-backgroundremoval.

mctrafik avatar mctrafik commented on July 2, 2024

Cool!

I can run cmake .. now. The thing that I thought looked concerning was when running cmake --build I saw this:

ld: warning: direct access in function 'onnx::AttributeProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'onnx::NodeProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'onnx::NodeProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'onnx::TensorProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'google::protobuf::internal::InternalMetadataWithArenaBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::internal::InternalMetadataWithArenaLite>::mutable_unknown_fields_slow()' from file 'onnxruntime//lib/libonnx_proto.a(onnx-ml.pb.cc.o)' to global weak symbol 'typeinfo for google::protobuf::internal::InternalMetadataWithArenaBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::internal::InternalMetadataWithArenaLite>::Container' from file 'onnxruntime//lib/libprotobuf-lite.a(parse_context.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'google::protobuf::internal::InternalMetadataWithArenaBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::internal::InternalMetadataWithArenaLite>::mutable_unknown_fields_slow()' from file 'onnxruntime//lib/libonnx_proto.a(onnx-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<google::protobuf::internal::InternalMetadataWithArenaBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::internal::InternalMetadataWithArenaLite>::Container>(void*)' from file 'onnxruntime//lib/libprotobuf-lite.a(parse_context.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'void google::protobuf::internal::RepeatedPtrFieldBase::MergeFrom<google::protobuf::RepeatedPtrField<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::TypeHandler>(google::protobuf::internal::RepeatedPtrFieldBase const&)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'onnx::FunctionProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-operators-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'onnx::FunctionProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-operators-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'onnx::FunctionProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-operators-ml.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'onnx::MapProto::_InternalParse(char const*, google::protobuf::internal::ParseContext*)' from file 'onnxruntime//lib/libonnx_proto.a(onnx-data.pb.cc.o)' to global weak symbol 'void google::protobuf::internal::arena_destruct_object<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(void*)' from file 'onnxruntime//lib/libonnxruntime_graph.a(graph.cc.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
[100%] Built target obs-backgroundremoval

But otherwise I think it succeeded to build (it did spit out the *.so) file.

However when running OBS it just exits saying there was an illegal instruction. Last time it popped up a window w/ debug info. It doesn't do that anymore.

I don't think this is useful for debugging, bug included here for completeness:

% /Applications/OBS.app/Contents/MacOS/obs
info: CPU Name: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
info: CPU Speed: 2400MHz
info: Physical Cores: 8, Logical Cores: 16
info: Physical Memory: 65536MB Total
info: OS Name: Mac OS X (NSMACHOperatingSystem)
info: OS Version: Version 10.15.7 (Build 19H1030)
info: Kernel Version: 19.6.0
error: hotkeys-cocoa: Getting keyboard keys failed
error: hotkeys-cocoa: Getting keyboard keys failed
error: hotkeys-cocoa: Getting keyboard keys failed
error: hotkeys-cocoa: Getting keyboard keys failed
error: hotkeys-cocoa: Getting keyboard keys failed
info: hotkeys-cocoa: Using layout 'com.apple.keylayout.Colemak'
info: Current Date/Time: 2021-04-29, 21:00:45
info: Browser Hardware Acceleration: true
info: Portable mode: false
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
QMetaObject::connectSlotsByName: No matching signal for on_transitionRemove_clicked()
info: OBS 26.1.2 (mac)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
	samples per sec: 48000
	speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter ATI Technologies Inc. AMD Radeon Pro 5500M OpenGL Engine
info: OpenGL loaded successfully, version 4.1 ATI-3.10.19, shading language 4.10
info: ---------------------------------
info: video settings reset:
	base resolution:   1280x720
	output resolution: 1280x720
	downscale filter:  Bicubic
	fps:               30/1
	format:            NV12
	YUV mode:          709/Partial
info: NV12 texture support not available
info: Audio monitoring device:
	name: Default
	id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-captions.so'
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
2021-04-29 21:00:46.154 obs[7659:1144045] mac-virtualcam(DAL): PlugInMain version=1.3.0
2021-04-29 21:00:46.154 obs[7659:1144045] mac-virtualcam(DAL): HardwarePlugIn_QueryInterface 
2021-04-29 21:00:46.154 obs[7659:1144045] mac-virtualcam(DAL): HardwarePlugIn_Release sRefCount now = 0
2021-04-29 21:00:46.155 obs[7659:1144045] mac-virtualcam(DAL): HardwarePlugIn_InitializeWithObjectID self=0x20f08478
2021-04-29 21:00:46.155 obs[7659:1144045] mac-virtualcam(DAL): HardwarePlugIn_ObjectSetPropertyData OBSDALDevice(36) kCMIOObjectPropertyListenerAdded self=0x20f08478 data(int)=1684629094
2021-04-29 21:00:46.155 obs[7659:1144045] mac-virtualcam(DAL): HardwarePlugIn_ObjectSetPropertyData OBSDALDevice(36) kCMIOObjectPropertyListenerAdded self=0x20f08478 data(int)=1869180523
2021-04-29 21:00:46.155 obs[7659:1144045] mac-virtualcam(DAL): HardwarePlugIn_ObjectSetPropertyData OBSDALDevice(36) kCMIOObjectPropertyListenerAdded self=0x20f08478 data(int)=1885762592
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
info: [mac-virtualcam] version=1.3.0
info: [VideoToolbox encoder]: Adding VideoToolbox H264 encoders
warning: Failed to load 'en-US' text for module: 'obs-backgroundremoval.so'
zsh: illegal hardware instruction  /Applications/OBS.app/Contents/MacOS/obs

from obs-backgroundremoval.

mctrafik avatar mctrafik commented on July 2, 2024

Can you static link to the libs and upload another version of the *.so file?

from obs-backgroundremoval.

royshil avatar royshil commented on July 2, 2024

@mctrafik can you make sure your OBS repo checkout (for libobs includes) is at the 26.1.2 branch? (before you rebuild the plugin)

this was the solution here #4

I can add the static .so - but you're almost there yourself!

from obs-backgroundremoval.

royshil avatar royshil commented on July 2, 2024

@mctrafik can we close the issue?

from obs-backgroundremoval.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.