• Stars
    star
    125
  • Rank 284,676 (Top 6 %)
  • Language
    Swift
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Trains a model, then generates a complete Xcode project that uses it - no code necessary

In three clicks, make an iPhone app that runs image recognition on every video frame coming live from the camera

This app will create an iPhone app that uses Tensorflow image recognition, trained on your own images. You can make a trail mix calorie counter, a skin cancer detector, a cat in sofa detector, a cake recognizer, or whatever you can come up with.

Prepare

  • Install Xcode 8 or higher
  • Install Docker
  • Install Git
  • Make sure Docker and git are running
  • To make training faster, open Docker Preferences > Advanced, and increase CPUs and memory

Prepare your images and videos

  • Start Trainer
  • Click Browse
  • You can train your model with both images and videos
  • To train with images, go to images/originals
  • Create a new folder named after the object you want the app to recognize, e.g. "burgers"
  • Put pictures of burgers into the burgers folder
  • To train with videos, go to videos
  • Add your videos. Rename the video files e.g. burgers1.mov, burgers2.mov, etc

Start training

  • Click Start Training. The first training session will take about 30 minutes, depending on how many videos and images you have.

Make your app

  • Click the Xcode icon. Creating your app will take about 45 minutes.
  • Go to ~/projects/tf_files/tensorswift_ios/tensorswift
  • Open the xcode project and open Config.swift
  • Add your labels and which web page the app should open when it recognizes them

Add images to your model

  • Add the images to images/originals and videos
  • Click Start Training
  • In Xcode's left hand file panel, delete the files in the folder 'model'
  • Click Reveal model files and drag the files into the model folder in Xcode

Next steps

Feel free to grab one of these, or get in touch about any of them:

  • Optimize the model for inference
  • quantisize_graph for smaller model file size
  • Show Tensorboard vital stats directly in the app
  • Add UI for hyperparameters
  • Fix reset - it doesn't seem to do anything. Should remove bottlenecks and resize logs
  • Make it more clear how to retrain the model

More Repositories

1

androidtool-mac

One-click screenshots, video recordings, app installation for iOS and Android
Swift
5,429
star
2

cleartext-mac

A text editor that will help you write clearer and simpler
Swift
3,281
star
3

droptogif

Zero-click animated Gifs
Swift
2,695
star
4

native-diffusion

Native Stable Diffusion inference on iOS / macOS using MPSGraph
Swift
496
star
5

PocketCastsOSX

An unoffical OSX wrapper for Pocketcasts
Objective-C
343
star
6

awesome-conversational

179
star
7

webster-mac

XSLT
80
star
8

tensorswift-ios

Using Tensorflow from Swift
Swift
43
star
9

simpler-thesaurus

A thesaurus that only returns words that are among the 1,000 most used in English
Swift
36
star
10

SwiftUIWindow

Swift
28
star
11

ar-currency-converter-ios

Swift
27
star
12

photometer

Use the iPhone camera to measure time and distances
Swift
25
star
13

springdamping

Realtime experimentation with duration, spring and damping for UIView animations
Swift
18
star
14

Scrollshape

Swift
17
star
15

find-for-kindle

Swift
13
star
16

VideoToggle-SwiftUI

A ToggleStyle for SwiftUI that shows live streaming video
Swift
11
star
17

CodeHighlighter

A SwiftUI view for code syntax highlighting
Swift
11
star
18

podcasts-androidtv

Podcast client for Android TV
Java
11
star
19

Blurhash-macos

Swift
9
star
20

simplify-gmail-safari

JavaScript
9
star
21

image-retrainer-tensorflow

Train Tensorflow model with videos
Shell
7
star
22

skins-wear

Better looking emulator skins for your Wear demos
7
star
23

freewriter-mac

Swift
7
star
24

milliseconds

Simple milliseconds timer for UX designers
Swift
6
star
25

ballpit-mac

A physics playground for spicing up slide decks
Swift
5
star
26

trajectoryclock-wear

A watch face that shows when you'll be home if you leave now
Java
5
star
27

trump-keyboard

Swift
5
star
28

wifirobot

The robot remembers to turn your wifi back on
Java
5
star
29

one-button

What if your tv remote control had only one button?
Java
5
star
30

push-play-ios

A simple radio player for my bathroom that is controlled by gently pushing the entire device
Swift
4
star
31

timeline

3
star
32

notification-maker-android

Notification spoofing for UI designers and testers
Java
3
star
33

twinjack-mac

Swift
3
star
34

subtimeline

Read an entire movie in real time on your wrist
Swift
3
star
35

functional-markdown-vscode

JavaScript
2
star
36

TimeSlider

Swift
2
star
37

JSO

One-liner JSON calls for Swift
Swift
2
star
38

popground-mac

Experiment in real-time with Facebook POP animations
Swift
2
star
39

casthunt

Product Hunt's Podcast category as a Podcast feed
PHP
2
star
40

scroll-video-nextjs-ts-tw

TypeScript
2
star
41

TextFlow

Automator workflows for text manipulation in any OS X text control
2
star
42

Capture-device

Swift
1
star
43

ar-kitchen-timer

Swift
1
star
44

run-game

Run game
JavaScript
1
star
45

ar-book-wrapper

Swift
1
star
46

twinjack-hybrid

Swift
1
star
47

nocturnal-traffic

Visualization of live traffic on highway 101
Swift
1
star
48

layerfiller-sketch

Quickly add a bunch of different designs to a bunch of different device frames
1
star
49

MJPOPAnim

One-line Facebook POP layer animations
Swift
1
star
50

Device-Recording-Bug-Demo

Swift
1
star
51

bemyeyes-website

The website
JavaScript
1
star
52

hevc-with-alpha

Swift
1
star
53

huestone

Huestone, we have a problem
Java
1
star
54

mortenjust-blog

1
star