Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Real Time Object Detection application on iOS using Tensorflow and pre-trained COCO dataset models. Video frames are captured and inference is done locally using the provided mobilenet models. Both Swift and Objective-C projects.

License

NotificationsYou must be signed in to change notification settings

csharpseattle/tensorflowiOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Object Detection application on iOS using Tensorflow and pre-trained COCO dataset models. Video frames are captured and inference is done locally using one of the 3 provided models: ssd_mobilenet_v1_coco, ssd_modelnet_v2_coco, or ssd_inception_v2_coco. Both Swift and Objective-C projects.

cat image

Building

  • Make sure you have automake and libtool. Using homebrew:

brew install automake libtool

  • Clone the tensorflow source repo on GitHub

git clone https://github.com/tensorflow/tensorflow

  • cd into the tensorflow repo and at a minimum checkout thev1.5.0 tag. The v1.5.0 release has the Makefile support for the followingANDROID_TYPES environment variable. I have tested up tov1.12.0

git checkout origin/r1.11

if you run into this issue:thread-local storage is not supported for the current target, you may need to edit the two files affected. The following one-liners worked for me:

gsed '/ifeq[^,]*,I386)/!b;n;n;n;n;n;s/thread_local//' < ./tensorflow/contrib/makefile/Makefile > foo; mv foo ./tensorflow/contrib/makefile/Makefile

gsed 's/thread_local int per_thread_max_parallism/__thread int per_thread_max_parallism/' < tensorflow/core/util/work_sharder.cc > foo; mv foo ./tensorflow/core/util/work_sharder.cc

You can getgsed using homebrew:brew install gnu-sed

  • We need to build the tensorflow components with ANDROID_TYPES_FULL. In the terminal type:

export ANDROID_TYPES="-D__ANDROID_TYPES_FULL__"

  • Build the tensorflow libraries for iOS. Go to the root of your newly downloaded tensorflow repo and run:

tensorflow/contrib/makefile/build_all_ios.sh

Go get a coffee. This can take a while. On my macBook it took almost 2 hours.

  • Open either the Swift or Objective-C project in this repo and edit thetensorflow.xconfig file to point to the folder where you cloned the tensorflow repo

TENSORFLOW_ROOT=/Users/username/Development/tensorflow

  • Compile the xcode project and run. Since we need a camera this will only run on a device.

About

A Real Time Object Detection application on iOS using Tensorflow and pre-trained COCO dataset models. Video frames are captured and inference is done locally using the provided mobilenet models. Both Swift and Objective-C projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp