A C++ SDK for 3D computer vision, paired with Cocoa frameworks for TrueDepth-based 3D scanning, meshing, and ML landmarking models + analysis for face, foot, and ear
A native (iOS/macOS) C++ library containing data structures, I/O, and algorithms, as well as a Cocoa framework for iOS and Mac clients to use publicly.
This project generates StandardCyborgFusion.framework
This code was developed by the Standard Cyborg team, primarily in 2018 and the middle of 2019. Standard Cyborg powered applications for custom 3d smart glasses, football helmet fitting, custom medical glasses, shoe sizing, and more. Development was paused on this code when Standard Cyborg began working on horizontal tooling, versus developing specific applications.
This codebase is released under the MIT license, with the exception that commercial applications in the field of prosthetics are prohibited until Jan 1, 2023.
See LICENSE file
- Make sure you have installed git lfs before cloning this repo
- Run this shell command
$ ./install-dependencies.sh
- Open
StandardCyborgSDK.xcworkspace
in Xcode
- StandardCyborgFusion: iOS + macOS framework for 3D scanning and meshing using TrueDepth
- StandardCyborgFusionTests: unit tests for the above
- VisualTesterMac: a macOS app for helping develop and test StandardCyborgFusion
- VisualTesterMac: ditto, but for iOS; also useful for on-device benchmarking
- TrueDepthFusion: an iOS app for exercising the StandardCyborgFusion framework
- StandardCyborgAlgorithmsTestbed: an iOS app for testing the SC C++ algorithms and data structures
For debugging via lldb in Xcode, it is recommended to install the LLDB Eigen Data Formatter.
Note on building with bitcode support: https://medium.com/@heitorburger/static-libraries-frameworks-and-bitcode-6d8f784478a9
To build StandardCyborgFusion.framework for public release:
- Run
archive-build-standardcyborgfusion.sh
, which will both update the compiled copy in../StandardCyborgCocoa/StandardCyborgFusion
and generate a .zip file for you to upload to the StandardCyborgFusion release in GitHub - Commit the updated StandardCyborgFusion/Info.plist (which now has a new version number)
- Merge updated Info.plist commit into
main
- Tag this commit in the format
git tag v1.2.3-StandardCyborgFusion
- Commit the changes with a nice public-facing message and a prefix of
StandardCyborgFusion:
, e.g.StandardCyborgFusion: Adds SCMesh class
- Create a git tag for this commit in the format
v1.2.3-StandardCyborgFusion
- Push the commit and the tag
git push origin main
,git push origin v1.2.3-StandardCyborgFusion
- Open this repo's releases on GitHub and draft a new release: https://github.com/StandardCyborg/StandardCyborgCocoa/releases/new
a) For Tag version, specify the git tag you just created in step 2
a) For Release title, use the commit message from step 1
a) In "Attach binaries by dropping them here or selecting them", drag in the StandardCyborgFusion.framework.zip file that was generated inside
StandardCyborgSDK/build
. a) Publish release - Push to CocoaPods:
pod trunk push StandardCyborgFusion
- Register: pod trunk register someone@standardcyborg.com 'Your Name' --description='MacBook Pro 13 2019'
- Click the link in your email
- Get someone who has access to add you.
pod trunk add-owner StandardCyborgFusion jeff@standardcyborg.com
Our SCCocoaPods private registry (which is just a github repo) provides the most scalable way for deploying common dependencies.
Sometimes you only want to use a dependency for a single project. In this scenario, CocoaPods supports local podspecs— the podspec file is a file locally on disk rather than in a CocoaPods registry (as discussed above). See for example StandardCyborgFusion/PoissonRecon.podspec, which is a local dependency for the StandardCyborgFusionOSX target of the SDK.
We use a mix of local Podspecs and registry-served Podspecs. Local podspecs are best for internal-only usage.
You may develop locally against the SDK as CocoaPod. For example, to develop a command line app which uses the SDK via local CocoaPods:
- Clone StandardCyborgCocoa as a sibling directory to this repo
cd StandardCyborgSDK
- Build the CocoaPod into
StandardCyborgCocoa/StandardCyborgFusion
by running./archive-build-standardcyborgfusion.sh
- Create a new command line project in Xcode, for example,
FusionTest
cd /path/to/FusionTest
pod init
- Add to your podfile something like:
target 'FusionTest' do platform :osx, '11.0' use_frameworks! pod 'StandardCyborgFusion', path: '/path/to/your/StandardCyborgCocoa/StandardCyborgFusion' end
pod install
- We need to be able to locate the headers, but local CocoaPods don't actually get copied into the
Pods
directory. You'll need to symlink the local CocoaPod directory intoPods/
. For example from your project root,ln -s /path/to/StandardCyborgCocoa/StandardCyborgFusion Pods/StandardCyborgFusion
open FusionTest.xcworkspace
- For some unknown reason,
Hardened Runtime
conflicts with the loading of our dynamic library. Open theFusionTest
command line target settings and go to theSigning & Capabilities
tab. Click the × next toHardened Runtime
to disable it. - Change the
main.m
extension tomain.mm
and add some code like the following:#import <iostream> #import <StandardCyborgData/StandardCyborgData.hpp> int main(int argc, const char * argv[]) { StandardCyborg::Vec3 v {1, 2, 3}; std::cout << "v = " << v << std::endl; return 0; }
- Build and run!