Skip to content

Install TagLab

Massimiliano Corsini edited this page Oct 22, 2024 · 73 revisions

Installing TagLab

Step 1: Dependencies

Before installing TagLab, make sure that you have installed a 64 bit version of Python 3.11, and NVIDIA CUDA Toolkit on Linux or Windows.

NVIDIA CUDA Toolkits can be downloaded at the following links:

IMPORTANT NOTE: When installing Python on Windows be sure to add it to the PATH and check the Disable PATH Limit Length before exiting the setup (see the screenshots below, they are about Python 3.8 but the options are the same for Python 3.11).

You can check if Python and CUDA are properly installed by running the following commands in a shell (bash on Linux, poweshell on Windows; for MacOS just check the Python version):

python3 --version
nvcc --version

If python and cuda are properly installed, both commands will print their versions.

Windows

Under Windows, you need also to install the Visual Studio Redistributable. Download them from this link.

Linux

Under Linux, if you use a debian-based distribution (e.g. Ubuntu), except for python and nvcc, there are no other real requirements: the TagLab installer will take care of get and install all the dependencies. If you do not use the APT package manager (not ubuntu or debian derived distros), you'll need to install manually the GDAL library (the command gdal-config --version should output the gdal library version), and cmake. Check out for your distribution how to install these two packages!

MacOS

On MacOS, the only real requirement (besides python) is the HomeBrew package manager: be sure to have it installed before running the installer. You can check here the instructions on how to install it. If you don't want to install the HomeBrew package manager, be sure to install the gdal library manually (the command gdal-config --version should output the gdal library version), and cmake. Take care that on MacOS the GPU accelerated version is not available, at the moment.

Step 2: Clone the repository

Just click on the "Clone or Download" button at the top of this page and unzip the whole package in a folder of your choice.

Step 3: Launch TagLab installer

  • open a terminal (not python prompt!);
  • change directory to the TagLab main directory: type cd (be sure to type the space after cd) and then drag and drop into the terminal the TagLab folder; then click enter;
  • type the following command in the terminal:
python3 install.py

or, on Windows:

python.exe install.py

The install.py script will automatically install the remaining libraries required by TagLab and download the network weights used in the interactive AI-based segmentation tools. If NVIDIA CUDA Toolkit is not supported by your machine, the script will ask to install the cpu version. If you launch the script with the SAM option, the installation will include two additional segmentation tools based on the Segment Anything (SAM) network (more information on the official GitHub page here). These latter tools requires at least 8 GB of GPU RAM to work properly.

python.exe install.py SAM

If your machine does not support the NVIDIA CUDA Toolkit, you can install the cpu version of TagLab with the following command:

python3 install.py cpu

or, on Windows:

python.exe install.py cpu

Step 4: Run

Just start TagLab.py from a command shell or your preferred Python IDE.

From a terminal simply write:

python3 TagLab.py

or, on Windows:

python.exe taglab.py

To test if TagLab works correctly, try to open the sample project available in the projects folder.

Known problems and how to solve them

  • The update of the 7th of October 2022 introduce a dependency from pycocotools to export dataset in COCO format. After this update you need to install Microsoft Visual C++ Build Tools from this link link (for Windows) and re-run install.py (for all systems).

  • If PyQt not work properly under WIndows (e.g. import problems when TagLab is launched) perhaps the Microsoft Visual C++ Redistributable is not installed on your machine. Download and install it using this link .

  • Note that, the versions of Python older than 3.11 are no more supported.

Clone this wiki locally