-
Notifications
You must be signed in to change notification settings - Fork 220
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
Code Updated #15
base: master
Are you sure you want to change the base?
Code Updated #15
Changes from all commits
c1e4e35
b825eda
b8a3d6c
7498dd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,7 @@ class ViewController: UIViewController, ARSCNViewDelegate { | |
// Set the view's delegate | ||
sceneView.delegate = self | ||
|
||
// Show statistics such as fps and timing information | ||
sceneView.showsStatistics = true | ||
|
||
|
||
// Create a new scene | ||
let scene = SCNScene() | ||
|
@@ -50,7 +49,7 @@ class ViewController: UIViewController, ARSCNViewDelegate { | |
////////////////////////////////////////////////// | ||
|
||
// Set up Vision Model | ||
guard let selectedModel = try? VNCoreMLModel(for: Inceptionv3().model) else { // (Optional) This can be replaced with other models on https://developer.apple.com/machine-learning/ | ||
guard let selectedModel = try? VNCoreMLModel(for: MobileNet().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 ") | ||
} | ||
|
||
|
@@ -82,10 +81,7 @@ class ViewController: UIViewController, ARSCNViewDelegate { | |
sceneView.session.pause() | ||
} | ||
|
||
override func didReceiveMemoryWarning() { | ||
super.didReceiveMemoryWarning() | ||
// Release any cached data, images, etc that aren't in use. | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleared as most of those problems were back in the iPhone 3GS days when memory was more limited. |
||
|
||
// MARK: - ARSCNViewDelegate | ||
|
||
|
@@ -191,7 +187,7 @@ class ViewController: UIViewController, ARSCNViewDelegate { | |
// Get Classifications | ||
let classifications = observations[0...1] // top 2 results | ||
.flatMap({ $0 as? VNClassificationObservation }) | ||
.map({ "\($0.identifier) \(String(format:"- %.2f", $0.confidence))" }) | ||
.map({ "\($0.identifier) \(String(format:"- %.2f", ($0.confidence)*100)) \("%")" }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Earlier it showed only the confidence and the output used to be eg: 0.7632 |
||
.joined(separator: "\n") | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleared the statistics for fps as it was effecting the user experience