From c15ea640adc1433c05477a6a1aa0a5057c9b37d3 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.dos.anjos@gmail.com>
Date: Fri, 18 Aug 2023 16:08:15 +0200
Subject: [PATCH] [readme,doc,pyproject,scripts] Remove traces of
 "tuberculosis" exclusivity

---
 README.md                         | 7 ++++---
 doc/index.rst                     | 9 +++++----
 pyproject.toml                    | 2 +-
 src/ptbench/scripts/cli.py        | 2 +-
 src/ptbench/scripts/evaluate.py   | 5 ++++-
 src/ptbench/scripts/experiment.py | 3 +++
 src/ptbench/scripts/predict.py    | 3 ++-
 7 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md
index 5ac5fc52..810b740d 100644
--- a/README.md
+++ b/README.md
@@ -8,9 +8,10 @@ SPDX-License-Identifier: GPL-3.0-or-later
 [![coverage](https://gitlab.idiap.ch/biosignal/software/ptbench/badges/main/coverage.svg)](https://www.idiap.ch/software/biosignal/docs/biosignal/software/ptbench/main/coverage/index.html)
 [![repository](https://img.shields.io/badge/gitlab-project-0000c0.svg)](https://gitlab.idiap.ch/biosignal/software/ptbench)
 
-# Active Pulmonary Tuberculosis Detection On Chest X-Rays
+# Computer-Aided Disease Detection from Medical Data
 
-Benchmarks for training and evaluating deep models for the detection of active
-Pulmonary Tuberculosis from Chest X-Ray imaging.
+Benchmarks of convolutional neural network (CNN) architectures applied to
+disease detection, including Pulmonary Tuberculosis (TB) detection on chest
+X-rays (CXR).
 
 For installation and usage instructions, check-out our documentation.
diff --git a/doc/index.rst b/doc/index.rst
index 964e4f35..e948754e 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -4,14 +4,15 @@
 
 .. _ptbench:
 
-=========================================================
- Active Pulmonary Tuberculosis Detection On Chest X-Rays
-=========================================================
+====================================================
+ Computer-Aided Disease Detection from Medical Data
+====================================================
 
 .. todolist::
 
 Benchmarks of convolutional neural network (CNN) architectures applied to
-Pulmonary Tuberculosis (TB) detection on chest X-rays (CXR).
+disease detection, including Pulmonary Tuberculosis (TB) detection on chest
+X-rays (CXR).
 
 Please use the BibTeX reference below to cite this work:
 
diff --git a/pyproject.toml b/pyproject.toml
index 8ebe16e4..30741ef8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
 name = "ptbench"
 version = "1.0.0b0"
 requires-python = ">=3.10"
-description = "Benchmarks for training and evaluating deep models for the detection of active Pulmonary Tuberculosis from Chest X-Ray imaging."
+description = "Benchmarks for Computer-Aided Disease Detection from Medical Data."
 dynamic = ["readme"]
 license = { text = "GNU General Public License v3 (GPLv3)" }
 authors = [{ name = "Geoffrey Raposo", email = "geoffrey@raposo.ch" }]
diff --git a/src/ptbench/scripts/cli.py b/src/ptbench/scripts/cli.py
index 3b27fe78..11cba171 100644
--- a/src/ptbench/scripts/cli.py
+++ b/src/ptbench/scripts/cli.py
@@ -22,7 +22,7 @@ from . import (
     context_settings=dict(help_option_names=["-?", "-h", "--help"]),
 )
 def cli():
-    """Active Tuberculosis Detection On Chest X-Ray Images."""
+    """Image classification benchmark."""
     pass
 
 
diff --git a/src/ptbench/scripts/evaluate.py b/src/ptbench/scripts/evaluate.py
index 19afc037..2e4fe626 100644
--- a/src/ptbench/scripts/evaluate.py
+++ b/src/ptbench/scripts/evaluate.py
@@ -11,6 +11,9 @@ from clapper.logging import setup
 
 from .click import ConfigCommand
 
+# avoids X11/graphical desktop requirement when creating plots
+__import__("matplotlib").use("agg")
+
 logger = setup(__name__.split(".")[0], format="%(levelname)s: %(message)s")
 
 
@@ -76,7 +79,7 @@ def evaluate(
     threshold: str | float,
     **_,  # ignored
 ) -> None:
-    """Evaluates predictions (from a model) on a binary classification task."""
+    """Evaluates predictions (from a model) on a classification task."""
 
     import json
     import typing
diff --git a/src/ptbench/scripts/experiment.py b/src/ptbench/scripts/experiment.py
index fdac41a2..55c24260 100644
--- a/src/ptbench/scripts/experiment.py
+++ b/src/ptbench/scripts/experiment.py
@@ -9,6 +9,9 @@ from clapper.logging import setup
 
 from .train import reusable_options as training_options
 
+# avoids X11/graphical desktop requirement when creating plots
+__import__("matplotlib").use("agg")
+
 logger = setup(__name__.split(".")[0], format="%(levelname)s: %(message)s")
 
 
diff --git a/src/ptbench/scripts/predict.py b/src/ptbench/scripts/predict.py
index 0b54d051..054590e2 100644
--- a/src/ptbench/scripts/predict.py
+++ b/src/ptbench/scripts/predict.py
@@ -117,7 +117,8 @@ def predict(
     parallel,
     **_,
 ) -> None:
-    """Predicts Tuberculosis presence (probabilities) on input images."""
+    """Runs inference (generates scores) on all input images, using a pre-
+    trained model."""
 
     import json
     import shutil
-- 
GitLab