Skip to content

Commit a77faff

Browse files
shoumikhinfacebook-github-bot
authored andcommitted
Hide the latency label and portable ops mode. (#683)
Summary: Pull Request resolved: #683 Cleaning up the UI for the demo. Reviewed By: cccclai Differential Revision: D50052732 fbshipit-source-id: 0885e6ff6754130650444af42a7870e4a4378d90
1 parent 09e60a0 commit a77faff

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

examples/demo-apps/apple_ios/ExecuTorchDemo/ExecuTorchDemo/Sources/App/ClassificationController.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@ import MobileNetClassifier
1111
import SwiftUI
1212

1313
enum Mode: String, CaseIterable {
14-
case cpu = "CPU"
14+
case xnnpack = "XNNPACK"
1515
case coreML = "CoreML"
1616
case mps = "MPS"
17-
case xnnpack = "XNNPACK"
1817
}
1918

2019
class ClassificationController: ObservableObject {
21-
@AppStorage("mode") var mode: Mode = .cpu
20+
@AppStorage("mode") var mode: Mode = .xnnpack
2221
@Published var classifications: [Classification] = []
2322
@Published var elapsedTime: TimeInterval = 0.0
2423
@Published var isRunning = false
2524

2625
private let queue = DispatchQueue(label: "org.pytorch.executorch.demo", qos: .userInitiated)
2726
private var classifier: ImageClassification?
28-
private var currentMode: Mode = .cpu
27+
private var currentMode: Mode = .xnnpack
2928

3029
func classify(_ image: UIImage) {
3130
guard !isRunning else {
@@ -62,8 +61,6 @@ class ClassificationController: ObservableObject {
6261
private func createClassifier(for mode: Mode) throws -> ImageClassification? {
6362
let modelFileName: String
6463
switch mode {
65-
case .cpu:
66-
modelFileName = "mv3"
6764
case .coreML:
6865
modelFileName = "mv3_coreml"
6966
case .mps:

examples/demo-apps/apple_ios/ExecuTorchDemo/ExecuTorchDemo/Sources/App/ContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct ContentView: View {
3333
TopBar(title: "ExecuTorch Demo")
3434
ClassificationLabelView(controller: classificationController)
3535
Spacer()
36-
ClassificationTimeView(controller: classificationController)
36+
ClassificationTimeView(controller: classificationController).hidden()
3737
ModeSelector(controller: classificationController)
3838
}
3939
}

0 commit comments

Comments
 (0)