NVIDIA/torch-android

Name: torch-android

Owner: NVIDIA Corporation

Description: Torch-7 for Android

Forked from: soumith/torch-android

Created: 2016-08-15 23:08:32.0

Updated: 2017-05-26 08:28:17.0

Pushed: 2017-01-26 09:49:23.0

Homepage: null

Size: 46331

Language: CMake

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Torch-7 for Android

Torch7 provides a Matlab-like environment for state-of-the-art machine learning algorithms. It is easy to use and provides a very efficient implementation, thanks to an easy and fast scripting language (Lua) and a underlying C implementation.

Modified to be compiled and used with Android

Features

torch.load now takes three additional modes: apkbinary32, apkbinary64, apkascii. One can store model files in the assets folder and use these modes to load them. If the model was saved on a 64-bit machine, use apkbinary64, if it was saved on a 32-bit machine, use apkbinary32.

Requirements

For CUDA-enabled version: NVIDIA CodeWorks for Android: https://developer.nvidia.com/codeworks-android.

For CPU-only version : Android NDK (13b) and Android SDK

Samples
Building Torch Libraries and Java class.

If on ubuntu, install the following packages: sudo apt-get install libx32gcc-4.8-dev libc6-dev-i386 Default is to build with CUDA - so make sure you installed NVIDIA CodeWorks for Android and its nvcc is in your PATH. Otherwise, set WITH_CUDA=OFF in build.sh

  1. git submodule update –init –recursive
  2. Optionally, open build.sh and modify ARCH (to match your device architecture) and WITH_CUDA variables.
  3. run build script: 3 ./build.sh

You can use torch in your android apps. The relevant directories are

Building Android Demo App
  1. Build Torch-Android atleast once using the steps above.
  2. [Optional] Connect your android phone in debugging mode,
          to automatically install the apk.
    
  3. Change directory into demos/android-demo folder.
  4. Run build script. $ ./build.sh
  5. Run the app TorchDemo on your phone.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.