Skip to content

Xcode 12.5 / iOS 14.5 / dependencies update #27

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ Note that after I tap `Download New Model`, app starts recognizing `Ho*gaarden`

## Requirements

* Swift 4.2
* Xcode 10.0
* Xcode 12.5.1
* Python 3.6
* virtualenv
* pip
Expand Down
8 changes: 2 additions & 6 deletions iOS/BeerClassifier.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
123BA1191FDD08880044B06D /* BeerClassifier.mlmodel in Sources */ = {isa = PBXBuildFile; fileRef = 123BA1181FDD08880044B06D /* BeerClassifier.mlmodel */; };
126C83B02158FB64000A755E /* BeerClassifierTuri.mlmodel in Sources */ = {isa = PBXBuildFile; fileRef = 126C83AF2158FB64000A755E /* BeerClassifierTuri.mlmodel */; };
128169A91FCA5B570051F8D6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128169A81FCA5B570051F8D6 /* AppDelegate.swift */; };
128169AB1FCA5B570051F8D6 /* BeerClassifierViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 128169AA1FCA5B570051F8D6 /* BeerClassifierViewController.swift */; };
128169AE1FCA5B570051F8D6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 128169AC1FCA5B570051F8D6 /* Main.storyboard */; };
Expand All @@ -30,7 +29,6 @@

/* Begin PBXFileReference section */
123BA1181FDD08880044B06D /* BeerClassifier.mlmodel */ = {isa = PBXFileReference; lastKnownFileType = file.mlmodel; name = BeerClassifier.mlmodel; path = ../../models/BeerClassifier.mlmodel; sourceTree = "<group>"; };
126C83AF2158FB64000A755E /* BeerClassifierTuri.mlmodel */ = {isa = PBXFileReference; lastKnownFileType = file.mlmodel; name = BeerClassifierTuri.mlmodel; path = ../../models/BeerClassifierTuri.mlmodel; sourceTree = "<group>"; };
128169A51FCA5B570051F8D6 /* BeerClassifier.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BeerClassifier.app; sourceTree = BUILT_PRODUCTS_DIR; };
128169A81FCA5B570051F8D6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
128169AA1FCA5B570051F8D6 /* BeerClassifierViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeerClassifierViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -88,7 +86,6 @@
128169C81FCA5BAD0051F8D6 /* ClassificationService.swift */,
128169AC1FCA5B570051F8D6 /* Main.storyboard */,
123BA1181FDD08880044B06D /* BeerClassifier.mlmodel */,
126C83AF2158FB64000A755E /* BeerClassifierTuri.mlmodel */,
128169AF1FCA5B570051F8D6 /* Assets.xcassets */,
128169B11FCA5B570051F8D6 /* LaunchScreen.storyboard */,
128169B41FCA5B570051F8D6 /* Info.plist */,
Expand Down Expand Up @@ -210,7 +207,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
126C83B02158FB64000A755E /* BeerClassifierTuri.mlmodel in Sources */,
123BA1191FDD08880044B06D /* BeerClassifier.mlmodel in Sources */,
128169AB1FCA5B570051F8D6 /* BeerClassifierViewController.swift in Sources */,
128169C91FCA5BAD0051F8D6 /* ClassificationService.swift in Sources */,
Expand Down Expand Up @@ -306,7 +302,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
IPHONEOS_DEPLOYMENT_TARGET = 14.5;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -359,7 +355,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
IPHONEOS_DEPLOYMENT_TARGET = 14.5;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down
18 changes: 12 additions & 6 deletions iOS/BeerClassifier/ClassificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,20 @@ final class ClassificationService {
// MARK: - Private

private func setupClassification() throws {
let model = loadLocal()
let model = try loadLocal()
try updateClassificationRequest(model: model)
}

private func loadModel(classificationType: ClassificationType, completion: ((MLModel) -> ())? = nil) throws {
switch classificationType {
case .beer3:
let model = loadLocal()
completion?(model)
do {
let model = try loadLocal()
completion?(model)
} catch let error {
print("Failed to load model. Error: \(error)")
assertionFailure()
}
case .beer4:
DispatchQueue.global(qos: .userInitiated).async {
// For this sample app model isn't reused on purpose,
Expand All @@ -91,9 +96,10 @@ final class ClassificationService {
try data.write(to: filePathUrl)
}

private func loadLocal() -> MLModel {
// let model = BeerClassifier()
let model = BeerClassifierTuri()
private func loadLocal() throws -> MLModel {
let configuration = MLModelConfiguration()
let model = try BeerClassifier(configuration: configuration)
// let model = BeerClassifierTuri()
return model.model
}

Expand Down
40 changes: 16 additions & 24 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,31 @@ bleach==1.5.0
certifi==2018.4.16
chardet==3.0.4
colorama==0.3.9
coremltools==2.0b1
coremltools==3.0b3
decorator==4.3.0
gast==0.2.0
graphviz==0.8.3
grpcio==1.12.1
h5py==2.8.0
html5lib==0.9999999
idna==2.6
Keras==2.2.4
Keras-Applications==1.0.6
Keras-Preprocessing==1.0.5
Markdown==2.6.11
mxnet==1.1.0.post0
numpy==1.14.4
opencv-python==3.4.1.15
pandas==0.23.0
Pillow==5.1.0
llvmlite==0.29.0
mxnet==1.5.0
numba==0.45.1
numpy==1.16.4
pandas==0.25.1
Pillow==6.1.0
prettytable==0.7.2
protobuf==3.6.1
pysha3==1.0.2
python-dateutil==2.7.3
python-dotenv==0.8.2
pytz==2018.4
PyYAML==3.12
requests==2.20.1
scikit-learn==0.19.1
protobuf==3.9.2
python-dateutil==2.8.0
python-dotenv==0.10.3
pytz==2019.2
requests==2.22.0
resampy==0.2.1
scipy==1.1.0
sha3==0.2.1
six==1.10.0
tensorboard==1.12.0
tensorflow==1.12.0
tensorflow-tensorboard==1.5.1
termcolor==1.1.0
turicreate==5.1
urllib3==1.22
virtualenv==16.0.0
Werkzeug==0.14.1
turicreate==5.7.1
urllib3==1.25.6