CINXE.COM

MetalBender on CocoaPods.org

<!DOCTYPE html><html lang="en-en"><head><title>MetalBender on CocoaPods.org</title><meta charset="utf-8" /><meta content="cocoapods objective-c objc swift package manager libraries documentation search pods podspec podfile cocoa apple ios library" name="keywords" /><meta content="IE=edge" http-equiv="X-UA-Compatible" /><meta content="width=device-width, initial-scale=1.0" name="viewport" /><meta content="Bender is an abstraction layer over MetalPerformanceShaders useful for working with neural networks." name="description" /><meta content="Xmartlabs SRL" name="author" /><meta content="summary_large_image" name="twitter:card" /><meta content="@CocoaPods" name="twitter:site" /><meta content="@xmartlabs" name="twitter:creator" /><meta content="MetalBender" name="twitter:title" /><meta content="Bender is an abstraction layer over MetalPerformanceShaders useful for working with neural networks." name="twitter:description" /><meta content="https://cocoapods.org/pods/MetalBender" name="twitter:url" /><meta content="http://cocoadocs.org/docsets/MetalBender/0.5.0/preview.png" name="twitter:image:src" /><meta content="CocoaPods" property="og:site_name" /><meta content="MetalBender" property="og:title" /><meta content="https://cocoapods.org/pods/MetalBender" property="og:url" /><meta content="website" property="og:type" /><meta content="Bender is an abstraction layer over MetalPerformanceShaders useful for working with neural networks." property="og:description" /><meta content="http://cocoadocs.org/docsets/MetalBender/0.5.0/preview.png" property="og:image" /><link rel="shortcut icon" href="https://cocoapods.org/favicons/favicon.ico" type="image/x-icon" /><link rel="apple-touch-icon" href="https://cocoapods.org/favicons/apple-touch-icon.png" /><link rel="apple-touch-icon" sizes="57x57" href="https://cocoapods.org/favicons/apple-touch-icon-57x57.png" /><link rel="apple-touch-icon" sizes="60x60" href="https://cocoapods.org/favicons/apple-touch-icon-60x60.png" /><link rel="apple-touch-icon" sizes="72x72" href="https://cocoapods.org/favicons/apple-touch-icon-72x72.png" /><link rel="apple-touch-icon" sizes="76x76" href="https://cocoapods.org/favicons/apple-touch-icon-76x76.png" /><link rel="apple-touch-icon" sizes="114x114" href="https://cocoapods.org/favicons/apple-touch-icon-114x114.png" /><link rel="apple-touch-icon" sizes="120x120" href="https://cocoapods.org/favicons/apple-touch-icon-120x120.png" /><link rel="apple-touch-icon" sizes="144x144" href="https://cocoapods.org/favicons/apple-touch-icon-144x144.png" /><link rel="apple-touch-icon" sizes="152x152" href="https://cocoapods.org/favicons/apple-touch-icon-152x152.png" /><script src="/javascripts/application-97f16ecf69e2ef4c6e27fea28c9da97a.js"></script><link href="/stylesheets/app-97f16ecf69e2ef4c6e27fea28c9da97a.css" media="screen" rel="stylesheet" type="text/css" /><link href="https://cocoapods.org/opensearch.xml" rel="search" title="CocoaPods" type="application/opensearchdescription+xml" /></head><body><nav class="navbar navbar-static-top" role="navigation"><section class="container"><div class="navbar-header"><button class="navbar-toggle" data-target=".navbar-header-collapse" data-toggle="collapse" type="button"><span class="sr-only">Toggle navigation</span><span class="glyphicon glyphicon-plus"></span></button><a class="navbar-brand" href="https://cocoapods.org"></a></div><div class="collapse navbar-collapse navbar-header-collapse"><ul class="nav navbar-nav navbar-right"><li><a href="https://cocoapods.org/about">About</a></li><li><a href="https://guides.cocoapods.org">Guides</a></li><li><a href="https://blog.cocoapods.org">Blog</a></li></ul></div></section></nav><section class="container"><article class="row" id="headline"><div class="col-lg-12 col-sm-12 col-xs-12"><h1>MetalBender <span>0.5.0</span></h1></div></article></section><div id="content-wrapper"><section class="container" id="pod-page"><article class="row"><div class="pod_result"><div class="pod-metadata clearfix"></div><div class="sideline col-sm-3 col-xs-12 col-sm-push-9"><h1 class="visible-xs inline-headline"><a href='/pods/MetalBender'>MetalBender</a> <span>0.5.0</span></h1><div class="close-expanded"><a href="#">&times;</a></div><h3></h3><table class='header'><tbody><tr><td> <span class='hidden-lg-span'>Tests</span><span class='visible-lg-span'>Tested</span> </td><td>✗</td></tr><tr><td> <span class='hidden-lg-span'>Lang</span><span class='visible-lg-span'>Language</span> </td><td> <span class='hidden-lg-span'>Swift</span><span class='visible-lg-span'>Swift</span> </td></tr><tr><td>License</td><td> <a href='https://github.com/xmartlabs/Bender.git'>Unknown</a> </td></tr><tr><td> <span class='hidden-lg-span'>Released</span><span class='visible-lg-span'>Last Release</span> </td><td>May 2018</td></tr><tr><td> <span class='hidden-lg-span'>SPM</span><span class='visible-lg-span'>Supports SPM</span> </td><td>✗</td></tr></tbody></table><p>Maintained by <a href='/owners/15088'>Diego Ernst</a>, <a href='/owners/6240'>Mathias Claassen</a>, <a href='/owners/24160'>Santiago Castro</a>, <a href='/owners/24190'>Santiago Fernandez</a>, <a href='/owners/1503'>Martin Barreto</a>, <a href='/owners/22259'>Karina XL</a>.</p><hr /><button class="btn" data-target="#installation_guide" data-toggle="modal" type="button">Installation Guide</button><div aria-hidden="true" aria-labelledby="installation_label" class="modal fade" id="installation_guide" role="dialog" tabindex="-1"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button aria-label="Close" class="close" data-dismiss="modal" type="button"><span aria-hidden="true">&times</span></button><h4 class="modal-title" id="installation_label">Installation Guide for MetalBender</h4></div><div class="modal-body"><p>You want to add <code>pod 'MetalBender', '~> 0.5'</code> similar to the following to your Podfile:</p><pre><code>target 'MyApp' do pod 'MetalBender', '~> 0.5' end</code></pre><p>Then run a <code>pod install</code> inside your terminal, or from CocoaPods.app.</p><hr /><p>Alternatively to give it a test run, run the command:</p><p><code>pod try MetalBender</code></p></div></div></div></div><hr /><table><tbody><tr><td>&nbsp;</td><td></td></tr><tr><td>Depends on:</td><td></td></tr><tr><td><a href="/pods/SwiftProtobuf">SwiftProtobuf</a></td><td>= 1.0.0</td></tr><tr><td><a href="/pods/MetalPerformanceShadersProxy">MetalPerformanceShadersProxy</a></td><td>= 0.2.0</td></tr><tr><td>&nbsp;</td><td></td></tr></tbody></table><hr /><ul class="links"><li><a href="https://github.com/CocoaPods/Specs/blob/master/Specs/d/9/7/MetalBender/0.5.0/MetalBender.podspec.json">See Podspec</a></li><li><a href="https://github.com/xmartlabs/Bender">GitHub Repo</a></li><li><a href="https://cocoapods.org/pods/MetalBender">Page on CocoaPods.org</a></li></ul></div><div class="readme-content col-sm-9 col-xs-12 col-sm-pull-3"><div class="inline-headline"><h1 class="hidden-xs"><a href='/pods/MetalBender'>MetalBender</a> <span>0.5.0</span></h1></div><ul class="attribution"><li>By</li><li>Xmartlabs SRL</li><li class="twitter"><a href="https://twitter.com/xmartlabs">xmartlabs</a></li></ul><nav><ul><li class="github-link"><a class="hidden-xs" href="https://github.com/xmartlabs/Bender">xmartlabs/Bender</a><a class="visible-xs" href="https://github.com/xmartlabs/Bender">GitHub Repo</a></li></ul></nav><div class="clearfix"></div><ul class="nav nav-tabs" id="asset_switcher" role="tablist"><li class="active"><a aria-controls="README" class="media_node span" data-target="#readme" data-toggle="tab" href="#" id="readme_tab">OVERVIEW</a></li><li><a aria-controls="CHANGELOG" class="media_node span media_node span" data-target="#changelog_content" data-toggle="tabajax" href="/pods/MetalBender/changelog" id="changelog_tab">CHANGELOG</a></li></ul><div class="tab-content"><div class="tab-pane active" id="readme"><div id="readme" class="announce instapaper_body md" data-path="README.md"><article class="markdown-body entry-content" itemprop="text"><h1><a id="user-content-bender" class="anchor" aria-hidden="true" href="#bender"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Bender</h1> <p align="left"> <a href="https://travis-ci.org/xmartlabs/Bender" rel="nofollow"><img src="https://camo.githubusercontent.com/b327409a0d6321068acd518fd207844a987dd7c2/68747470733a2f2f7472617669732d63692e6f72672f786d6172746c6162732f42656e6465722e7376673f6272616e63683d6d6173746572" alt="Build status" data-canonical-src="https://travis-ci.org/xmartlabs/Bender.svg?branch=master" style="max-width:100%;"></a> <a target="_blank" href="https://camo.githubusercontent.com/4f118b3bbdae3a6c576b02083da10f466a7d46d9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d694f532d626c75652e7376673f7374796c653d666c6174"><img src="https://camo.githubusercontent.com/4f118b3bbdae3a6c576b02083da10f466a7d46d9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d694f532d626c75652e7376673f7374796c653d666c6174" alt="Platform iOS" data-canonical-src="https://img.shields.io/badge/platform-iOS-blue.svg?style=flat" style="max-width:100%;"></a> <a href="https://developer.apple.com/swift" rel="nofollow"><img src="https://camo.githubusercontent.com/987c5cc551bc4988195dffc73b6822e11eb451cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7377696674342d636f6d70617469626c652d3442433531442e7376673f7374796c653d666c6174" alt="Swift 4 compatible" data-canonical-src="https://img.shields.io/badge/swift4-compatible-4BC51D.svg?style=flat" style="max-width:100%;"></a> <a href="https://cocoapods.org/pods/MetalBender" rel="nofollow"><img src="https://camo.githubusercontent.com/742f830f77822e84e804aa36171fd2bef413fc3b/68747470733a2f2f696d672e736869656c64732e696f2f636f636f61706f64732f762f4d6574616c42656e6465722e737667" alt="CocoaPods compatible" data-canonical-src="https://img.shields.io/cocoapods/v/MetalBender.svg" style="max-width:100%;"></a> <a href="https://github.com/Carthage/Carthage"><img src="https://camo.githubusercontent.com/3dc8a44a2c3f7ccd5418008d1295aae48466c141/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f43617274686167652d636f6d70617469626c652d3442433531442e7376673f7374796c653d666c6174" alt="Carthage compatible" data-canonical-src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" style="max-width:100%;"></a> <a href="https://raw.githubusercontent.com/xmartlabs/Bender/master/LICENSE" rel="nofollow"><img src="https://camo.githubusercontent.com/4ad0bc4de8816451a4a76b886b76142b99d10ffb/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174" alt="License: MIT" data-canonical-src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat" style="max-width:100%;"></a> <a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fxmartlabs%2FBender?ref=badge_shield" alt="FOSSA Status" rel="nofollow"><img src="https://camo.githubusercontent.com/cbda2fb3e16a904d1af2a4fcedda4cf736bd5891/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246786d6172746c61627325324642656e6465722e7376673f747970653d736869656c64" data-canonical-src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fxmartlabs%2FBender.svg?type=shield" style="max-width:100%;"></a> </p> <p><a target="_blank" href="Documentation/Media/Artboard.png"><img src="Documentation/Media/Artboard.png" alt="Bender" style="max-width:100%;"></a></p> <p>Bender is an abstraction layer over MetalPerformanceShaders useful for working with neural networks.</p> <h2><a id="user-content-contents" class="anchor" aria-hidden="true" href="#contents"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Contents</h2> <ul> <li><a href="#introduction">Introduction</a></li> <li><a href="#why">Why did we need Bender</a></li> <li><a href="#usage">Basic usage</a></li> <li><a href="#requirements">Requirements</a></li> <li><a href="#getting-involved">Getting involved</a></li> <li><a href="#examples">Examples</a></li> <li><a href="#installation">Installation</a></li> <li><a href="#change-log">Changelog</a></li> </ul> <p>The documentation can be found under the <code>Documentation</code> folder:</p> <ul> <li><a href="Documentation/API.md">API</a> contains the most important information to get started.</li> <li><a href="Documentation/Supported_Layers.md">Supported Layers</a> explains which layers are supported and how they map to TensorFlow ops.</li> <li><a href="Documentation/Importing.md">Importing</a> explains how to import models from other frameworks such as TensorFlow. You can also find information on how to enhance this functionality for custom implementations.</li> </ul> <h2><a id="user-content-introduction" class="anchor" aria-hidden="true" href="#introduction"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Introduction</h2> <p>Bender is an abstraction layer over MetalPerformanceShaders which is used to work with neural networks. It is of growing interest in the AI environment to execute neural networks on mobile devices even if the training process has been done previously. We want to make it easier for everyone to execute pretrained networks on iOS.</p> <p>Bender allows you to easily define and run neural networks using the most common layers like Convolution, Pooling, FullyConnected and some normalizations among others. It is also flexible in the way it receives the parameters for these layers.</p> <p>We also want to support loading models trained on other frameworks such as TensorFlow or Caffe2. Currently Bender includes an adapter for TensorFlow that loads a graph with variables and "translates" it to Bender layers. This feature supports a subset of TensorFlow's operations but we plan to enhance it to cover more cases.</p> <h2><a id="user-content-why-did-we-need-bender-" class="anchor" aria-hidden="true" href="#why-did-we-need-bender-"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Why did we need Bender? <a name="user-content-why"></a></h2> <p>At <a href="http://xmartlabs.com" rel="nofollow">Xmartlabs</a> we were about to start a Machine Learning project and investigated frameworks to use in iOS. We found MetalPerformanceShaders useful but not very user friendly and we saw ourselves repeating a lot of code and information. That is why we starting building a framework to handle that kind of stuff.</p> <p>We also found ourselves creating scripts to translate the models we had from training with TensorFlow to iOS. This means transposing the weights to the MPSCNN format and also mapping the parameters of the different kinds of layers in TensorFlow to the parameters used by the MPSCNN kernels. TensorFlow can be compiled for iOS but currently it does not support running on GPU which we wanted to do. We also did not want to include TensorFlow's static library into our project. This is why we also started to work on an adapter that would parse a TF graph and translate it to our Bender layers.</p> <h2><a id="user-content-usage" class="anchor" aria-hidden="true" href="#usage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Usage</h2> <p>You can define your own network in Bender using our custom operator or you can load a model exported from TensorFlow. Defining a network and loading a model can be done like this:</p> <div class="highlight highlight-source-swift"><pre><span class="pl-k">import</span> <span class="pl-en">MetalBender</span> <span class="pl-k">let</span> url <span class="pl-k">=</span> Bundle.<span class="pl-smi">main</span>.<span class="pl-c1">url</span>(<span class="pl-c1">forResource</span>: <span class="pl-s"><span class="pl-pds">"</span>myModel<span class="pl-pds">"</span></span>, <span class="pl-c1">withExtension</span>: <span class="pl-s"><span class="pl-pds">"</span>pb<span class="pl-pds">"</span></span>)<span class="pl-k">!</span> <span class="pl-c"><span class="pl-c">//</span> A TensorFlow model.</span> <span class="pl-c"></span><span class="pl-k">let</span> network <span class="pl-k">=</span> Network.<span class="pl-c1">load</span>(<span class="pl-c1">url</span>: url, <span class="pl-c1">inputSize</span>: <span class="pl-c1">LayerSize</span>(<span class="pl-c1">h</span>: <span class="pl-c1">256</span>, <span class="pl-c1">w</span>: <span class="pl-c1">256</span>, <span class="pl-c1">f</span>: <span class="pl-c1">3</span>)) network.<span class="pl-c1">run</span>(<span class="pl-c1">input</span>: <span class="pl-c"><span class="pl-c">/*</span> ... <span class="pl-c">*/</span></span>) { output <span class="pl-k">in</span> <span class="pl-c"><span class="pl-c">//</span> ...</span> <span class="pl-c"></span>}</pre></div> <p>You can read more information about this in <a href="Documentation/Importing.md">Importing</a>.</p> <p>If you want to define your network yourself you can do it like this:</p> <div class="highlight highlight-source-swift"><pre><span class="pl-k">let</span> network <span class="pl-k">=</span> <span class="pl-c1">Network</span>(<span class="pl-c1">inputSize</span>: <span class="pl-c1">LayerSize</span>(<span class="pl-c1">h</span>: <span class="pl-c1">256</span>, <span class="pl-c1">w</span>: <span class="pl-c1">256</span>, <span class="pl-c1">f</span>: <span class="pl-c1">3</span>)) network.<span class="pl-c1">start</span> <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">Convolution</span>(<span class="pl-c1">convSize</span>: <span class="pl-c1">ConvSize</span>(<span class="pl-c1">outputChannels</span>: <span class="pl-c1">16</span>, <span class="pl-c1">kernelSize</span>: <span class="pl-c1">3</span>, <span class="pl-c1">stride</span>: <span class="pl-c1">2</span>)) <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">InstanceNorm</span>() <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">Convolution</span>(<span class="pl-c1">convSize</span>: <span class="pl-c1">ConvSize</span>(<span class="pl-c1">outputChannels</span>: <span class="pl-c1">32</span>, <span class="pl-c1">kernelSize</span>: <span class="pl-c1">3</span>, <span class="pl-c1">stride</span>: <span class="pl-c1">2</span>), <span class="pl-c1">neuronType</span>: .<span class="pl-smi">relu</span>) <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">InstanceNorm</span>() <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">FullyConnected</span>(<span class="pl-c1">neurons</span>: <span class="pl-c1">128</span>) <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">Neuron</span>(<span class="pl-c1">type</span>: .<span class="pl-smi">tanh</span>) <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">FullyConnected</span>(<span class="pl-c1">neurons</span>: <span class="pl-c1">10</span>) <span class="pl-k">-&gt;&gt;</span> <span class="pl-c1">Softmax</span>() <span class="pl-c"><span class="pl-c">//</span> ...</span></pre></div> <p>and once you're done with all your layers:</p> <div class="highlight highlight-source-swift"><pre>network.<span class="pl-c1">initialize</span>()</pre></div> <p>To know more about this have a look at <a href="Documentation/API.md">API</a>.</p> <h2><a id="user-content-requirements" class="anchor" aria-hidden="true" href="#requirements"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Requirements</h2> <ul> <li>Xcode 9</li> <li>iOS 11.0+ (but deployment target is iOS 10.0, so iOS 10 is supported)</li> </ul> <h2><a id="user-content-getting-involved" class="anchor" aria-hidden="true" href="#getting-involved"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Getting involved</h2> <ul> <li>If you <strong>want to contribute</strong> please feel free to <strong>submit pull requests</strong>.</li> <li>If you <strong>have a feature request</strong> please <strong>open an issue</strong>.</li> <li>If you <strong>found a bug</strong> or <strong>need help</strong> please <strong>check older issues, <a href="#faq">FAQ</a> and threads on <a href="https://stackoverflow.com" rel="nofollow">StackOverflow</a> before submitting an issue</strong>.</li> </ul> <p>Before contribute check the <a href="https://github.com/xmartlabs/Bender/blob/master/CONTRIBUTING.md">CONTRIBUTING</a> file for more info.</p> <p>If you use <strong>Bender</strong> in your app We would love to hear about it! Drop us a line on <a href="https://twitter.com/xmartlabs" rel="nofollow">Twitter</a>.</p> <h2><a id="user-content-examples" class="anchor" aria-hidden="true" href="#examples"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Examples</h2> <p>Follow these steps to run the examples:</p> <ul> <li>Clone Bender repository (or download it).</li> <li>Run <code>carthage update --platform iOS</code> in the downloaded folder.</li> <li>Open Bender workspace and run the <em>Example</em> project.</li> </ul> <blockquote> <p>There is an Image recognition example which includes a MobileNet model in Bender and one in CoreML. It is also set up to run an Inception model but you will have to download it separately as it is almost 100 MB in size. You can download it from <a href="http://download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz" rel="nofollow">http://download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz</a> but then you have to freeze it and add it to the 'Example' Xcode project as 'inception_v3.pb'.</p> </blockquote> <h2><a id="user-content-installation" class="anchor" aria-hidden="true" href="#installation"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Installation</h2> <h4><a id="user-content-cocoapods" class="anchor" aria-hidden="true" href="#cocoapods"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>CocoaPods</h4> <p>To install Bender, simply add the following line to your Podfile:</p> <div class="highlight highlight-source-ruby"><pre>pod <span class="pl-s"><span class="pl-pds">'</span>MetalBender<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>~&gt; 0.5<span class="pl-pds">'</span></span></pre></div> <blockquote> <p>Remember that Bender compiles for iOS 10. So you must add <code>platform :ios, '10.0'</code> to your Podfile</p> </blockquote> <h4><a id="user-content-carthage" class="anchor" aria-hidden="true" href="#carthage"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Carthage</h4> <p><a href="https://github.com/Carthage/Carthage">Carthage</a> is a simple, decentralized dependency manager for Cocoa.</p> <p>To install Bender, add the following line to your Cartfile:</p> <pre lang="ogdl"><code>github "xmartlabs/Bender" ~&gt; 0.5 </code></pre> <p>Then run:</p> <div class="highlight highlight-source-shell"><pre>carthage update --platform iOS</pre></div> <p>Finally, drag the built <code>.framework</code> binaries for <code>MetalBender</code>, <code>MetalPerformanceShadersProxy</code> and <code>SwiftProtobuf</code> to your application's Xcode project.</p> <h2><a id="user-content-author" class="anchor" aria-hidden="true" href="#author"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Author</h2> <ul> <li><a href="https://github.com/xmartlabs">Xmartlabs SRL</a> (<a href="https://twitter.com/xmartlabs" rel="nofollow">@xmartlabs</a>)</li> </ul> <h1><a id="user-content-change-log" class="anchor" aria-hidden="true" href="#change-log"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Change Log</h1> <p>This can be found in the <a href="CHANGELOG.md">CHANGELOG.md</a> file.</p> <h2><a id="user-content-license" class="anchor" aria-hidden="true" href="#license"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>License</h2> <p><a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fxmartlabs%2FBender?ref=badge_large" rel="nofollow"><img src="https://camo.githubusercontent.com/933db39d34d25695c37994b8cd86408bee98365d/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246786d6172746c61627325324642656e6465722e7376673f747970653d6c61726765" alt="FOSSA Status" data-canonical-src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fxmartlabs%2FBender.svg?type=large" style="max-width:100%;"></a></p> </article></div></div><div class="tab-pane" id="changelog_content"></div></div></div><div class="clearfix"></div></div></article></section></div><script>$copy_to_clipboard = $('ol.results img.copy') var clip = new ZeroClipboard( $copy_to_clipboard, { moviePath: "/flashes/ZeroClipboard.swf", forceHandCursor: true } ); clip.on( 'noflash', function ( client, args ) { // provide a recursive wait method // that checks for the hover on the popover/clipboard // before hiding so you can select text function closePopoverForNode(node){ setTimeout(function() { if (!$(node).is(':hover') && !$(".popover:hover").length) { $(node).popover("hide") } else { closePopoverForNode(node) } }, 500); } // With no flash you should be able to select the text // in the popover $copy_to_clipboard.popover({ trigger: "manual", container: "body" }).on("click", function(e) { e.preventDefault(); }).on("mouseenter", function() { $(this).popover("show"); $(".popover input").select() }).on("mouseleave", function() { closePopoverForNode(this) }); }); // When Flash works, jusst do a normal popover clip.on("load", function(client) { client.on( "complete", function(client, args) { $("h4.has-flash").text("Saved to clipboard"); $(".popover").addClass("saved") }); clip.on( 'mouseover', function ( client, args ) { $(this).popover('show') }); clip.on( 'mouseout', function ( client, args ) { $(this).popover('hide') }); }); // When the page loads up check for a #changelog and load the changelog instead of the README if possible $(document).ready(function() { if ($("#asset_switcher").length == 0) { return } if (location.hash == "#changelog") { $("#changelog_tab").click() } // Make it easy to get a changelog URL for C+Ping $('#asset_switcher a').on('shown.bs.tab', function (e) { var is_changelog = $(e.target).data("target") == "#changelog_content" var new_hash = (is_changelog) ? "#changelog" : "" var current_url = window.location.toString().split('#')[0] history.replaceState(null, null, current_url + new_hash) }) })</script><div class="clearfix"></div><footer class="page-footer"><section class="container"><div class="row"><article class="col-md-8 col-lg-8 col-sm-12 col-md-offset-2 col-lg-offset-2 col-xs-12"><h4>CocoaPods is a project from</h4><p class="contributors"> <a href="https://twitter.com/dnkoutso">Dimitris Koutsogiorgas</a>, <a href="https://dani.builds.terrible.systems/">Danielle Lancashire</a>, <a href="https://github.com/amorde">Eric Amorde</a>, <a href="https://orta.io">Orta Therox</a>, <a href="https://github.com/paulb777">Paul Beusterien</a>, <a href="https://segiddins.me">Samuel Giddins</a>, and <a href="https://cocoapods.org/about#team">The CocoaPods Dev Team</a> with contributions from <a href="https://github.com/CocoaPods/Specs/graphs/contributors">many, many others</a>.</p><h4>Lovingly sponsored by</h4><p class="sponsors"><a href="http://artsy.net">Artsy</a>, <a href="http://www.usebutton.com">Button</a>, <a href="http://www.capitalone.io">Capital One</a>, <a href="https://circleci.com">CircleCI</a>, <a href="http://discontinuity.eu">Discontinuity</a>, <a href="https://www.emergetools.com">Emerge Tools</a>, <a href="http://www.fngtps.com">Fingertips</a>, <a href="https://developers.google.com">Google</a>, <a href="https://www.heroku.com">Heroku</a>, <a href="https://www.jsdelivr.com">jsDelivr</a>, <a href="https://realm.io">Realm</a>, <a href="https://pspdfkit.com/">PSPDFKit</a>, <a href="http://www.rubymotion.com">RubyMotion</a>, <a href="https://www.sauspiel.de">Sauspiel</a>, <a href="https://www.slack.com">Slack</a>, <a href="https://www.soundcloud.com">SoundCloud</a>, <a href="https://www.stripe.com">Stripe</a>, <a href="https://www.squareup.com">Square</a>, and <a href="http://www.technologyastronauts.ch">Technology&nbsp;Astronauts</a>.</p></article></div></section></footer><footer class="footer-links"><section class="container"><div class="row"><article class="col-md-8 col-lg-8 col-sm-12 col-md-offset-2 col-lg-offset-2 col-xs-12"><a class="cocoapods-small-logo" href="https://cocoapods.org"></a><ul><li class="col-md-3 col-sm-3 col-xs-6"><a href="https://guides.cocoapods.org/using/troubleshooting.html">Support</a></li><li class="col-md-3 col-sm-3 col-xs-6"><a href="https://github.com/CocoaPods/CocoaPods">GitHub Repo</a></li><li class="col-md-3 col-sm-3 col-xs-6"><a href="https://status.cocoapods.org">Web Properties Status</a></li><li class="col-md-3 col-sm-3 col-xs-6"><a href="https://twitter.com/CocoaPods">@CocoaPods</a></li><li class="col-md-3 col-sm-3 col-xs-6"><a href="http://groups.google.com/group/cocoapods">Mailing List</a></li><li class="col-md-3 col-sm-3 col-xs-6"><a href="https://cocoapods.org/about"><span class="visible-lg-span">CocoaPods</span> Dev Team</a></li><li class="col-md-3 col-sm-3 col-xs-6"><a href="https://guides.cocoapods.org/syntax/podfile.html">Podfile Doc<span class="hidden-lg-span">s</span><span class="visible-lg-span">umentation</span></a></li><li class="col-md-3 col-sm-3 col-xs-6"><a href="https://cocoapods.org/legal">Legal / Conduct</a></li></ul></article></div></section></footer></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10