Skip to content

Install TagLab

Paolo Cignoni edited this page Nov 14, 2024 · 73 revisions

Installing TagLab

First of all, clone the TagLab repository on your machine.

To do this, just click on the "Clone or Download" button at the top of the TagLab page on GitHub and unzip the whole package in a folder of your choice.

Windows

Before installing TagLab, make sure that you have installed a 64 bit version of Python 3.11, and a working NVIDIA driver.

IMPORTANT NOTE: Be sure to add Python to the PATH before exiting the setup (see the screenshot below).

You can check if Python is properly installed by running the following commands in a shell:

python --version

You can check if NVIDIA CUDA is properly installed by running the following commands in a shell:

nvidia-smi

If everything is working correctly something similar should appear:

image

If your CUDA version is older than 11.8, consider to upgrade your drivers!

You need also to install the Visual Studio Redistributable. Download them from this link.

Launch TagLab installer

  • Open a terminal (not a 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:
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 install the cpu version.

The standard installation includes two 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. So, if such hardware requirements are too much for your graphics board, you can run the installation without SAM launching the installation script with the NO-SAM option:

python.exe install.py no-sam

Linux

Under Linux, if you use a debian-based distribution (e.g. Ubuntu), except for python and NVIDIA CUDA driver, there are no other real requirements (note that AMD ROCm is supported on Linux): 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!

The next two steps are similar to the ones for Windows:

Launch TagLab installer

  • Open a terminal (not a 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

See the Windows instructions to install the version without the SAM network, that is demanding in terms of graphics hardware resources. See the MacOs install instructions on how to install the cpu version.

MacOS

On MacOS, the only real requirement (besides python 3.11) is the HomeBrew package manager: be sure to have it installed before running the TagLab 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.

The next two steps are similar to the ones for Windows:

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 cpu

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

  • Note that, Python versions older than 3.11 are not supported.

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