LingDong- / VisionOSC

PoseOSC + FaceOSC + HandOSC + OcrOSC + CatOSC + DogOSC
97 stars 8 forks source link
computer-vision facial-landmarks-detection hand-tracking ocr osc pose-estimation vision-framework

Vision OSC

= PoseOSC + FaceOSC + HandOSC + OcrOSC + CatOSC + DogOSC

Download | Example

Send (almost) all Apple Vision Framework's detection results via OSC. (You can pick which one(s) to detect & send). Written in openFrameworks using Objective-C++. macOS 11+ only.

Inspired by PoseOSC, but faster, no more electron-bloat or horse neighing hacks. Compatible with the ARR format of PoseOSC.

How to re-build in Xcode

Do not attempt to re-build (with projectGenerator) unless absolutely necessary, in which case follow the following steps:

If you encounter Undefined symbol: __objc_msgSend$identifier, you might need to set Excluded Architectures arm64. See this issue for details.

If there're some complaints about ARC, you might need to remove all mentions of autorelease in src folder.

How to Use

Settings in settings.xml will be loaded upon start.

In the packaged app, the settings.xml can be found in Contents/Resources.

See demos/VisionOSCProcessingReceiver for a Processing demo receiving all the detection types.

Receiving Poses from OSC

This is the same as ARR format of PoseOSC, copied below:

ARR will be sent to poses/arr OSC Address as an array of values (OSC spec allows multiple values of different types for each address).

Receiving Faces from OSC

Similar to pose format (see above); sent to faces/arr OSC Address:

Receiving Hands from OSC

Similar to pose format (see above); sent to hands/arr OSC Address:

Receiving Texts (OCR) from OSC

Sent to texts/arr OSC Address:

Receiving Animal detections from OSC

Currently only cats and dogs are supported, per Apple's documentation.

Similar to texts format (see above); sent to animals/arr OSC Address:

The JSON and XML formats supported by PoseOSC are now excluded because I've since realized it's a silly idea to add this sort of parsing overhead. Let me know if you have a case against this decision.

I recommand Protokol for testing/inspecting OSC.

Framerates

Tested on MacBook Pro (13-inch, M1, 2020) Memory 16 GB.