Open stephanschulz opened 5 months ago
Which macos version are you using? That function is only for macos13 or newer. There is another version for older macos. I will add it with a #ifdef
ah. I am on 12.6.8 thank you for adding the #ifdef
@stephanschulz I just updated a fix for this. Please try it and let me know
2024-04-10 19:35:58.699570-0400 example-ObjectDetection[36228:4483459] Metal API Validation Enabled
2024-04-10 19:36:00.810530-0400 example-ObjectDetection[36228:4483459] fileURLWithPath: /Applications/of_v0.12.0_osx_release/addons/ofxVision/example-ObjectDetection/bin/data/YOLOv3.mlmodel
2024-04-10 19:36:00.810598-0400 example-ObjectDetection[36228:4483459] +[MLModel compileModelAtURL:completionHandler:]: unrecognized selector sent to class 0x1eddadd68
2024-04-10 19:36:00.810922-0400 example-ObjectDetection[36228:4483459] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[MLModel compileModelAtURL:completionHandler:]: unrecognized selector sent to class 0x1eddadd68'
*** First throw call stack:
(
0 CoreFoundation 0x0000000195489138 __exceptionPreprocess + 240
1 libobjc.A.dylib 0x00000001951d3e04 objc_exception_throw + 60
2 CoreFoundation 0x000000019551ce18 __CFExceptionProem + 0
3 CoreFoundation 0x00000001953e8464 ___forwarding___ + 1764
4 CoreFoundation 0x00000001953e7cc0 _CF_forwarding_prep_0 + 96
5 example-ObjectDetection 0x000000010003bbd0 -[ObjectRecognition initWithModelPath:] + 252
6 example-ObjectDetection 0x000000010003c794 _ZN18ofxVisionDetection9loadModelERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 76
7 example-ObjectDetection 0x0000000100034018 _ZN5ofApp5setupEv + 184
8 example-ObjectDetection 0x0000000100256238 _ZNSt3__110__function6__funcIZN7ofEventI11ofEventArgsNS_15recursive_mutexEE13make_functionI9ofBaseAppEENS_10shared_ptrIN2of4priv8FunctionIS3_S4_EEEEPT_MSE_FvRS3_EiEUlPKvSG_E_NS_9allocatorISL_EEFbSK_SG_EEclEOSK_SG_ + 40
9 example-ObjectDetection 0x000000010025ab8c _ZN7ofEventI11ofEventArgsNSt3__115recursive_mutexEE6notifyERS0_ + 148
10 example-ObjectDetection 0x0000000100033bf4 main + 260
11 dyld 0x000000010086108c start + 520
)
2024-04-10 19:36:00.818922-0400 example-ObjectDetection[36228:4483459] [General] An uncaught exception was raised
2024-04-10 19:36:00.818951-0400 example-ObjectDetection[36228:4483459] [General] +[MLModel compileModelAtURL:completionHandler:]: unrecognized selector sent to class 0x1eddadd68
2024-04-10 19:36:00.818988-0400 example-ObjectDetection[36228:4483459] [General] (
0 CoreFoundation 0x0000000195489138 __exceptionPreprocess + 240
1 libobjc.A.dylib 0x00000001951d3e04 objc_exception_throw + 60
2 CoreFoundation 0x000000019551ce18 __CFExceptionProem + 0
3 CoreFoundation 0x00000001953e8464 ___forwarding___ + 1764
4 CoreFoundation 0x00000001953e7cc0 _CF_forwarding_prep_0 + 96
5 example-ObjectDetection 0x000000010003bbd0 -[ObjectRecognition initWithModelPath:] + 252
6 example-ObjectDetection 0x000000010003c794 _ZN18ofxVisionDetection9loadModelERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE + 76
7 example-ObjectDetection 0x0000000100034018 _ZN5ofApp5setupEv + 184
8 example-ObjectDetection 0x0000000100256238 _ZNSt3__110__function6__funcIZN7ofEventI11ofEventArgsNS_15recursive_mutexEE13make_functionI9ofBaseAppEENS_10shared_ptrIN2of4priv8FunctionIS3_S4_EEEEPT_MSE_FvRS3_EiEUlPKvSG_E_NS_9allocatorISL_EEFbSK_SG_EEclEOSK_SG_ + 40
9 example-ObjectDetection 0x000000010025ab8c _ZN7ofEventI11ofEventArgsNSt3__115recursive_mutexEE6notifyERS0_ + 148
10 example-ObjectDetection 0x0000000100033bf4 main + 260
11 dyld 0x000000010086108c start + 520
)
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[MLModel compileModelAtURL:completionHandler:]: unrecognized selector sent to class 0x1eddadd68'
terminating with uncaught exception of type NSException
(lldb)
the frameworks seem to be linked correctly. the minimum dev is macOS 12
maybe it is not possible to run the object detector in macOS 12?
'compileModelAtURL:completionHandler:' is only available on macOS 13.0 or newer
I can confirm that on a Mac mini with macOS 13.4 the app compiles and runs. right now I am not able to really test if it successfully detects anything because my remote machine is in a dark room :(
ok. I just removed the #ifdef so now using the deprecated function instead which should work with macos12
success. I can confirm it works on macOS 12
love it. thanks roy!