Skip to content

Hide the latency label and portable ops mode. #683

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

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@ import MobileNetClassifier
import SwiftUI

enum Mode: String, CaseIterable {
case cpu = "CPU"
case xnnpack = "XNNPACK"
case coreML = "CoreML"
case mps = "MPS"
case xnnpack = "XNNPACK"
}

class ClassificationController: ObservableObject {
@AppStorage("mode") var mode: Mode = .cpu
@AppStorage("mode") var mode: Mode = .xnnpack
@Published var classifications: [Classification] = []
@Published var elapsedTime: TimeInterval = 0.0
@Published var isRunning = false

private let queue = DispatchQueue(label: "org.pytorch.executorch.demo", qos: .userInitiated)
private var classifier: ImageClassification?
private var currentMode: Mode = .cpu
private var currentMode: Mode = .xnnpack

func classify(_ image: UIImage) {
guard !isRunning else {
Expand Down Expand Up @@ -62,8 +61,6 @@ class ClassificationController: ObservableObject {
private func createClassifier(for mode: Mode) throws -> ImageClassification? {
let modelFileName: String
switch mode {
case .cpu:
modelFileName = "mv3"
case .coreML:
modelFileName = "mv3_coreml"
case .mps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct ContentView: View {
TopBar(title: "ExecuTorch Demo")
ClassificationLabelView(controller: classificationController)
Spacer()
ClassificationTimeView(controller: classificationController)
ClassificationTimeView(controller: classificationController).hidden()
ModeSelector(controller: classificationController)
}
}
Expand Down