TagLab: an image segmentation tool oriented to marine data analysis

Overview

TagLab: an image segmentation tool oriented to marine data analysis

TagLab was created to support the activity of annotation and extraction of statistical data from ortho-maps of benthic communities. The tool includes different types of CNN-based segmentation networks specially trained for agnostic (relative only to contours) or semantic (also related to species) recognition of corals. TagLab is an ongoing project of the Visual Computing Lab http://vcg.isti.cnr.it/.

ScreenShot

Interaction

TagLab allows to :

  • zoom and navigate a large map using (zoom/mouse wheel, pan/'Move' tool selected + left button). With every other tool selected the pan is activated with ctrl + left button
  • segment coral instances in a semi-automatic way by simply clicks at the corals' extremes. This is achieved using the Deep Extreme Cut network fine-tuned on coral images. Deep Extreme Cut original code : https://github.com/scaelles/DEXTR-PyTorch/
  • assign a class with the 'Assign class' tool. Area and perimeter are now displayed in the segmentation info panel on the right
  • simultaneously turn off the visibility of one or more classes, (ctrl + left button/disable all but the selected, shift + left button, inverse operation), change the class transparency using the above slider
  • perform boolean operations between existing labels (right button to open the menu)
  • refine the incorrect borders automatically with the Refine operation or manually with the 'Edit Border' tool
  • tracking coral changes in different time intervals
  • import depth information of the seafloor
  • import GeoTiff
  • draw coral internal cracks with the 'Create Crack' tool
  • make freehand measurements or measure the distance between centroids (Ruler tool).
  • save the annotations (as polygons) and import them into a new project
  • export a CSV file table containing the data of each coral colony
  • export a JPG file of a black background with totally opaque labels
  • export shapefiles
  • export a new dataset and train your network (!)

We are working hard to create a web site with detailed instructions about TagLab. Stay tuned(!)

Supported Platforms and Requirements

TagLab runs on Linux, Windows, and MacOS. To run TagLab, the main requirement is just Python 3.6.x or 3.7.x.

GPU accelerated computations are not supported on MacOS and on any machine that has not an NVIDIA graphics card. To use them, you'll need to install the NVIDIA CUDA Toolkit, versions 9.2, 10.1 or 10.2 are supported. If you don't have a NVida graphics card (or if you use MacOS), CPU will be used.

Installing TagLab

Step 0: Dependencies

Before installing TagLab, be sure to have installed Python 3.6.x or 3.7.x, and NVIDIA CUDA Toolkit if it is supported. You can check if they are properly installed by running the following commands in a shell (bash on Linux, poweshell on Windows):

python3 --version
nvcc --version

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

Under Linux, if you don't use the APT package manager (not ubuntu or debian derived distros), be sure to install the gdal library manually (the command gdal-config --version should output the gdal library version). Under MacOS, if you don't use HomeBrew package manager, be sure to install the gdal library manually (the command gdal-config --version should output the gdal library version).

Under MacOS and Linux, also cmake and a C++ compiler must be installed.

Step 1: 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 2: Install all the dependencies

Then, open a shell (not python prompt!), change directory to the TagLab main directory and run:

python3 install.py

or, on Windows:

python.exe install.py

The script will automatically install the remaining libraries required by TagLab and download the network weights. If NVIDIA CUDA Toolkit is not supported by your machine, the script will ask to install the cpu version. You can bypass this step and force to install the cpu version directly by running

python3 install.py cpu

or, on Windows:

python.exe install.py cpu

Step 3: Run

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

From a command shell 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.

Updating TagLab

If you already installed TagLab and you need to update to a new version, you can just run the update.py script:

python3 update.py

or, on Windows:

python.exe update.py

The script will automatically update TagLab to the newest version available in this repository.

Updating from 0.2

If you are updating TagLab from 0.2 version, in order to download also the new networks, please run the update.py script twice:

python3 update.py
python3 update.py
Comments
  • Windows DLL Load Failure

    Windows DLL Load Failure

    I am trying to run TagLab on a brand new installation of Windows 10 running Python 3.7.9 and CUDA 10.2. I have tried removing an reinstalling all packages to no avail. Install.py runs fine. When running TagLab.py I get:

    Traceback (most recent call last): File "TagLab.py", line 34, in from PyQt5.QtCore import Qt, QSize, QMargins, QDir, QPoint, QPointF, QRectF, QTimer, pyqtSlot, pyqtSignal, QSettings, QFileInfo, QModelIndex ImportError: DLL load failed: The specified module could not be found.

    I have tried separately install PyQt5 and have tried version 5.15.7 as well as 5.15.6. I can find the .dll files for PyQt5 and have added their location to my PCs path, but I still get the DLL load failure.

    Thank you, Chris

    opened by such-chris 7
  • No module named 'pycocotools' after UPDATE

    No module named 'pycocotools' after UPDATE

    After the update, cannot open TagLab again and it shows up:

    Traceback (most recent call last): File "taglab.py", line 78, in from source.NewDataset import NewDataset File "C:\Users\user\OneDrive\Documents\TagLab-main\source\NewDataset.py", line 20, in from pycocotools import mask as maskcoco ModuleNotFoundError: No module named 'pycocotools'

    Did anyone found this happening also? How can I solve this problem?

    opened by ihuanh 6
  • Automatic classification crashes with Classifier Widget error

    Automatic classification crashes with Classifier Widget error

    I am trying to train a classifier for my images. I was able to export a training data set, but when I clicked on the robot to select my classifier the program crashed with the error below. Seems like there's a problem displaying the QtClassifierWidget due to missing keys.

    Traceback (most recent call last):
      File "taglab.py", line 4420, in selectClassifier
        self.classifierWidget = QtClassifierWidget(self.available_classifiers, parent=self)
      File "C:\Program Files\TagLab-main\source\QtClassifierWidget.py", line 82, in __init__
        self.editClasses = QLineEdit(self.classes2str(classifiers[0]["Classes"]))
      File "C:\Program Files\TagLab-main\source\QtClassifierWidget.py", line 329, in classes2str
        for key in classes_dict.keys():
    AttributeError: 'list' object has no attribute 'keys'
    
    opened by mlopezp 4
  • Runtime Error: QPixmap

    Runtime Error: QPixmap

    Hello,

    I have been having trouble running TagLab today even though I have previously opened it before. I have uninstalled and reinstalled all the packages on my computer and in different Python environments. I have included the entire error message below. Is there anything I can do to get around this and run the program?

    Thanks.

    Traceback (most recent call last):
      File "/Users/jshao/Desktop/TagLab-main/TagLab.py", line 4578, in <module>
        tool = TagLab()
      File "/Users/jshao/Desktop/TagLab-main/TagLab.py", line 287, in __init__
        self.viewerplus = QtImageViewerPlus(self.taglab_dir)
      File "/Users/jshao/Desktop/TagLab-main/source/QtImageViewerPlus.py", line 128, in __init__
        self.tools = Tools(self)
      File "/Users/jshao/Desktop/TagLab-main/source/Tools.py", line 34, in __init__
        self.scribbles = Scribbles(self.scene)
      File "/Users/jshao/Desktop/TagLab-main/source/tools/Scribbles.py", line 32, in __init__
        self.setCustomCursor()
      File "/Users/jshao/Desktop/TagLab-main/source/tools/Scribbles.py", line 47, in setCustomCursor
        pxmap = QPixmap(cursor_size, cursor_size)
    TypeError: arguments did not match any overloaded call:
      QPixmap(): too many arguments
      QPixmap(int, int): argument 1 has unexpected type 'float'
      QPixmap(QSize): argument 1 has unexpected type 'float'
      QPixmap(str, format: str = None, flags: Union[Qt.ImageConversionFlags, Qt.ImageConversionFlag] = Qt.ImageConversionFlag.AutoColor): argument 1 has unexpected type 'float'
      QPixmap(List[str]): argument 1 has unexpected type 'float'
      QPixmap(QPixmap): argument 1 has unexpected type 'float'
      QPixmap(Any): too many arguments
    
    opened by jjshao 4
  • Error with requirement wheel

    Error with requirement wheel

    Hi! I'm working on some intertidal/underwater imagery at Universite Laval and have been having issues getting TagLab to run. I'm running it on Ubuntu 20.04.2 (downloaded on Windows 10) with Python 3.7.5 and NVCC 10.1. I'm running into issues with install.py where I cannot install wheel. But if I run pip3 install wheel, wheel is successfully installed. I'm wondering if it's a problem with my own system because I also have Python 3.8.5 installed but have Python 3.7.5 installed over it in a virtual environment and am running install.py with python3.7 install.py I just thought I would reach out and see if you guys had any insights to what was happening, thanks!

    Found NVCC version: 10.1
    Torch for CUDA 10.1
    GDAL version installed: 3.0.4
    Coraline built correctly.
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Collecting wheel
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/wheel/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/wheel/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/wheel/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/wheel/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/wheel/
      Could not fetch URL https://pypi.org/simple/wheel/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/wheel/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
      ERROR: Could not find a version that satisfies the requirement wheel (from versions: none)
    ERROR: No matching distribution found for wheel
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    Traceback (most recent call last):
      File "install.py", line 164, in <module>
        subprocess.check_call([sys.executable, "-m", "pip", "install", package])
      File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/local/bin/python3.7', '-m', 'pip', 'install', 'wheel']' returned non-zero exit status 1.
    
    opened by jjshao 3
  • Issues with Shapely? I got you.

    Issues with Shapely? I got you.

    If you run into an issue with Shapely after downloading and installing all of the requirements, uninstall the version of Shapely that you installed with the other packages using pip. Then install it with conda instead. If everything else installed correctly, you should be good.

    Cheers.

    opened by JordanMakesMaps 3
  • install script on M1 Mac hangups

    install script on M1 Mac hangups

    Just got through the install script on an M1 Macbook and had to manually install a few of the items, as well as run in rosetta. The most glaring problem I ran into was line 232 of the install script...

    # torch and torchvision subprocess.check_call([sys.executable, "-m", "pip", "install", torch_package, torchvision_package, 'torch_extra_argument1', 'torch_extra_argument2'])

    I got an invalid argument '' error during the install. So I guess these variables aren't being assigned values for me. Since the M1 requires running the install in cpu mode I copy pasted the following parameters in place of the torch_extra_argument variables and finally got through this line.

    "--extra-index-url", "https://download.pytorch.org/whl/cpu"

    opened by kidconcept 2
  • 4-click and Positive/Negative segmentation not working since v2022.02.24

    4-click and Positive/Negative segmentation not working since v2022.02.24

    After updating from TagLab v2022.02.13 to TagLab v2022.02.24 the click based segmentation stopped working. GUI still switches between tools but no segmentation is performed. Also tested with currently latest version TagLab v2022.02.25, with same behaviour. Fixed by just rolling back to the previously working version.

    Please let me know if you need more build/system info.

    opened by cappelletto 2
  • Error importing label images

    Error importing label images

    Before using TagLab we were manually tracing colonies using photoshop. I was testing importing these label images into TagLab so we don’t have to redo the work that we have already done, and possibly use these to create the training set for our monitoring sites. I have tried exporting the image labels as both png and jpg but the program crashes with error:

    File "TagLab.py", line 3168, in importLabelMap
        created_blobs = self.activeviewer.annotations.import_label_map(filename, self.project.labels, self.activeviewer.img_map.width(),
      File "C:\Program Files\TagLab-main\source\Annotation.py", line 495, in import_label_map
        c = label.fill
    AttributeError: 'str' object has no attribute ‘fill'
    

    TagLab: 0.7 Windows: 10 Enterprise Python: 3.8.10 nvcc: 11.3.58

    opened by mlopezp 2
  • GUI not recognizing mouse

    GUI not recognizing mouse

    Hello. I'm a coral ecologist at the Hawaii Institute of Marine Biology trying out the TagLab project. I have managed to install the everything on my Mac, and it runs. However:

    1. the GUI doesn't appear until I do something with the file menu (like "Load Map"); and
    2. once the GUI appears I can click between text inputs, but I can't click buttons (e.g., "Cancel"), so I'm kind of stuck...

    Notes: I have python 3.7.7 installed. In addition to your installation instructions, I had to install "albumentations" and a (seemingly known) Qt issue preventing the GUI to start meant that I had to take "opencv-python" back to version 4.1.2.30.

    opened by jmadin 2
  • Fix #24 Quickfix by inspecting for potentially empty objects

    Fix #24 Quickfix by inspecting for potentially empty objects

    Right Click -> Select All in the Note edit box was triggering an error as it was notifying about a change on a non-existing object. A quickfix is to inspect activeviewer object in noteChanged(self) before querying for number of selected objects. If the object is empty (None) the just return

    opened by cappelletto 1
  • Installation issue: AttributeError: module 'numpy' has no attribute 'int'

    Installation issue: AttributeError: module 'numpy' has no attribute 'int'

    Another installation issue found.

    Installation success, update for double check success. However after running the Taglab for the first time, the following comes out:

    TagLab 2022.11.3 Traceback (most recent call last): File "taglab.py", line 4704, in tool = TagLab() File "taglab.py", line 437, in init self.labels_widget.setLabels(self.project, None) File "...source\QtTableLabel.py", line 240, in setLabels self.data = project.create_labels_table(self.activeImg) File "...source\Project.py", line 492, in create_labels_table 'Visibility': np.zeros(len(self.labels), dtype=np.int), File "...AppData\Local\Programs\Python\Python38\lib\site-packages\numpy_init_.py", line 284, in getattr raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'int'

    Window 11 Python 3.8.0 NVCC 11.6

    Anyway I can fix this issue?

    opened by ihuanh 4
  • Entering custom values in a new dictionary displays alert after every keystroke

    Entering custom values in a new dictionary displays alert after every keystroke

    Hi, I was creating a new dictionary for our lab and whenever I click into the boxes to define the RGB colors it displays an alert: "Please enter a number between 0 and 255". While a tooltip is helpful in this case, something is triggering it way too often making it hard to enter the data this way.

    opened by mlopezp 1
  • Training Auto-segmentation

    Training Auto-segmentation

    Hi,

    I can no longer train a network. The error is in the picture below. I apologise for all the issues I'm posting but I am a PhD student and this program is meant to help me with some significant data analysis. Sometimes the training gets further sometimes it's shorter and sometimes it just doesn't work altogether. I would really appreciate the help.

    Thanks, Chris

    Capture

    opened by Chris-Cooney 6
  • 4-click segmentation

    4-click segmentation

    Hi there,

    After the most recent update the 4- clicks segmentation has stopped working for me. I have attempted to reinstall taglab and sadly it hasn't solved the issue. The error code is what is shown in the terminal before python stops working.

    Thanks, Chris

    Capture

    opened by Chris-Cooney 0
  • Question: Docker container in the works?

    Question: Docker container in the works?

    Hello! Really interested in using TagLab, it looks great!

    I was wondering if there are any plans to develop a Docker File for running TagLab, and then just exposing the GUI from within a running Docker container? This might help with installation issues for users using different environments.

    opened by Jordan-Pierce 1
Releases(v2022.11.3)
Owner
Visual Computing Lab - ISTI - CNR
Visual Computing Lab - ISTI - CNR
The trained model and denoising example for paper : Cardiopulmonary Auscultation Enhancement with a Two-Stage Noise Cancellation Approach

The trained model and denoising example for paper : Cardiopulmonary Auscultation Enhancement with a Two-Stage Noise Cancellation Approach

ycj_project 1 Jan 18, 2022
This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Information Maximization for Multimodal Sentiment Analysis, accepted at EMNLP 2021.

MultiModal-InfoMax This repository contains the official implementation code of the paper Improving Multimodal Fusion with Hierarchical Mutual Informa

Deep Cognition and Language Research (DeCLaRe) Lab 89 Dec 26, 2022
Generic Event Boundary Detection: A Benchmark for Event Segmentation

Generic Event Boundary Detection: A Benchmark for Event Segmentation We release our data annotation & baseline codes for detecting generic event bound

47 Nov 22, 2022
An Open-Source Package for Information Retrieval.

OpenMatch An Open-Source Package for Information Retrieval. 😃 What's New Top Spot on TREC-COVID Challenge (May 2020, Round2) The twin goals of the ch

THUNLP 439 Dec 27, 2022
A computational optimization project towards the goal of gerrymandering the results of a hypothetical election in the UK.

A computational optimization project towards the goal of gerrymandering the results of a hypothetical election in the UK.

Emma 1 Jan 18, 2022
This is the official source code for SLATE. We provide the code for the model, the training code, and a dataset loader for the 3D Shapes dataset. This code is implemented in Pytorch.

SLATE This is the official source code for SLATE. We provide the code for the model, the training code and a dataset loader for the 3D Shapes dataset.

Gautam Singh 66 Dec 26, 2022
Self-Attention Between Datapoints: Going Beyond Individual Input-Output Pairs in Deep Learning

We challenge a common assumption underlying most supervised deep learning: that a model makes a prediction depending only on its parameters and the features of a single input. To this end, we introdu

OATML 360 Dec 28, 2022
EMNLP 2021: Single-dataset Experts for Multi-dataset Question-Answering

MADE (Multi-Adapter Dataset Experts) This repository contains the implementation of MADE (Multi-adapter dataset experts), which is described in the pa

Princeton Natural Language Processing 68 Jul 18, 2022
"Neural Turing Machine" in Tensorflow

Neural Turing Machine in Tensorflow Tensorflow implementation of Neural Turing Machine. This implementation uses an LSTM controller. NTM models with m

Taehoon Kim 1k Dec 06, 2022
Hl classification bc - A Network-Based High-Level Data Classification Algorithm Using Betweenness Centrality

A Network-Based High-Level Data Classification Algorithm Using Betweenness Centr

Esteban Vilca 3 Dec 01, 2022
Patient-Survival - Using Python, I developed a Machine Learning model using classification techniques such as Random Forest and SVM classifiers to predict a patient's survival status that have undergone breast cancer surgery.

Patient-Survival - Using Python, I developed a Machine Learning model using classification techniques such as Random Forest and SVM classifiers to predict a patient's survival status that have underg

Nafis Ahmed 1 Dec 28, 2021
Efficient Lottery Ticket Finding: Less Data is More

The lottery ticket hypothesis (LTH) reveals the existence of winning tickets (sparse but critical subnetworks) for dense networks, that can be trained in isolation from random initialization to match

VITA 20 Sep 04, 2022
A curated list of neural rendering resources.

Awesome-of-Neural-Rendering A curated list of neural rendering and related resources. Please feel free to pull requests or open an issue to add papers

Zhiwei ZHANG 43 Dec 09, 2022
Extending JAX with custom C++ and CUDA code

Extending JAX with custom C++ and CUDA code This repository is meant as a tutorial demonstrating the infrastructure required to provide custom ops in

Dan Foreman-Mackey 237 Dec 23, 2022
Semi-supervised Learning for Sentiment Analysis

Neural-Semi-supervised-Learning-for-Text-Classification-Under-Large-Scale-Pretraining Code, models and Datasets for《Neural Semi-supervised Learning fo

47 Jan 01, 2023
Rate-limit-semaphore - Semaphore implementation with rate limit restriction for async-style (any core)

Rate Limit Semaphore Rate limit semaphore for async-style (any core) There are t

Yan Kurbatov 4 Jun 21, 2022
Code for Private Recommender Systems: How Can Users Build Their Own Fair Recommender Systems without Log Data? (SDM 2022)

Private Recommender Systems: How Can Users Build Their Own Fair Recommender Systems without Log Data? (SDM 2022) We consider how a user of a web servi

joisino 20 Aug 21, 2022
PyGCL: A PyTorch Library for Graph Contrastive Learning

PyGCL is a PyTorch-based open-source Graph Contrastive Learning (GCL) library, which features modularized GCL components from published papers, standa

PyGCL 588 Dec 31, 2022
PyTorch implementation of our method for adversarial attacks and defenses in hyperspectral image classification.

Self-Attention Context Network for Hyperspectral Image Classification PyTorch implementation of our method for adversarial attacks and defenses in hyp

22 Dec 02, 2022
PyTorch implementation of InstaGAN: Instance-aware Image-to-Image Translation

InstaGAN: Instance-aware Image-to-Image Translation Warning: This repo contains a model which has potential ethical concerns. Remark that the task of

Sangwoo Mo 827 Dec 29, 2022