Giter Site home page Giter Site logo

amilc4r / sequential-stories Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amilcarotero/sequential-stories

0.0 0.0 0.0 52.06 MB

Using Tensorflow's im2txt model to generate stories in an iOS app.

Shell 0.12% JavaScript 4.47% C++ 3.60% Python 2.57% C 0.26% Objective-C 54.33% Java 22.13% C# 10.19% CSS 0.86% HTML 0.76% QML 0.35% Batchfile 0.34%

sequential-stories's Introduction

Sequential Stories

The Show and Tell model is a image-to-text model for Tensorflow, developed by Google DeepMind and based on this paper, that takes an input and learns how to describe the content of images. This experimental iOS app uses this feature to generate a series of captions and create a story.

Example using stills from the 'The Gran Budapest Hotel' by Wes Anderson:

demo

Setup

  1. Install im2txt and its dependencies. Follow Edouard Fouché setup and used the same pre trained model described in his instructions. The only change was that in line 49 in im2txt/im2txt/inference_utils/vocabulary.py I didn't change this:
reverse_vocab = [line.split()[0] for line in reverse_vocab] # to:
reverse_vocab = [eval(line.split()[0]).decode() for line in reverse_vocab]
  1. Download or clone this repo.
  2. Install the app located in platforms/ios in Xcode. You can also run cordova plaform add ios from the root and then cordova prepare ios and then upload. (Install Cordova first)
  3. Connect your phone to a Wifi network. Your computer should be connected to the same network.
  4. Open the file server_im2txt.py and change line 15: ip = '172.16.220.255' to match the ip assigned by the network. (To know your ip type ifconfig | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}' in OSX)
  5. Run python server_im2txt.py
  6. Open the app, and click the top left icon. Enter the same IP address from before. A green light should turn on the right top corner.

Running a MacBook Pro from 2014 it takes around 7 seconds to caption an image.

Dependencies:

  • Bazel
  • TensorFlow 1.0 or greater
  • NumPy
  • Natural Language Toolkit (NLTK)
  • Checkpoint

Versions

The file server_im2txt runs the im2txt model on every request from to the /upload route and returns a string with a sentence for the story. The app loads an image to the /upload folder.

The file server_lstm runs a classification model in keras and then a LSTM network trained on the 25 most download books from the Gutenberg Project. This was the first approach to the app and it's still a WIP.

Outputs

demo

Interaction

demo

Links

TODO

  • Configure IP from app.
  • Create Reacte Native version?
  • Add more nlp to the output or maybe add the lstm version to it?

sequential-stories's People

Contributors

cvalenzuela avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.