Git Product home page Git Product logo

luawrapper's Introduction

LuaWrapper

C++ API for easy communication with Lua/Torch. Allow to launch torch networks and Lua scripts from C++ code. See lua_wrap.hpp and tensor_base.hpp for the API and main.cpp for some examples.

Contrary to some other existing higher level libraries, where the Lua calls are presented as string and executed as Lua code, here the functions directly call the Lua C API, so there is no compromise on performance. The drawback is that the user still has sometimes to deals with the Lua stack which offers him more control, but also more responsibilities.

The program require a standard Torch installation, and OpenCv to easily convert an image to Torch. To build, as usual:

mkdir build/
cd build
cmake ..
make

Then, to use the library, just include lua_wrap.hpp (present in the include/ folder) and link the generated lib/liblua_wrap.so. After compilation, the example present in the build/ folder can be launched with ./a.out.

LuaWrap can be used in two main modes:

  • By directly loading and executing a Torch model (.t7) directly from the C++ code. No Lua script is required. This is used when there is no complex interaction between models and we just want to perform a forward pass on an image or data.
  • By interfacing some Lua scripts with the C++ program. This allows more complex interactions. One use case for instance is to quickly integrate existing Torch repositories within the C++ program without having to reprogram all the data loading, image pre-processing and so on.

Of course, you can use both ways within the same program.

luawrapper's People

Contributors

conchylicultor avatar

Watchers

 avatar  avatar  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.