Metadata-Version: 2.1
Name: daccuracy
Version: 2021.2
Summary: Detection and Segmentation Accuracy Measures
Home-page: https://gitlab.inria.fr/edebreuv/daccuracy
Author: Eric Debreuve
Author-email: eric.debreuve@univ-cotedazur.fr
License: UNKNOWN
Project-URL: Source, https://gitlab.inria.fr/edebreuv/daccuracy
Keywords: image,object detection,segmentation,accuracy
Platform: UNKNOWN
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)
Classifier: Programming Language :: Python :: 3.8
Classifier: Development Status :: 4 - Beta
Requires-Python: >=3.8, <4
Description-Content-Type: text/x-rst
Requires-Dist: imageio
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: scikit-image
Requires-Dist: scipy

=======================================================
DAccuracy: Detection and Segmentation Accuracy Measures
=======================================================

Purpose of ``DAccuracy``
========================

In a Few Words
--------------

The ``DAccuracy`` project allows to compute some accuracy measures of an N-dimensional detection or segmentation image when the ground-truth is represented by a `CSV file <https://en.wikipedia.org/wiki/Comma-separated_values>`_ or an image. It works in 3 contexts:

- one-to-one: single ground-truth, single segmentation;
- one-to-many: unique ground-truth, several segmentations (typically obtained with several methods);
- many-to-many: set of ground-truth/segmentation pairs.



Illustration
------------

.. code-block:: sh

    python daccuracy.py --gt ground-truth.csv --dn detection.png -t 5 -s --format csv



.. _installation:

INSTALLATION
============

The ``DAccuracy`` project is published on the `Python Package Index (PyPI) <https://pypi.org>`_ at: `https://pypi.org/project/daccuracy <https://pypi.org/project/daccuracy>`_. It requires version 3.8, or higher, of the interpreter. It should be installable from Python distribution platforms or Integrated Development Environments (IDEs). Otherwise, it can be installed from a command-line console:

- For all users, after acquiring administrative rights:
    - First installation: ``pip3 install daccuracy``
    - Installation update: ``pip3 install --upgrade daccuracy``
- For the current user (no administrative rights required):
    - First installation: ``pip3 install --user daccuracy``
    - Installation update: ``pip3 install --user --upgrade daccuracy``


.. note::
    The command ``pip3`` was mentioned above to emphasize that ``DAccuracy`` requires major version 3 of Python. If ``pip`` defaults to this version, it can of course be used instead.



Documentation
=============

Usage Help::

    usage: daccuracy.py [-h] --gt ground_truth --dn detection [--shifts Dn_shift Dn_shift] [-e] [-t TOLERANCE] [-f {csv,nev}] [-o Output file] [-s]

    3 modes:
        - one-to-one: one ground-truth (image or csv) vs. one detection (image)
        - one-to-many: one ground-truth (image or csv) vs. several detections (folder of images)
        - many-to-many: several ground-truths (folder of images and/or csv's) vs. corresponding detections (folder of images)

    optional arguments:
      -h, --help            show this help message and exit
      --gt ground_truth     Ground-truth labeled image or CSV file of centers, or ground-truth folder; If CSV, --rAcB or --xAyB can be passed additionally
                            to indicate which columns contain the centers' rows and cols or x's and y's respectively
      --dn detection        Detection labeled image, or detection folder
      --shifts Dn_shift Dn_shift
                            Vertical (row) and horizontal (col) shifts to apply to detection
      -e, --exclude-border  If present, this option instructs to discard objects touching image border, both in ground-truth and detection
      -t TOLERANCE, --tol TOLERANCE, --tolerance TOLERANCE
                            Max ground-truth-to-detection distance to count as a hit (meant to be used when ground-truth is a CSV file of centers)
      -f {csv,nev}, --format {csv,nev}
                            nev: one "Name = Value"-row per measure; csv: one CSV-row per ground-truth/detection pairs
      -o Output file        Name-Value or CSV file to store the computed measures, or "-" for console output
      -s, --show-image      If present, this option instructs to show an image superimposing ground-truth onto detection



Thanks
======

The project is developed with `PyCharm Community <https://www.jetbrains.com/pycharm>`_.

The code is formatted by `Black <https://github.com/psf/black>`_, *The Uncompromising Code Formatter*.

The imports are ordered by `isort <https://github.com/timothycrosley/isort>`_... *your imports, so you don't have to*.


