All Projects → RobertBiehl → caffe2-ios

RobertBiehl / caffe2-ios

Licence: Apache-2.0 License
☕️ Caffe2Kit. A simple one step integration of Caffe2 for iOS.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
CMake
9771 projects
Objective-C++
1391 projects
shell
77523 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to caffe2-ios

Caffe2
Caffe2 is a lightweight, modular, and scalable deep learning framework.
Stars: ✭ 8,409 (+12086.96%)
Mutual labels:  caffe2
realcaffe2
The repo is obsolete. Use at your own risk.
Stars: ✭ 12 (-82.61%)
Mutual labels:  caffe2
AICamera new
Recompile the library with caffe2 in pytorch stable(1.0) and re-implement the AICamera example provided by caffe2 officially.
Stars: ✭ 33 (-52.17%)
Mutual labels:  caffe2
Deep Dream In Pytorch
Pytorch implementation of the DeepDream computer vision algorithm
Stars: ✭ 90 (+30.43%)
Mutual labels:  caffe2
Netron
Visualizer for neural network, deep learning, and machine learning models
Stars: ✭ 17,193 (+24817.39%)
Mutual labels:  caffe2
Caffe2-C-demo
Show how to use Caffe2 in C++ through a simple LeNet sample project
Stars: ✭ 60 (-13.04%)
Mutual labels:  caffe2
Test Tube
Python library to easily log experiments and parallelize hyperparameter search for neural networks
Stars: ✭ 663 (+860.87%)
Mutual labels:  caffe2
caffe2-yolo
Bridging caffe2 with yolo, esp on mobile devices
Stars: ✭ 18 (-73.91%)
Mutual labels:  caffe2
Caffe2 Ios
Caffe2 on iOS Real-time Demo. Test with Your Own Model and Photos.
Stars: ✭ 221 (+220.29%)
Mutual labels:  caffe2
Caffe2-yolo-v3
A Caffe2 implementation of the YOLO v3 object detection algorithm
Stars: ✭ 32 (-53.62%)
Mutual labels:  caffe2
Ngraph
nGraph has moved to OpenVINO
Stars: ✭ 1,322 (+1815.94%)
Mutual labels:  caffe2
Onnx Caffe2
Caffe2 implementation of Open Neural Network Exchange (ONNX)
Stars: ✭ 164 (+137.68%)
Mutual labels:  caffe2
pytorch-android
[EXPERIMENTAL] Demo of using PyTorch 1.0 inside an Android app. Test with your own deep neural network such as ResNet18/SqueezeNet/MobileNet v2 and a phone camera.
Stars: ✭ 105 (+52.17%)
Mutual labels:  caffe2
Gen Efficientnet Pytorch
Pretrained EfficientNet, EfficientNet-Lite, MixNet, MobileNetV3 / V2, MNASNet A1 and B1, FBNet, Single-Path NAS
Stars: ✭ 1,275 (+1747.83%)
Mutual labels:  caffe2
DLInfBench
CNN model inference benchmarks for some popular deep learning frameworks
Stars: ✭ 51 (-26.09%)
Mutual labels:  caffe2
Deepo
Setup and customize deep learning environment in seconds.
Stars: ✭ 6,145 (+8805.8%)
Mutual labels:  caffe2
Image2LMDB
Convert image folder to lmdb, adapted from Efficient-PyTorch
Stars: ✭ 58 (-15.94%)
Mutual labels:  caffe2
c2board
Tensorboard for Caffe2
Stars: ✭ 32 (-53.62%)
Mutual labels:  caffe2
OpenCvSharpDNN
Implementation of YoloV3 and Caffe in OpenCvSharp
Stars: ✭ 20 (-71.01%)
Mutual labels:  caffe2
pedestrian recognition
A simple human recognition api for re-ID usage, power by paper https://arxiv.org/abs/1703.07737
Stars: ✭ 29 (-57.97%)
Mutual labels:  caffe2

☕️ Caffe2Kit

Caffe2 for iOS. A simple integration into existing projects.

Caffe2Kit - Simple integration of Caffe2 on iOS.

Twitter Caffe2 Req

🚨 Attention

Please note that this pod is in a very early stage and currently has multiple shortcomings:

  • Not officially on CocoaPods yet!
  • Only runs on iOS 10.3! -- should be fixed soon by udating the build_ios_pod.sh build script
  • Wrapper currently only supports classification tasks.

📲 Installation

Caffe2Kit is will soon be available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Caffe2Kit', :git => 'git://github.com/RobertBiehl/caffe2-ios'

and run pod install.

Disable Bitcode

Since caffe2 is not yet built with bitcode support you need to add this to your Podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

and disable bitcode for your Target by setting Build Settings -> Enable Bitcode to No.

Additional steps:

These steps will hopefully be removed in later versions.

  1. in Build Phases -> Your Target -> Link Binary with Libraries add libstdc++.tdb.
  2. in Build Settings -> Other Linker Flags remove $(inherited)and -force_load "$(PODS_ROOT)/Caffe2Kit/install/lib/libCaffe2_CPU.a"

🚀 Using Caffe2Kit

import Caffe2Kit

do {
  let caffe = try Caffe2(initNetNamed: "squeeze_init_net", predictNetNamed:"squeeze_predict_net")
  let 🌅 = #imageLiteral(resourceName: "lion.png")

  if let res = self.caffe?.prediction(regarding:🌅) {
  // find top 5 classes
  let sorted = res
    .map{$0.floatValue}
    .enumerated()
    .sorted(by: {$0.element > $1.element})[0...5]

  // generate output
  let text = sorted
    .map{"\($0.offset): \(classes[$0.offset]) \($0.element*100)%"}
    .joined(separator: "\n")

  print("Result\n \(text)")
} catch _ {
  // model could not be loaded
}

Result:

291: 🦁 lion, king of beasts, Panthera leo 100.0%
373: 🐒 macaque 3.59472e-08%
231: 🐕 collie 4.77662e-09%
374: 🐒 langur 1.63787e-09%
371: 🐒 patas, hussar monkey, Erythrocebus patas 5.34424e-10%
259: 🐶 Pomeranian 2.12385e-10%

Performance

Prediciting the class in the example app examples/Caffe2Test takes approx, 2ms on an iPhone 7 Plus and 6ms on an iPhone 6.

Requirements

Deployment target of your App is >= iOS 10.3

🤖 Author(s)

Robert Biehl, [email protected]

📄 License

Caffe2Kit is available under the Apache License 2.0. See the LICENSE file for more info.

Caffe2 is released under the BSD 2-Clause license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].