How To Install lua-torch-image on Ubuntu 18.04

In this tutorial we learn how to install lua-torch-image on Ubuntu 18.04. lua-torch-image is Image Load/Save Library for Torch Framework

Introduction

In this tutorial we learn how to install lua-torch-image on Ubuntu 18.04.

What is lua-torch-image

lua-torch-image is:

“image” is the Torch7 distribution package for processing images. It contains a wide variety of functions divided into the following categories:

  • Saving and loading images as JPEG, PNG, PPM and PGM;
  • Simple transformations like translation, scaling and rotation;
  • Parameterized transformations like convolutions and warping;
  • Simple Drawing Routines like drawing text or a rectangle on an image;
  • Graphical user interfaces like display and window;
  • Color Space Conversions from and to RGB, YUV, Lab, and HSL;
  • Tensor Constructors for creating Lenna, Fabio and Gaussian and Laplacian kernels;

Note that unless specified otherwise, this package deals with images of size nChannel x height x width.

There are three methods to install lua-torch-image on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install lua-torch-image Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install lua-torch-image using apt-get by running the following command:

sudo apt-get -y install lua-torch-image

Install lua-torch-image Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install lua-torch-image using apt by running the following command:

sudo apt -y install lua-torch-image

Install lua-torch-image Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install lua-torch-image using aptitude by running the following command:

sudo aptitude -y install lua-torch-image

How To Uninstall lua-torch-image on Ubuntu 18.04

To uninstall only the lua-torch-image package we can use the following command:

sudo apt-get remove lua-torch-image

Uninstall lua-torch-image And Its Dependencies

To uninstall lua-torch-image and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove lua-torch-image

Remove lua-torch-image Configurations and Data

To remove lua-torch-image configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge lua-torch-image

Remove lua-torch-image configuration, data, and all of its dependencies

We can use the following command to remove lua-torch-image configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge lua-torch-image

References

Summary

In this tutorial we learn how to install lua-torch-image package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.