Skip to content

Commit

Permalink
feat: updated coreml model
Browse files Browse the repository at this point in the history
  • Loading branch information
castdrian committed Feb 28, 2024
1 parent 96c990d commit c114096
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
16 changes: 4 additions & 12 deletions CoreDex.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
3A3C380B2B8CE160006E5CDE /* ScannerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3C380A2B8CE160006E5CDE /* ScannerViewController.swift */; };
3A3C380D2B8CE1AB006E5CDE /* ScannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3C380C2B8CE1AB006E5CDE /* ScannerView.swift */; };
3A3C380F2B8D01E0006E5CDE /* GenerationCheckMarkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A3C380E2B8D01E0006E5CDE /* GenerationCheckMarkView.swift */; };
3A3C38112B8E74ED006E5CDE /* Gen7.mlmodel in Sources */ = {isa = PBXBuildFile; fileRef = 3A3C38102B8E74ED006E5CDE /* Gen7.mlmodel */; };
3A3C38152B8FAE31006E5CDE /* Dex.mlmodel in Sources */ = {isa = PBXBuildFile; fileRef = 3A3C38142B8FAE31006E5CDE /* Dex.mlmodel */; };
3AB6ED5E2B8A5B41009B24B4 /* CoreDexApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB6ED5D2B8A5B41009B24B4 /* CoreDexApp.swift */; };
3AB6ED602B8A5B41009B24B4 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB6ED5F2B8A5B41009B24B4 /* ContentView.swift */; };
3AB6ED622B8A5B42009B24B4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3AB6ED612B8A5B42009B24B4 /* Assets.xcassets */; };
Expand All @@ -35,7 +35,7 @@
3A3C380A2B8CE160006E5CDE /* ScannerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerViewController.swift; sourceTree = "<group>"; };
3A3C380C2B8CE1AB006E5CDE /* ScannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScannerView.swift; sourceTree = "<group>"; };
3A3C380E2B8D01E0006E5CDE /* GenerationCheckMarkView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenerationCheckMarkView.swift; sourceTree = "<group>"; };
3A3C38102B8E74ED006E5CDE /* Gen7.mlmodel */ = {isa = PBXFileReference; lastKnownFileType = file.mlmodel; path = Gen7.mlmodel; sourceTree = "<group>"; };
3A3C38142B8FAE31006E5CDE /* Dex.mlmodel */ = {isa = PBXFileReference; lastKnownFileType = file.mlmodel; path = Dex.mlmodel; sourceTree = "<group>"; };
3AB6ED5A2B8A5B41009B24B4 /* CoreDex.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CoreDex.app; sourceTree = BUILT_PRODUCTS_DIR; };
3AB6ED5D2B8A5B41009B24B4 /* CoreDexApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDexApp.swift; sourceTree = "<group>"; };
3AB6ED5F2B8A5B41009B24B4 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -118,20 +118,12 @@
3AB6ED8B2B8A8F60009B24B4 /* CoreML */ = {
isa = PBXGroup;
children = (
3AB6ED8E2B8A93B2009B24B4 /* Models */,
3A3C38142B8FAE31006E5CDE /* Dex.mlmodel */,
3AB6ED8C2B8A924E009B24B4 /* ImagePredictor.swift */,
);
path = CoreML;
sourceTree = "<group>";
};
3AB6ED8E2B8A93B2009B24B4 /* Models */ = {
isa = PBXGroup;
children = (
3A3C38102B8E74ED006E5CDE /* Gen7.mlmodel */,
);
path = Models;
sourceTree = "<group>";
};
3ACEBA342B8B9DAB00BFF4CF /* Views */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -243,11 +235,11 @@
3A3C38092B8CD67E006E5CDE /* ScanButton.swift in Sources */,
3AB6ED602B8A5B41009B24B4 /* ContentView.swift in Sources */,
3ACEBA372B8B9E8F00BFF4CF /* ColorUtils.swift in Sources */,
3A3C38152B8FAE31006E5CDE /* Dex.mlmodel in Sources */,
3AB6ED8D2B8A924E009B24B4 /* ImagePredictor.swift in Sources */,
3AB6ED5E2B8A5B41009B24B4 /* CoreDexApp.swift in Sources */,
3ACEBA392B8BD40000BFF4CF /* AudioPlayerDelegate.swift in Sources */,
3ACEBA3B2B8C828E00BFF4CF /* Classifications.swift in Sources */,
3A3C38112B8E74ED006E5CDE /* Gen7.mlmodel in Sources */,
3A3C380D2B8CE1AB006E5CDE /* ScannerView.swift in Sources */,
3ACEBA2B2B8B676500BFF4CF /* DexEntryView.swift in Sources */,
3A3C380B2B8CE160006E5CDE /* ScannerViewController.swift in Sources */,
Expand Down
Binary file added CoreDex/CoreML/Dex.mlmodel
Binary file not shown.
3 changes: 1 addition & 2 deletions CoreDex/CoreML/ImagePredictor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import UIKit
class ImagePredictor {
static func createImageClassifier() -> VNCoreMLModel {
let defaultConfig = MLModelConfiguration()

let imageClassifierWrapper = try? Gen7(configuration: defaultConfig)
let imageClassifierWrapper = try? Dex(configuration: defaultConfig)

guard let imageClassifier = imageClassifierWrapper else {
fatalError("App failed to create an image classifier model instance.")
Expand Down
2 changes: 1 addition & 1 deletion CoreDex/Views/GenerationCheckMarkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SwiftUI

struct GenerationCheckMarkView: View {
let generations = 1...9
@State private var selectedGens: Set<Int> = [7]
@State private var selectedGens: Set<Int> = [1,7]

var body: some View {
VStack(alignment: .leading) {
Expand Down

0 comments on commit c114096

Please sign in to comment.