Monthly Archives: February 2016

New Tutorial – Image Handling in DeepLearningKit

There has been a few requests (on github issues and stackoverflow) about image handling in DeepLearningKit, this is about how to transform back-and-forth between bitmap format used in the Deep Learning (conv.net) calculation and UIImage used in tvOS and iOS DeepLearningKit demo apps (for OS X the issue is still unsolved since NSImage is slightly different). What is provided is an API for setting and getting pixels on an UIImage, see the tutorial for details.


[LINK TO TUTORIAL – Image Handling in DeepLearningKit]

Video Tutorial – Using the DeepLearningKit example OS X app

This video shows how to use the standalone (very simple) example iOS app that comes with DeepLearningKit, the code can be found (as part of the main repository) at github.com/DeepLearningKit/DeepLearningKit/tree/master/OSXDeepLearningKitApp/OSXDeepLearningKitApp

Viewcontroller.swift


import Cocoa

class ViewController: NSViewController {
var deepNetwork: DeepNetwork!

override func viewDidLoad() {
super.viewDidLoad()
}

override func viewDidAppear() {
deepNetwork = DeepNetwork()

// conv1.json contains a cifar 10 image of a cat
let conv1Layer = deepNetwork.loadJSONFile("conv1")!
let image: [Float] = conv1Layer["input"] as! [Float]

var randomimage = createFloatNumbersArray(image.count)
for i in 0..

Video Tutorial – Using the DeepLearningKit example iOS app

This video shows how to use the standalone (very simple) example iOS app that comes with DeepLearningKit, the code can be found (as part of the main repository) at github.com/DeepLearningKit/DeepLearningKit/tree/master/iOSDeepLearningKitApp/iOSDeepLearningKitApp

Viewcontroller.swift


import UIKit

class ViewController: UIViewController {
var deepNetwork: DeepNetwork!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func viewDidAppear(animated: Bool) {
deepNetwork = DeepNetwork()

// conv1.json contains a cifar 10 image of a cat
let conv1Layer = deepNetwork.loadJSONFile("conv1")!
let image: [Float] = conv1Layer["input"] as! [Float]

var randomimage = createFloatNumbersArray(image.count)
for i in 0..