This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.m | |
// Gap | |
// | |
// Created by Daniele on 02/04/13. | |
// Copyright (c) 2013 Daniele Galiotto - www.nexor.it. All rights reserved. | |
// | |
#import "AppDelegate.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post_install do |installer| | |
installer.pods_project.targets.each do |target| | |
if target.name == 'TesseractOCRiOS' | |
target.build_configurations.each do |config| | |
config.build_settings['ENABLE_BITCODE'] = 'NO' | |
end | |
header_phase = target.build_phases().select do |phase| | |
phase.is_a? Xcodeproj::Project::PBXHeadersBuildPhase | |
end.first | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
class PFObject: Any { | |
} | |
let objsA: [PFObject] = [] | |
let objsB: [[String: Any]] = [[:]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#to print Build settings type on terminal: xcodebuild -project MyProject.xcodeproj -target "MyTarget" -showBuildSettings | |
#PROJECT_DIR = /Users/daniele/Desktop/MyProjectFolder | |
project_content_folder="MyProject" | |
storyboard_file="Main.storyboard" | |
storyboard_file_orig="Main_orig.storyboard" | |
storyboard_file_backup="Main_bk.storyboard" | |
storyboard_dir="${PROJECT_DIR}/${project_content_folder}/Base.lproj" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#to print Build settings type on terminal: xcodebuild -project MyProject.xcodeproj -target "MyTarget" -showBuildSettings | |
#PROJECT_DIR = /Users/daniele/Desktop/MyProjectFolder | |
project_content_folder="MyProject" | |
storyboard_file="Main.storyboard" | |
storyboard_file_orig="Main_orig.storyboard" | |
storyboard_file_backup="Main_bk.storyboard" | |
storyboard_dir="${PROJECT_DIR}/${project_content_folder}/Base.lproj" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -frd ~/Library/Developer/Xcode/DerivedData/* | |
rm -frd ~/Library/Caches/com.apple.dt.Xcode/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> | |
<device id="retina5_9" orientation="portrait"> | |
<adaptation id="fullscreen"/> | |
</device> | |
<dependencies> | |
<deployment identifier="iOS"/> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/> | |
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | |
</dependencies> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func resetOnError() { | |
DispatchQueue.main.async { | |
self.imgPicture?.image = nil | |
self.lblGender?.text = self.noPixels | |
} | |
} | |
func setGender(prob: MLMultiArray?) { | |
DispatchQueue.main.async { | |
guard let probArray = prob, probArray.count >= 2 else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func predictImageVision(image: UIImage) { | |
let genderModel = try! VNCoreMLModel(for: Gender().model) | |
let genderRequest = VNCoreMLRequest(model: genderModel) { (req, err) in | |
guard let results = req.results as? [VNCoreMLFeatureValueObservation], let firstResult = results.first else { | |
self.resetOnError() | |
return | |
} | |
self.setGender(prob: firstResult.featureValue.multiArrayValue) | |
} |