Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring models with Fritz #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
67 changes: 67 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Xcode
# From https://www.stuartbreckenridge.com/default-gitignore/
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata

## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint

## Obj-C/Swift specific
*.hmap
*.ipa

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#

# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md

fastlane/report.xml
fastlane/screenshots

.DS_Store
6 changes: 6 additions & 0 deletions CoreML in ARKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
5D90B2521F9C237400EA0942 /* BuildFile in Sources */ = {isa = PBXBuildFile; };
5D90B2541F9C238A00EA0942 /* BuildFile in Sources */ = {isa = PBXBuildFile; };
5D90B2561F9C239B00EA0942 /* BuildFile in Sources */ = {isa = PBXBuildFile; };
5F3831C82028FBD700C9C82A /* signLettersV3+Fritz.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3831C72028FBD700C9C82A /* signLettersV3+Fritz.swift */; };
AEEC85651F18B8C600D43B9B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEC85641F18B8C600D43B9B /* AppDelegate.swift */; };
AEEC85691F18B8C600D43B9B /* ARViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEEC85681F18B8C600D43B9B /* ARViewController.swift */; };
AEEC856C1F18B8C600D43B9B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AEEC856A1F18B8C600D43B9B /* Main.storyboard */; };
Expand All @@ -31,6 +32,7 @@
199C36BF6127B4ABABA0E3CB /* Pods-CoreML in ARKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreML in ARKit.release.xcconfig"; path = "Pods/Target Support Files/Pods-CoreML in ARKit/Pods-CoreML in ARKit.release.xcconfig"; sourceTree = "<group>"; };
1F88DE1D2014525900CE5000 /* LetterCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LetterCell.swift; sourceTree = "<group>"; };
2FFD1305D2C9FD736CE1949C /* Pods-CoreML in ARKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-CoreML in ARKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-CoreML in ARKit/Pods-CoreML in ARKit.debug.xcconfig"; sourceTree = "<group>"; };
5F3831C72028FBD700C9C82A /* signLettersV3+Fritz.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "signLettersV3+Fritz.swift"; sourceTree = "<group>"; };
636D2BEBF54C95E83D358E19 /* Pods_CoreML_in_ARKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CoreML_in_ARKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AEEC85611F18B8C600D43B9B /* CoreML in ARKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CoreML in ARKit.app"; sourceTree = BUILT_PRODUCTS_DIR; };
AEEC85641F18B8C600D43B9B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -93,6 +95,7 @@
AEEC85721F18B8C600D43B9B /* Info.plist */,
DA905B6F2014517F00ED15B3 /* Cocogoose.otf */,
DA905B6D2014470B00ED15B3 /* signLettersV3.mlmodel */,
5F3831C72028FBD700C9C82A /* signLettersV3+Fritz.swift */,
);
path = "CoreML in ARKit";
sourceTree = "<group>";
Expand Down Expand Up @@ -192,11 +195,13 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-CoreML in ARKit/Pods-CoreML in ARKit-frameworks.sh",
"${PODS_ROOT}/Fritz/Framework/Fritz.framework",
"${BUILT_PRODUCTS_DIR}/ScalingCarousel/ScalingCarousel.framework",
"${BUILT_PRODUCTS_DIR}/TOMSMorphingLabel/TOMSMorphingLabel.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Fritz.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ScalingCarousel.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TOMSMorphingLabel.framework",
);
Expand Down Expand Up @@ -256,6 +261,7 @@
DA73C81D1F9BECD100622166 /* DictionaryViewController.swift in Sources */,
DA0494C32014861B00C598E7 /* PhraseCell.swift in Sources */,
AEEC85651F18B8C600D43B9B /* AppDelegate.swift in Sources */,
5F3831C82028FBD700C9C82A /* signLettersV3+Fritz.swift in Sources */,
5D90B2561F9C239B00EA0942 /* BuildFile in Sources */,
DA905B6E2014470B00ED15B3 /* signLettersV3.mlmodel in Sources */,
);
Expand Down
2 changes: 1 addition & 1 deletion CoreML in ARKit/ARViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ARViewController: UIViewController, ARSCNViewDelegate, UIGestureRecognizer
//////////////////////////////////////////////////

// Set up Vision Model
guard let selectedModel = try? VNCoreMLModel(for: signLettersV3().model) else { // (Optional) This can be replaced with other models on https://developer.apple.com/machine-learning/
guard let selectedModel = try? VNCoreMLModel(for: signLettersV3().fritz().model) else { // (Optional) This can be replaced with other models on https://developer.apple.com/machine-learning/
fatalError("Could not load model. Ensure model has been drag and dropped (copied) to XCode Project from https://developer.apple.com/machine-learning/ . Also ensure the model is part of a target (see: https://stackoverflow.com/questions/45884085/model-is-not-part-of-any-target-add-the-model-to-a-target-to-enable-generation ")
}

Expand Down
8 changes: 4 additions & 4 deletions CoreML in ARKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
</dict>
<key>NSCameraUsageDescription</key>
<string>This application will use the camera for Augmented Reality.</string>
<key>UIAppFonts</key>
<array>
<string>Cocogoose.otf</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -50,9 +54,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIAppFonts</key>
<array>
<string>Cocogoose.otf</string>
</array>
</dict>
</plist>
15 changes: 15 additions & 0 deletions CoreML in ARKit/signLettersV3+Fritz.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// signLettersV3+Fritz.swift
// CoreML in ARKit
//

import Fritz

extension signLettersV3: SwiftIdentifiedModel {

static let modelIdentifier = "<insert model id>"

static let packagedModelVersion = 1

static let session = Session(appToken: "<insert app token>")
}
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ target 'CoreML in ARKit' do
# Pods for CoreML in ARKit
pod ‘ScalingCarousel’
pod "TOMSMorphingLabel", "~> 0.5"

pod 'Fritz', '~> 1.0.0-beta'
end
5 changes: 4 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
PODS:
- Fritz (1.0.0-beta5)
- ScalingCarousel (2.0.3)
- TOMSMorphingLabel (0.5.1)

DEPENDENCIES:
- Fritz (~> 1.0.0-beta)
- ScalingCarousel
- TOMSMorphingLabel (~> 0.5)

SPEC CHECKSUMS:
Fritz: a3bf484ce949e36748f1b365049be9e5b21a91c9
ScalingCarousel: 023450cd1a8f1bd7d13a8edbddc956ded8ed1891
TOMSMorphingLabel: 3e88a2bf5257f8993ebc51fb3109187a0bfb2c4d

PODFILE CHECKSUM: 853d417a547d86f871d3b92467f34d5464fdffbd
PODFILE CHECKSUM: 84c9e921bc9e0998fac22d2a02da457b16b768d0

COCOAPODS: 1.4.0
Binary file added Pods/Fritz/Framework/Fritz.framework/Fritz
Binary file not shown.
Loading