diff --git a/src/ptbench/configs/models/alexnet.py b/src/ptbench/configs/models/alexnet.py index 0028e810ed34658b754ea0fe89b75bf64faae4a0..8de265c568da58295a1de7e89c9205a20e90f9e0 100644 --- a/src/ptbench/configs/models/alexnet.py +++ b/src/ptbench/configs/models/alexnet.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """AlexNet.""" from torch.nn import BCEWithLogitsLoss diff --git a/src/ptbench/configs/models/alexnet_pretrained.py b/src/ptbench/configs/models/alexnet_pretrained.py index 9c772f42e935b2b995030e6d73fcc044fdcbcc76..b6db6c5941aa2d50baf90dc414ea93042c570307 100644 --- a/src/ptbench/configs/models/alexnet_pretrained.py +++ b/src/ptbench/configs/models/alexnet_pretrained.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """AlexNet.""" from torch.nn import BCEWithLogitsLoss diff --git a/src/ptbench/configs/models/densenet.py b/src/ptbench/configs/models/densenet.py index 5d453a6d4ff75514c0e7669a01b43be3e1aa3473..cce44a25b4a42b35d9998eb0ef156ce0160c5dc3 100644 --- a/src/ptbench/configs/models/densenet.py +++ b/src/ptbench/configs/models/densenet.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """DenseNet.""" from torch.nn import BCEWithLogitsLoss diff --git a/src/ptbench/configs/models/densenet_pretrained.py b/src/ptbench/configs/models/densenet_pretrained.py index 49b0162f5fb1defd3bfc7b64bcc390c9e2bd0c27..9e32807e5edb9ed4c7637928192bed58231f7848 100644 --- a/src/ptbench/configs/models/densenet_pretrained.py +++ b/src/ptbench/configs/models/densenet_pretrained.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """DenseNet.""" from torch.nn import BCEWithLogitsLoss diff --git a/src/ptbench/configs/models/logistic_regression.py b/src/ptbench/configs/models/logistic_regression.py index 145dddd7a3a9c6e0b0574f3c6358f6f9f51056a0..dab855aaee6fa478a2e1210d559a26242ba6cfe7 100644 --- a/src/ptbench/configs/models/logistic_regression.py +++ b/src/ptbench/configs/models/logistic_regression.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Feedforward network for Tuberculosis Detection. Simple feedforward network taking radiological signs in output and diff --git a/src/ptbench/configs/models/pasa.py b/src/ptbench/configs/models/pasa.py index b1a201e5b2d1f5a1b22135ee46ea148d8f655536..22e664a214bdf563a1d92657c0c52add875c56c1 100644 --- a/src/ptbench/configs/models/pasa.py +++ b/src/ptbench/configs/models/pasa.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """CNN for Tuberculosis Detection. Implementation of the model architecture proposed by F. Pasa in the article diff --git a/src/ptbench/configs/models/signs_to_tb.py b/src/ptbench/configs/models/signs_to_tb.py index 1ce89b1299764463f3f7f9e54e2ad2172acfea6f..acec64f3115d27dc129b3a79a6e59b1d2567e15f 100644 --- a/src/ptbench/configs/models/signs_to_tb.py +++ b/src/ptbench/configs/models/signs_to_tb.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Feedforward network for Tuberculosis Detection. Simple feedforward network taking radiological signs in output and diff --git a/src/ptbench/configs/models_datasets/densenet_rs.py b/src/ptbench/configs/models_datasets/densenet_rs.py index 714404bf173c8868e4c67e49f257a1b221e540d7..b1ba206b54d9918747c29de54d9215b707b66f93 100644 --- a/src/ptbench/configs/models_datasets/densenet_rs.py +++ b/src/ptbench/configs/models_datasets/densenet_rs.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """CNN for radiological findings detection. A Densenet121 model for radiological extraction diff --git a/src/ptbench/data/hivtb/__init__.py b/src/ptbench/data/hivtb/__init__.py index e004c1dcdaa983aea81d2c2afd67b7dbce25165d..0fca31ae5ad1553328baa81b59282fb1c8622391 100644 --- a/src/ptbench/data/hivtb/__init__.py +++ b/src/ptbench/data/hivtb/__init__.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for computer-aided diagnosis (only BMP files) * Reference: [HIV-TB-2019]_ diff --git a/src/ptbench/data/hivtb/fold_0.py b/src/ptbench/data/hivtb/fold_0.py index af3be161a75f76c8287168fdca0e4cac2c5b43d3..dae7f3dc6080845c4c4e4992d44a064a435ff595 100644 --- a/src/ptbench/data/hivtb/fold_0.py +++ b/src/ptbench/data/hivtb/fold_0.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 0) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_1.py b/src/ptbench/data/hivtb/fold_1.py index ec86cab362f9b4f298f3b92f7e62893d2f83d16b..e2f31bb958ed13bb993788a90968f1cdc9e32e08 100644 --- a/src/ptbench/data/hivtb/fold_1.py +++ b/src/ptbench/data/hivtb/fold_1.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 1) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_2.py b/src/ptbench/data/hivtb/fold_2.py index 56ae69fee9fe57a2a9d2042f0b20e984832334ac..2bb387e746654fc830f1d57de9016ce3beede077 100644 --- a/src/ptbench/data/hivtb/fold_2.py +++ b/src/ptbench/data/hivtb/fold_2.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 2) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_3.py b/src/ptbench/data/hivtb/fold_3.py index 5dbddeda83eda1b46e485a7cbed619a3f8ff1714..ff3ca7e6b0de4ff5e9fcb17c94ab6d71908e25a9 100644 --- a/src/ptbench/data/hivtb/fold_3.py +++ b/src/ptbench/data/hivtb/fold_3.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 3) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_4.py b/src/ptbench/data/hivtb/fold_4.py index 9ab5a79fe3642254302388e0e054f6753cc8e3f5..1111102586d102e6eca83f278500acb8ff4e6aed 100644 --- a/src/ptbench/data/hivtb/fold_4.py +++ b/src/ptbench/data/hivtb/fold_4.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 4) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_5.py b/src/ptbench/data/hivtb/fold_5.py index 445ce4589a85bf6323de19f654e93bbd5d766e4b..b27e34df371e39cfb812fcf713fe583039b00268 100644 --- a/src/ptbench/data/hivtb/fold_5.py +++ b/src/ptbench/data/hivtb/fold_5.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 5) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_6.py b/src/ptbench/data/hivtb/fold_6.py index fbbea2ad903d704787d106077fdfc60cc35b2988..f6cd1cf5b522c7df91faa725084bdfe53a6609f4 100644 --- a/src/ptbench/data/hivtb/fold_6.py +++ b/src/ptbench/data/hivtb/fold_6.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 6) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_7.py b/src/ptbench/data/hivtb/fold_7.py index dcce836d87ff865a88f5f22c8a98bea7f2ded780..7fabae5c6ef0bd316c8d2b6ad21dbf9fabdc596e 100644 --- a/src/ptbench/data/hivtb/fold_7.py +++ b/src/ptbench/data/hivtb/fold_7.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 7) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_8.py b/src/ptbench/data/hivtb/fold_8.py index 7ba95a1e1cb501b408d409ce04cd2f466bdd55c3..53a0e1a71b1f857b7d2ccfe937cd94bffe5fa737 100644 --- a/src/ptbench/data/hivtb/fold_8.py +++ b/src/ptbench/data/hivtb/fold_8.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 8) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/hivtb/fold_9.py b/src/ptbench/data/hivtb/fold_9.py index 4a244adfd3807f1abfb46b5b7f55dcedf6dc0292..dcac4d53dfcc4a075673768a1a953ededa258011 100644 --- a/src/ptbench/data/hivtb/fold_9.py +++ b/src/ptbench/data/hivtb/fold_9.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """HIV-TB dataset for TB detection (cross validation fold 9) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/image_utils.py b/src/ptbench/data/image_utils.py index 9103126f4179c552d7107471cc373a510500e2c0..b9f8c8108dd0db18a0cd796b968d26f82da49906 100644 --- a/src/ptbench/data/image_utils.py +++ b/src/ptbench/data/image_utils.py @@ -1,8 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - - """Data loading code.""" import pathlib @@ -16,9 +14,9 @@ class SingleAutoLevel16to8: This transform assumes that the input image is gray-scaled. - To auto-level, we calculate the maximum and the minimum of the image, and - consider such a range should be mapped to the [0,255] range of the - destination image. + To auto-level, we calculate the maximum and the minimum of the + image, and consider such a range should be mapped to the [0,255] + range of the destination image. """ def __call__(self, img): diff --git a/src/ptbench/data/mc_ch_in_pc/default.py b/src/ptbench/data/mc_ch_in_pc/default.py index 0b8be8f44d10fb859dcb7c044a6646c1375fda5a..4715b13d2b50893ab9de25c779b54507df2ff564 100644 --- a/src/ptbench/data/mc_ch_in_pc/default.py +++ b/src/ptbench/data/mc_ch_in_pc/default.py @@ -1,7 +1,6 @@ # Copyright © 2022 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Aggregated dataset composed of Montgomery, Shenzhen, Indian and Padchest datasets.""" diff --git a/src/ptbench/data/padchest/__init__.py b/src/ptbench/data/padchest/__init__.py index f6f39a9ebe98eb68a88374b8d83a70447a4ad995..1151b55f28eb1a6e90310e0abc5c544991b314bb 100644 --- a/src/ptbench/data/padchest/__init__.py +++ b/src/ptbench/data/padchest/__init__.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Padchest dataset for computer-aided diagnosis. A large chest x-ray image dataset with multi-label annotated reports. diff --git a/src/ptbench/data/padchest/cardiomegaly_idiap.py b/src/ptbench/data/padchest/cardiomegaly_idiap.py index 25eaa6e8fd0ba15db3a46f4d14366bcf5bc91667..d25387388d1540e706876eef2e15543b293113e0 100644 --- a/src/ptbench/data/padchest/cardiomegaly_idiap.py +++ b/src/ptbench/data/padchest/cardiomegaly_idiap.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Padchest cardiomegaly (idiap protocol) dataset for computer-aided diagnosis. The first 40 images with cardiomegaly. diff --git a/src/ptbench/data/padchest/idiap.py b/src/ptbench/data/padchest/idiap.py index d91b552f39123cfc6e808dfe3bc8bab097448497..284a944d0d83bd933123d63732f4f045549084d3 100644 --- a/src/ptbench/data/padchest/idiap.py +++ b/src/ptbench/data/padchest/idiap.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Padchest (idiap protocol) dataset for computer-aided diagnosis. * See :py:mod:`ptbench.data.padchest` for dataset details diff --git a/src/ptbench/data/padchest/no_tb_idiap.py b/src/ptbench/data/padchest/no_tb_idiap.py index 78155abf3c5a44de88920da1833ddfa09b6bb244..a424e0fe46890b899804aeac954cb3bd710429ae 100644 --- a/src/ptbench/data/padchest/no_tb_idiap.py +++ b/src/ptbench/data/padchest/no_tb_idiap.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Padchest tuberculosis (no TB idiap protocol) dataset for computer-aided diagnosis. diff --git a/src/ptbench/data/padchest/tb_idiap.py b/src/ptbench/data/padchest/tb_idiap.py index 51428935d728d243b34eec4e54c2d1fcc911224b..1a2516202e676386d149fbfc684e3b93e805978e 100644 --- a/src/ptbench/data/padchest/tb_idiap.py +++ b/src/ptbench/data/padchest/tb_idiap.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Padchest tuberculosis (idiap protocol) dataset for computer-aided diagnosis. The 125 healthy images are the first 125 padchest images with the following diff --git a/src/ptbench/data/tbpoc/__init__.py b/src/ptbench/data/tbpoc/__init__.py index 4d9f455055203710549e879d5091078ade40f97e..00f5f42c7f81b93c5ab4c037d289275e3477b00b 100644 --- a/src/ptbench/data/tbpoc/__init__.py +++ b/src/ptbench/data/tbpoc/__init__.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for computer-aided diagnosis. * Reference: [TB-POC-2018]_ diff --git a/src/ptbench/data/tbpoc/fold_0.py b/src/ptbench/data/tbpoc/fold_0.py index a440117f88e8009fc0fa20716ab84b4cbb573977..332347a9434978f415d472c240e92a155e7f2e2b 100644 --- a/src/ptbench/data/tbpoc/fold_0.py +++ b/src/ptbench/data/tbpoc/fold_0.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 0) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_1.py b/src/ptbench/data/tbpoc/fold_1.py index 95a54ee3b7b347c53dc351430a90cb0d394b4f42..c8b055f356ee40e56bbfc8dc5b397f055aae3b29 100644 --- a/src/ptbench/data/tbpoc/fold_1.py +++ b/src/ptbench/data/tbpoc/fold_1.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 1) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_2.py b/src/ptbench/data/tbpoc/fold_2.py index 508c54a83114a1803cec97bbb885ba437e8a0105..33a2329aadf93377d0d86763575c28c360d0f1a0 100644 --- a/src/ptbench/data/tbpoc/fold_2.py +++ b/src/ptbench/data/tbpoc/fold_2.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 2) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_3.py b/src/ptbench/data/tbpoc/fold_3.py index 28d34553422830e45b9b2893edfa8722c504924a..ac418f20eddc49e7fcefa35de5bf3745b93c80ad 100644 --- a/src/ptbench/data/tbpoc/fold_3.py +++ b/src/ptbench/data/tbpoc/fold_3.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 3) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_4.py b/src/ptbench/data/tbpoc/fold_4.py index 90bff0b284f91e94ce660f60d95f67049f402a77..da21a88287d0f646778823da6353a370502b6862 100644 --- a/src/ptbench/data/tbpoc/fold_4.py +++ b/src/ptbench/data/tbpoc/fold_4.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 4) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_5.py b/src/ptbench/data/tbpoc/fold_5.py index cbe4ff6e06e4dbe1c1617a298f943904334da88d..323996c710e291456a29ec2ae6d7aaf4af677361 100644 --- a/src/ptbench/data/tbpoc/fold_5.py +++ b/src/ptbench/data/tbpoc/fold_5.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 5) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_6.py b/src/ptbench/data/tbpoc/fold_6.py index 3edeb7273bac27f5fe3249bbcd6aa5e1fb2840f5..7be3befa3d6d57dd831f34f210c69708c61cac66 100644 --- a/src/ptbench/data/tbpoc/fold_6.py +++ b/src/ptbench/data/tbpoc/fold_6.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 6) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_7.py b/src/ptbench/data/tbpoc/fold_7.py index 3ef4fe0be368435272a611c319a8497183edfd82..9c84b929938106d54e141edcdcc17ea55e12863a 100644 --- a/src/ptbench/data/tbpoc/fold_7.py +++ b/src/ptbench/data/tbpoc/fold_7.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 7) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_8.py b/src/ptbench/data/tbpoc/fold_8.py index 6b68c0c3dae48e3b95af34acbce4c868de7b2c46..c647f6f6486e5e4d624ca44a889d2a26bf761824 100644 --- a/src/ptbench/data/tbpoc/fold_8.py +++ b/src/ptbench/data/tbpoc/fold_8.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 8) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/data/tbpoc/fold_9.py b/src/ptbench/data/tbpoc/fold_9.py index 0f2565a449450cfa6685bbf4546e7abe4d7999ab..aad4c14eddd46075c5c97e13238bcd741a4322b2 100644 --- a/src/ptbench/data/tbpoc/fold_9.py +++ b/src/ptbench/data/tbpoc/fold_9.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """TB-POC dataset for TB detection (cross validation fold 9) * Split reference: none (stratified kfolding) diff --git a/src/ptbench/engine/evaluator.py b/src/ptbench/engine/evaluator.py index a551dba65f4ed0deaab1b4a5ef541accaf79d454..9d14f79078dc255ac2dec738584675331c74111f 100644 --- a/src/ptbench/engine/evaluator.py +++ b/src/ptbench/engine/evaluator.py @@ -1,14 +1,14 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Defines functionality for the evaluation of predictions.""" import logging import os import re -from typing import Iterable, Optional +from collections.abc import Iterable +from typing import Optional import matplotlib.pyplot as plt import numpy @@ -292,7 +292,6 @@ def run( ), ) data_df = data_df.set_index("index") - """# Save evaluation csv if output_folder is not None: fullpath = os.path.join(output_folder, f"{name}.csv") @@ -353,7 +352,6 @@ def run( axes.spines["right"].set_visible(False) axes.spines["top"].set_visible(False) axes.spines["left"].set_position(("data", -0.015)) - """if f1_thresh is not None and eer_thresh is not None: # get the closest possible threshold we have index = int(round(steps * f1_thresh)) diff --git a/src/ptbench/models/normalizer.py b/src/ptbench/models/normalizer.py index ce68f4b558b2812d17a8f54954e197a086233a52..147efc7e02beac30bab6f79678b6860c3b42c810 100644 --- a/src/ptbench/models/normalizer.py +++ b/src/ptbench/models/normalizer.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """A network model that prefixes a subtract/divide step to any other module.""" import torch diff --git a/src/ptbench/models/transforms.py b/src/ptbench/models/transforms.py index 585b5846151292c69c8bb3411f68e28dc5eb97e2..8ff0af726aada9256603882dd8a6c0aeb6d34cad 100644 --- a/src/ptbench/models/transforms.py +++ b/src/ptbench/models/transforms.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """A transform that turns grayscale images to RGB.""" import torch diff --git a/src/ptbench/scripts/relevance_analysis.py b/src/ptbench/scripts/relevance_analysis.py index 1771c107f1317ad181838cf408a76d2c955ad30c..6be7abd5bdf49995a3910404d971f523893537a7 100644 --- a/src/ptbench/scripts/relevance_analysis.py +++ b/src/ptbench/scripts/relevance_analysis.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Import copy import os import shutil. import numpy as np diff --git a/src/ptbench/utils/resources.py b/src/ptbench/utils/resources.py index d6ed02196ca73286ac19520e6f327b8d4ebf8021..ca0f5efa3727e5cc53ac6c722f2371e0ccc4d00d 100644 --- a/src/ptbench/utils/resources.py +++ b/src/ptbench/utils/resources.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tools for interacting with the running computer or GPU.""" import logging diff --git a/tests/data/iris.json b/tests/data/iris.json index 1777efc361562880096b9a21b2011218c152ecac..4bbc1d841f4ba9052fa7eecdd751e1582510acc1 100644 --- a/tests/data/iris.json +++ b/tests/data/iris.json @@ -1,156 +1,156 @@ -{ - "train": [ - [5.1,3.5,1.4,0.2,"Iris-setosa"], - [4.9,3,1.4,0.2,"Iris-setosa"], - [4.7,3.2,1.3,0.2,"Iris-setosa"], - [4.6,3.1,1.5,0.2,"Iris-setosa"], - [5,3.6,1.4,0.2,"Iris-setosa"], - [5.4,3.9,1.7,0.4,"Iris-setosa"], - [4.6,3.4,1.4,0.3,"Iris-setosa"], - [5,3.4,1.5,0.2,"Iris-setosa"], - [4.4,2.9,1.4,0.2,"Iris-setosa"], - [4.9,3.1,1.5,0.1,"Iris-setosa"], - [5.4,3.7,1.5,0.2,"Iris-setosa"], - [4.8,3.4,1.6,0.2,"Iris-setosa"], - [4.8,3,1.4,0.1,"Iris-setosa"], - [4.3,3,1.1,0.1,"Iris-setosa"], - [5.8,4,1.2,0.2,"Iris-setosa"], - [5.7,4.4,1.5,0.4,"Iris-setosa"], - [5.4,3.9,1.3,0.4,"Iris-setosa"], - [5.1,3.5,1.4,0.3,"Iris-setosa"], - [5.7,3.8,1.7,0.3,"Iris-setosa"], - [5.1,3.8,1.5,0.3,"Iris-setosa"], - [5.4,3.4,1.7,0.2,"Iris-setosa"], - [5.1,3.7,1.5,0.4,"Iris-setosa"], - [4.6,3.6,1,0.2,"Iris-setosa"], - [5.1,3.3,1.7,0.5,"Iris-setosa"], - [4.8,3.4,1.9,0.2,"Iris-setosa"], - [7,3.2,4.7,1.4,"Iris-versicolor"], - [6.4,3.2,4.5,1.5,"Iris-versicolor"], - [6.9,3.1,4.9,1.5,"Iris-versicolor"], - [5.5,2.3,4,1.3,"Iris-versicolor"], - [6.5,2.8,4.6,1.5,"Iris-versicolor"], - [5.7,2.8,4.5,1.3,"Iris-versicolor"], - [6.3,3.3,4.7,1.6,"Iris-versicolor"], - [4.9,2.4,3.3,1,"Iris-versicolor"], - [6.6,2.9,4.6,1.3,"Iris-versicolor"], - [5.2,2.7,3.9,1.4,"Iris-versicolor"], - [5,2,3.5,1,"Iris-versicolor"], - [5.9,3,4.2,1.5,"Iris-versicolor"], - [6,2.2,4,1,"Iris-versicolor"], - [6.1,2.9,4.7,1.4,"Iris-versicolor"], - [5.6,2.9,3.6,1.3,"Iris-versicolor"], - [6.7,3.1,4.4,1.4,"Iris-versicolor"], - [5.6,3,4.5,1.5,"Iris-versicolor"], - [5.8,2.7,4.1,1,"Iris-versicolor"], - [6.2,2.2,4.5,1.5,"Iris-versicolor"], - [5.6,2.5,3.9,1.1,"Iris-versicolor"], - [5.9,3.2,4.8,1.8,"Iris-versicolor"], - [6.1,2.8,4,1.3,"Iris-versicolor"], - [6.3,2.5,4.9,1.5,"Iris-versicolor"], - [6.1,2.8,4.7,1.2,"Iris-versicolor"], - [6.4,2.9,4.3,1.3,"Iris-versicolor"], - [6.3,3.3,6,2.5,"Iris-virginica"], - [5.8,2.7,5.1,1.9,"Iris-virginica"], - [7.1,3,5.9,2.1,"Iris-virginica"], - [6.3,2.9,5.6,1.8,"Iris-virginica"], - [6.5,3,5.8,2.2,"Iris-virginica"], - [7.6,3,6.6,2.1,"Iris-virginica"], - [4.9,2.5,4.5,1.7,"Iris-virginica"], - [7.3,2.9,6.3,1.8,"Iris-virginica"], - [6.7,2.5,5.8,1.8,"Iris-virginica"], - [7.2,3.6,6.1,2.5,"Iris-virginica"], - [6.5,3.2,5.1,2,"Iris-virginica"], - [6.4,2.7,5.3,1.9,"Iris-virginica"], - [6.8,3,5.5,2.1,"Iris-virginica"], - [5.7,2.5,5,2,"Iris-virginica"], - [5.8,2.8,5.1,2.4,"Iris-virginica"], - [6.4,3.2,5.3,2.3,"Iris-virginica"], - [6.5,3,5.5,1.8,"Iris-virginica"], - [7.7,3.8,6.7,2.2,"Iris-virginica"], - [7.7,2.6,6.9,2.3,"Iris-virginica"], - [6,2.2,5,1.5,"Iris-virginica"], - [6.9,3.2,5.7,2.3,"Iris-virginica"], - [5.6,2.8,4.9,2,"Iris-virginica"], - [7.7,2.8,6.7,2,"Iris-virginica"], - [6.3,2.7,4.9,1.8,"Iris-virginica"], - [6.7,3.3,5.7,2.1,"Iris-virginica"] - ], - "test": [ - [5,3,1.6,0.2,"Iris-setosa"], - [5,3.4,1.6,0.4,"Iris-setosa"], - [5.2,3.5,1.5,0.2,"Iris-setosa"], - [5.2,3.4,1.4,0.2,"Iris-setosa"], - [4.7,3.2,1.6,0.2,"Iris-setosa"], - [4.8,3.1,1.6,0.2,"Iris-setosa"], - [5.4,3.4,1.5,0.4,"Iris-setosa"], - [5.2,4.1,1.5,0.1,"Iris-setosa"], - [5.5,4.2,1.4,0.2,"Iris-setosa"], - [4.9,3.1,1.5,0.1,"Iris-setosa"], - [5,3.2,1.2,0.2,"Iris-setosa"], - [5.5,3.5,1.3,0.2,"Iris-setosa"], - [4.9,3.1,1.5,0.1,"Iris-setosa"], - [4.4,3,1.3,0.2,"Iris-setosa"], - [5.1,3.4,1.5,0.2,"Iris-setosa"], - [5,3.5,1.3,0.3,"Iris-setosa"], - [4.5,2.3,1.3,0.3,"Iris-setosa"], - [4.4,3.2,1.3,0.2,"Iris-setosa"], - [5,3.5,1.6,0.6,"Iris-setosa"], - [5.1,3.8,1.9,0.4,"Iris-setosa"], - [4.8,3,1.4,0.3,"Iris-setosa"], - [5.1,3.8,1.6,0.2,"Iris-setosa"], - [4.6,3.2,1.4,0.2,"Iris-setosa"], - [5.3,3.7,1.5,0.2,"Iris-setosa"], - [5,3.3,1.4,0.2,"Iris-setosa"], - [6.6,3,4.4,1.4,"Iris-versicolor"], - [6.8,2.8,4.8,1.4,"Iris-versicolor"], - [6.7,3,5,1.7,"Iris-versicolor"], - [6,2.9,4.5,1.5,"Iris-versicolor"], - [5.7,2.6,3.5,1,"Iris-versicolor"], - [5.5,2.4,3.8,1.1,"Iris-versicolor"], - [5.5,2.4,3.7,1,"Iris-versicolor"], - [5.8,2.7,3.9,1.2,"Iris-versicolor"], - [6,2.7,5.1,1.6,"Iris-versicolor"], - [5.4,3,4.5,1.5,"Iris-versicolor"], - [6,3.4,4.5,1.6,"Iris-versicolor"], - [6.7,3.1,4.7,1.5,"Iris-versicolor"], - [6.3,2.3,4.4,1.3,"Iris-versicolor"], - [5.6,3,4.1,1.3,"Iris-versicolor"], - [5.5,2.5,4,1.3,"Iris-versicolor"], - [5.5,2.6,4.4,1.2,"Iris-versicolor"], - [6.1,3,4.6,1.4,"Iris-versicolor"], - [5.8,2.6,4,1.2,"Iris-versicolor"], - [5,2.3,3.3,1,"Iris-versicolor"], - [5.6,2.7,4.2,1.3,"Iris-versicolor"], - [5.7,3,4.2,1.2,"Iris-versicolor"], - [5.7,2.9,4.2,1.3,"Iris-versicolor"], - [6.2,2.9,4.3,1.3,"Iris-versicolor"], - [5.1,2.5,3,1.1,"Iris-versicolor"], - [5.7,2.8,4.1,1.3,"Iris-versicolor"], - [7.2,3.2,6,1.8,"Iris-virginica"], - [6.2,2.8,4.8,1.8,"Iris-virginica"], - [6.1,3,4.9,1.8,"Iris-virginica"], - [6.4,2.8,5.6,2.1,"Iris-virginica"], - [7.2,3,5.8,1.6,"Iris-virginica"], - [7.4,2.8,6.1,1.9,"Iris-virginica"], - [7.9,3.8,6.4,2,"Iris-virginica"], - [6.4,2.8,5.6,2.2,"Iris-virginica"], - [6.3,2.8,5.1,1.5,"Iris-virginica"], - [6.1,2.6,5.6,1.4,"Iris-virginica"], - [7.7,3,6.1,2.3,"Iris-virginica"], - [6.3,3.4,5.6,2.4,"Iris-virginica"], - [6.4,3.1,5.5,1.8,"Iris-virginica"], - [6,3,4.8,1.8,"Iris-virginica"], - [6.9,3.1,5.4,2.1,"Iris-virginica"], - [6.7,3.1,5.6,2.4,"Iris-virginica"], - [6.9,3.1,5.1,2.3,"Iris-virginica"], - [5.8,2.7,5.1,1.9,"Iris-virginica"], - [6.8,3.2,5.9,2.3,"Iris-virginica"], - [6.7,3.3,5.7,2.5,"Iris-virginica"], - [6.7,3,5.2,2.3,"Iris-virginica"], - [6.3,2.5,5,1.9,"Iris-virginica"], - [6.5,3,5.2,2,"Iris-virginica"], - [6.2,3.4,5.4,2.3,"Iris-virginica"], - [5.9,3,5.1,1.8,"Iris-virginica"] - ] -} +{ + "train": [ + [5.1, 3.5, 1.4, 0.2, "Iris-setosa"], + [4.9, 3, 1.4, 0.2, "Iris-setosa"], + [4.7, 3.2, 1.3, 0.2, "Iris-setosa"], + [4.6, 3.1, 1.5, 0.2, "Iris-setosa"], + [5, 3.6, 1.4, 0.2, "Iris-setosa"], + [5.4, 3.9, 1.7, 0.4, "Iris-setosa"], + [4.6, 3.4, 1.4, 0.3, "Iris-setosa"], + [5, 3.4, 1.5, 0.2, "Iris-setosa"], + [4.4, 2.9, 1.4, 0.2, "Iris-setosa"], + [4.9, 3.1, 1.5, 0.1, "Iris-setosa"], + [5.4, 3.7, 1.5, 0.2, "Iris-setosa"], + [4.8, 3.4, 1.6, 0.2, "Iris-setosa"], + [4.8, 3, 1.4, 0.1, "Iris-setosa"], + [4.3, 3, 1.1, 0.1, "Iris-setosa"], + [5.8, 4, 1.2, 0.2, "Iris-setosa"], + [5.7, 4.4, 1.5, 0.4, "Iris-setosa"], + [5.4, 3.9, 1.3, 0.4, "Iris-setosa"], + [5.1, 3.5, 1.4, 0.3, "Iris-setosa"], + [5.7, 3.8, 1.7, 0.3, "Iris-setosa"], + [5.1, 3.8, 1.5, 0.3, "Iris-setosa"], + [5.4, 3.4, 1.7, 0.2, "Iris-setosa"], + [5.1, 3.7, 1.5, 0.4, "Iris-setosa"], + [4.6, 3.6, 1, 0.2, "Iris-setosa"], + [5.1, 3.3, 1.7, 0.5, "Iris-setosa"], + [4.8, 3.4, 1.9, 0.2, "Iris-setosa"], + [7, 3.2, 4.7, 1.4, "Iris-versicolor"], + [6.4, 3.2, 4.5, 1.5, "Iris-versicolor"], + [6.9, 3.1, 4.9, 1.5, "Iris-versicolor"], + [5.5, 2.3, 4, 1.3, "Iris-versicolor"], + [6.5, 2.8, 4.6, 1.5, "Iris-versicolor"], + [5.7, 2.8, 4.5, 1.3, "Iris-versicolor"], + [6.3, 3.3, 4.7, 1.6, "Iris-versicolor"], + [4.9, 2.4, 3.3, 1, "Iris-versicolor"], + [6.6, 2.9, 4.6, 1.3, "Iris-versicolor"], + [5.2, 2.7, 3.9, 1.4, "Iris-versicolor"], + [5, 2, 3.5, 1, "Iris-versicolor"], + [5.9, 3, 4.2, 1.5, "Iris-versicolor"], + [6, 2.2, 4, 1, "Iris-versicolor"], + [6.1, 2.9, 4.7, 1.4, "Iris-versicolor"], + [5.6, 2.9, 3.6, 1.3, "Iris-versicolor"], + [6.7, 3.1, 4.4, 1.4, "Iris-versicolor"], + [5.6, 3, 4.5, 1.5, "Iris-versicolor"], + [5.8, 2.7, 4.1, 1, "Iris-versicolor"], + [6.2, 2.2, 4.5, 1.5, "Iris-versicolor"], + [5.6, 2.5, 3.9, 1.1, "Iris-versicolor"], + [5.9, 3.2, 4.8, 1.8, "Iris-versicolor"], + [6.1, 2.8, 4, 1.3, "Iris-versicolor"], + [6.3, 2.5, 4.9, 1.5, "Iris-versicolor"], + [6.1, 2.8, 4.7, 1.2, "Iris-versicolor"], + [6.4, 2.9, 4.3, 1.3, "Iris-versicolor"], + [6.3, 3.3, 6, 2.5, "Iris-virginica"], + [5.8, 2.7, 5.1, 1.9, "Iris-virginica"], + [7.1, 3, 5.9, 2.1, "Iris-virginica"], + [6.3, 2.9, 5.6, 1.8, "Iris-virginica"], + [6.5, 3, 5.8, 2.2, "Iris-virginica"], + [7.6, 3, 6.6, 2.1, "Iris-virginica"], + [4.9, 2.5, 4.5, 1.7, "Iris-virginica"], + [7.3, 2.9, 6.3, 1.8, "Iris-virginica"], + [6.7, 2.5, 5.8, 1.8, "Iris-virginica"], + [7.2, 3.6, 6.1, 2.5, "Iris-virginica"], + [6.5, 3.2, 5.1, 2, "Iris-virginica"], + [6.4, 2.7, 5.3, 1.9, "Iris-virginica"], + [6.8, 3, 5.5, 2.1, "Iris-virginica"], + [5.7, 2.5, 5, 2, "Iris-virginica"], + [5.8, 2.8, 5.1, 2.4, "Iris-virginica"], + [6.4, 3.2, 5.3, 2.3, "Iris-virginica"], + [6.5, 3, 5.5, 1.8, "Iris-virginica"], + [7.7, 3.8, 6.7, 2.2, "Iris-virginica"], + [7.7, 2.6, 6.9, 2.3, "Iris-virginica"], + [6, 2.2, 5, 1.5, "Iris-virginica"], + [6.9, 3.2, 5.7, 2.3, "Iris-virginica"], + [5.6, 2.8, 4.9, 2, "Iris-virginica"], + [7.7, 2.8, 6.7, 2, "Iris-virginica"], + [6.3, 2.7, 4.9, 1.8, "Iris-virginica"], + [6.7, 3.3, 5.7, 2.1, "Iris-virginica"] + ], + "test": [ + [5, 3, 1.6, 0.2, "Iris-setosa"], + [5, 3.4, 1.6, 0.4, "Iris-setosa"], + [5.2, 3.5, 1.5, 0.2, "Iris-setosa"], + [5.2, 3.4, 1.4, 0.2, "Iris-setosa"], + [4.7, 3.2, 1.6, 0.2, "Iris-setosa"], + [4.8, 3.1, 1.6, 0.2, "Iris-setosa"], + [5.4, 3.4, 1.5, 0.4, "Iris-setosa"], + [5.2, 4.1, 1.5, 0.1, "Iris-setosa"], + [5.5, 4.2, 1.4, 0.2, "Iris-setosa"], + [4.9, 3.1, 1.5, 0.1, "Iris-setosa"], + [5, 3.2, 1.2, 0.2, "Iris-setosa"], + [5.5, 3.5, 1.3, 0.2, "Iris-setosa"], + [4.9, 3.1, 1.5, 0.1, "Iris-setosa"], + [4.4, 3, 1.3, 0.2, "Iris-setosa"], + [5.1, 3.4, 1.5, 0.2, "Iris-setosa"], + [5, 3.5, 1.3, 0.3, "Iris-setosa"], + [4.5, 2.3, 1.3, 0.3, "Iris-setosa"], + [4.4, 3.2, 1.3, 0.2, "Iris-setosa"], + [5, 3.5, 1.6, 0.6, "Iris-setosa"], + [5.1, 3.8, 1.9, 0.4, "Iris-setosa"], + [4.8, 3, 1.4, 0.3, "Iris-setosa"], + [5.1, 3.8, 1.6, 0.2, "Iris-setosa"], + [4.6, 3.2, 1.4, 0.2, "Iris-setosa"], + [5.3, 3.7, 1.5, 0.2, "Iris-setosa"], + [5, 3.3, 1.4, 0.2, "Iris-setosa"], + [6.6, 3, 4.4, 1.4, "Iris-versicolor"], + [6.8, 2.8, 4.8, 1.4, "Iris-versicolor"], + [6.7, 3, 5, 1.7, "Iris-versicolor"], + [6, 2.9, 4.5, 1.5, "Iris-versicolor"], + [5.7, 2.6, 3.5, 1, "Iris-versicolor"], + [5.5, 2.4, 3.8, 1.1, "Iris-versicolor"], + [5.5, 2.4, 3.7, 1, "Iris-versicolor"], + [5.8, 2.7, 3.9, 1.2, "Iris-versicolor"], + [6, 2.7, 5.1, 1.6, "Iris-versicolor"], + [5.4, 3, 4.5, 1.5, "Iris-versicolor"], + [6, 3.4, 4.5, 1.6, "Iris-versicolor"], + [6.7, 3.1, 4.7, 1.5, "Iris-versicolor"], + [6.3, 2.3, 4.4, 1.3, "Iris-versicolor"], + [5.6, 3, 4.1, 1.3, "Iris-versicolor"], + [5.5, 2.5, 4, 1.3, "Iris-versicolor"], + [5.5, 2.6, 4.4, 1.2, "Iris-versicolor"], + [6.1, 3, 4.6, 1.4, "Iris-versicolor"], + [5.8, 2.6, 4, 1.2, "Iris-versicolor"], + [5, 2.3, 3.3, 1, "Iris-versicolor"], + [5.6, 2.7, 4.2, 1.3, "Iris-versicolor"], + [5.7, 3, 4.2, 1.2, "Iris-versicolor"], + [5.7, 2.9, 4.2, 1.3, "Iris-versicolor"], + [6.2, 2.9, 4.3, 1.3, "Iris-versicolor"], + [5.1, 2.5, 3, 1.1, "Iris-versicolor"], + [5.7, 2.8, 4.1, 1.3, "Iris-versicolor"], + [7.2, 3.2, 6, 1.8, "Iris-virginica"], + [6.2, 2.8, 4.8, 1.8, "Iris-virginica"], + [6.1, 3, 4.9, 1.8, "Iris-virginica"], + [6.4, 2.8, 5.6, 2.1, "Iris-virginica"], + [7.2, 3, 5.8, 1.6, "Iris-virginica"], + [7.4, 2.8, 6.1, 1.9, "Iris-virginica"], + [7.9, 3.8, 6.4, 2, "Iris-virginica"], + [6.4, 2.8, 5.6, 2.2, "Iris-virginica"], + [6.3, 2.8, 5.1, 1.5, "Iris-virginica"], + [6.1, 2.6, 5.6, 1.4, "Iris-virginica"], + [7.7, 3, 6.1, 2.3, "Iris-virginica"], + [6.3, 3.4, 5.6, 2.4, "Iris-virginica"], + [6.4, 3.1, 5.5, 1.8, "Iris-virginica"], + [6, 3, 4.8, 1.8, "Iris-virginica"], + [6.9, 3.1, 5.4, 2.1, "Iris-virginica"], + [6.7, 3.1, 5.6, 2.4, "Iris-virginica"], + [6.9, 3.1, 5.1, 2.3, "Iris-virginica"], + [5.8, 2.7, 5.1, 1.9, "Iris-virginica"], + [6.8, 3.2, 5.9, 2.3, "Iris-virginica"], + [6.7, 3.3, 5.7, 2.5, "Iris-virginica"], + [6.7, 3, 5.2, 2.3, "Iris-virginica"], + [6.3, 2.5, 5, 1.9, "Iris-virginica"], + [6.5, 3, 5.2, 2, "Iris-virginica"], + [6.2, 3.4, 5.4, 2.3, "Iris-virginica"], + [5.9, 3, 5.1, 1.8, "Iris-virginica"] + ] +} diff --git a/tests/test_11k.py b/tests/test_11k.py index 2a82b459b6f4dab5002723e51e3907667ad9c8ee..b08a249ca592334fef3816171fbcc11aa60ad19a 100644 --- a/tests/test_11k.py +++ b/tests/test_11k.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for TBX11K simplified dataset split 1.""" import pytest diff --git a/tests/test_11k_RS.py b/tests/test_11k_RS.py index 9cbcee2046841bb402929158d55b0a92100e49e5..1f9d975d95e50c1166dff3d5f8fad939948956bd 100644 --- a/tests/test_11k_RS.py +++ b/tests/test_11k_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Extended TBX11K simplified dataset split 1.""" import pytest diff --git a/tests/test_11k_v2.py b/tests/test_11k_v2.py index 8751a9b8a136d37261966b962152a03c3a81b1e3..9feab3ce74ffe53d414771908ce3ba63a8db74de 100644 --- a/tests/test_11k_v2.py +++ b/tests/test_11k_v2.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for TBX11K simplified dataset split 2.""" import pytest diff --git a/tests/test_11k_v2_RS.py b/tests/test_11k_v2_RS.py index 4b1c7a4c3f8bb28d830d34f767cf5ac964075414..590d2872ac915ef9f61eaea91d45dd2e9d911f4c 100644 --- a/tests/test_11k_v2_RS.py +++ b/tests/test_11k_v2_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Extended TBX11K simplified dataset split 2.""" import pytest diff --git a/tests/test_ch_RS.py b/tests/test_ch_RS.py index fbe1c3b6cabcfd2a25aa2bedf22bdd379a0626d7..0f1fa60252a21f5658729d27dcb1cf82e8c81fe3 100644 --- a/tests/test_ch_RS.py +++ b/tests/test_ch_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Extended Shenzhen dataset.""" import pytest diff --git a/tests/test_cli.py b/tests/test_cli.py index dd6e34459b383a575d9a0eaac610f500168d5326..67b39bd742d34ea8f30fa8555a003f1c68fbe3cf 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for our CLI applications.""" import contextlib diff --git a/tests/test_database_split.py b/tests/test_database_split.py index 851a10975d14900de91f007abbfb575754bff9de..aa360e2c889952d976252aac68725dbc6ced1095 100644 --- a/tests/test_database_split.py +++ b/tests/test_database_split.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Test code for datasets.""" from ptbench.data.split import CSVDatabaseSplit, JSONDatabaseSplit @@ -14,14 +13,14 @@ def test_csv_loading(datadir): assert len(database_split["iris-train"]) == 75 for k in database_split["iris-train"]: for f in range(4): - assert type(k[f]) == str # csv only loads stringd - assert type(k[4]) == str + assert isinstance(k[f], str) # csv only loads stringd + assert isinstance(k[4], str) assert len(database_split["iris-test"]) == 75 for k in database_split["iris-test"]: for f in range(4): - assert type(k[f]) == str # csv only loads stringd - assert type(k[4]) == str + assert isinstance(k[f], str) # csv only loads stringd + assert isinstance(k[4], str) assert k[4] in ("Iris-setosa", "Iris-versicolor", "Iris-virginica") @@ -33,11 +32,11 @@ def test_json_loading(datadir): assert len(database_split["train"]) == 75 for k in database_split["train"]: for f in range(4): - assert type(k[f]) in [int, float] - assert type(k[4]) == str + assert isinstance(k[f], (int, float)) + assert isinstance(k[4], str) assert len(database_split["test"]) == 75 for k in database_split["test"]: for f in range(4): - assert type(k[f]) in [int, float] - assert type(k[4]) == str + assert isinstance(k[f], (int, float)) + assert isinstance(k[4], str) diff --git a/tests/test_hivtb.py b/tests/test_hivtb.py index 0398085a1ae401ea854e9386a6014d501e187a2d..37876051415f25dcc7d43072af08c27c9f8ff0a9 100644 --- a/tests/test_hivtb.py +++ b/tests/test_hivtb.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for HIV-TB dataset.""" import pytest diff --git a/tests/test_hivtb_RS.py b/tests/test_hivtb_RS.py index fb9732b4ced25e396e7f6f131a487b7152adc5dd..9a440598c9316e3fc6bab487f2f2d6123c1b666c 100644 --- a/tests/test_hivtb_RS.py +++ b/tests/test_hivtb_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for HIV-TB_RS dataset.""" import pytest diff --git a/tests/test_image_utils.py b/tests/test_image_utils.py index 3b56fad9238808d96a8ec0cb24108a0b95dc0b1d..e6da9ceed2abcd7442a144324b298ef232340982 100644 --- a/tests/test_image_utils.py +++ b/tests/test_image_utils.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for image utilities.""" import numpy diff --git a/tests/test_in_RS.py b/tests/test_in_RS.py index b4215593909cc99de4fa5ab1b8b25cea1e371198..551265ad9546bff576c46f8fcb167585cacf7892 100644 --- a/tests/test_in_RS.py +++ b/tests/test_in_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Extended Indian dataset.""" import pytest diff --git a/tests/test_indian.py b/tests/test_indian.py index f7d16ff8e56ab3475d1dbc5b4808c1c6c2e13a9a..87660c1af4073fde09cc13d5a6f616d9180a3e4e 100644 --- a/tests/test_indian.py +++ b/tests/test_indian.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Indian dataset.""" import pytest diff --git a/tests/test_mc_RS.py b/tests/test_mc_RS.py index 4f7b4e6e0491c65b72f1509174898e1eb0bad0fc..a0175c23f8d00556b041792b378001eec1430962 100644 --- a/tests/test_mc_RS.py +++ b/tests/test_mc_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Extended Montgomery dataset.""" import pytest diff --git a/tests/test_mc_ch.py b/tests/test_mc_ch.py index 885576334e31401a494d4de9775a667a160fdae9..17c1fb4c49ee6f0e88e6468f459109643a9bf71a 100644 --- a/tests/test_mc_ch.py +++ b/tests/test_mc_ch.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen dataset.""" import pytest diff --git a/tests/test_mc_ch_RS.py b/tests/test_mc_ch_RS.py index 327998b179fea0471fb06482dafdf8e3cd10ef29..7e91622906cf9b6497e6d73ee3b29d0e9cf0b42b 100644 --- a/tests/test_mc_ch_RS.py +++ b/tests/test_mc_ch_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen dataset.""" import pytest diff --git a/tests/test_mc_ch_in.py b/tests/test_mc_ch_in.py index a3ae89318c31993326dda913453c21bf64d2c4f6..7305b66b7777f390c23a77a758f3dc5371fdb1bc 100644 --- a/tests/test_mc_ch_in.py +++ b/tests/test_mc_ch_in.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" import pytest diff --git a/tests/test_mc_ch_in_11k.py b/tests/test_mc_ch_in_11k.py index f7be318e2d014ac44544cad267feed1569170982..964faf06ec8feba1fb8b7f50d38cbd6c225e061b 100644 --- a/tests/test_mc_ch_in_11k.py +++ b/tests/test_mc_ch_in_11k.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" import pytest diff --git a/tests/test_mc_ch_in_11k_RS.py b/tests/test_mc_ch_in_11k_RS.py index bc3fcfb541ccd133c8523facc8c4f15812658de6..f8843befc928558ae9917eed3f41549dfd798e31 100644 --- a/tests/test_mc_ch_in_11k_RS.py +++ b/tests/test_mc_ch_in_11k_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian-tbx11k_simplified dataset.""" diff --git a/tests/test_mc_ch_in_11kv2.py b/tests/test_mc_ch_in_11kv2.py index 1c514fd61f81705a254093cc9bbf29594df4d188..a4d801d6cc7f61a0ced15b0dfa9c6de52f573986 100644 --- a/tests/test_mc_ch_in_11kv2.py +++ b/tests/test_mc_ch_in_11kv2.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" import pytest diff --git a/tests/test_mc_ch_in_11kv2_RS.py b/tests/test_mc_ch_in_11kv2_RS.py index d8143a4b848debc0af0016d2c09ee0723f4c90ba..3c128968613ebc33198643407283bb5810b2725f 100644 --- a/tests/test_mc_ch_in_11kv2_RS.py +++ b/tests/test_mc_ch_in_11kv2_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian-tbx11k_simplified_v2 dataset.""" diff --git a/tests/test_mc_ch_in_RS.py b/tests/test_mc_ch_in_RS.py index 14283d893cb411420dd935a5d2fc29198b08b6ba..1600f60ba45e0f503f34224b144d0ed84259d361 100644 --- a/tests/test_mc_ch_in_RS.py +++ b/tests/test_mc_ch_in_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian dataset.""" import pytest diff --git a/tests/test_mc_ch_in_pc.py b/tests/test_mc_ch_in_pc.py index 1680fdedaada7653b35c457ccc464db8395d1055..8aa38bef456e8f153ab596f09f26baa4a2c42788 100644 --- a/tests/test_mc_ch_in_pc.py +++ b/tests/test_mc_ch_in_pc.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian-Padchest dataset.""" import pytest diff --git a/tests/test_mc_ch_in_pc_RS.py b/tests/test_mc_ch_in_pc_RS.py index 21c568569c81e18ba1e6339bf67a89aa6ff65715..1014fb1df1c3d606ea1abe69693e7244c06d667f 100644 --- a/tests/test_mc_ch_in_pc_RS.py +++ b/tests/test_mc_ch_in_pc_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated Montgomery-Shenzhen-Indian-Padchest(TB) dataset.""" import pytest diff --git a/tests/test_measures.py b/tests/test_measures.py index 181ea8a596c0e3a3a6090a8c06d75b80ff109b01..69bcdc3c0d6c748f75897fd2b7942497a8fd7f19 100644 --- a/tests/test_measures.py +++ b/tests/test_measures.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for measure functions.""" import random diff --git a/tests/test_nih_cxr14.py b/tests/test_nih_cxr14.py index 78f0ce097bd4c5b9bc2901f7251078aab090438f..d7cc149a788072db3a3f2a5c48b2fb788f620951 100644 --- a/tests/test_nih_cxr14.py +++ b/tests/test_nih_cxr14.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for NIH CXR14 dataset.""" import pytest diff --git a/tests/test_nih_cxr14_pc.py b/tests/test_nih_cxr14_pc.py index 3b951f2f11897e8789ec1676c57cf98018b5e56a..05ae5a13ec648b75e566646330a9803fda22b453 100644 --- a/tests/test_nih_cxr14_pc.py +++ b/tests/test_nih_cxr14_pc.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for the aggregated NIH CXR14-PadChest dataset.""" import pytest diff --git a/tests/test_pc.py b/tests/test_pc.py index 6f013cdeadc7ac8925ba32bae7eef87412f34bf3..1ac31cbd3a0febd2201f04f42d4c1840b11db8bc 100644 --- a/tests/test_pc.py +++ b/tests/test_pc.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Padchest dataset.""" import pytest diff --git a/tests/test_pc_RS.py b/tests/test_pc_RS.py index e895dbea21e164be53f9adc23c3d8175b27878de..c62ef78001634cd04ecc93eaf0c7dc4fb0d22ffd 100644 --- a/tests/test_pc_RS.py +++ b/tests/test_pc_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Extended Padchest dataset.""" import pytest diff --git a/tests/test_shenzhen.py b/tests/test_shenzhen.py index 1452a232b87ea64958acef5be85b522da3e0f64a..6e577081a83a075c92a4808bbfb1c876d247fdde 100644 --- a/tests/test_shenzhen.py +++ b/tests/test_shenzhen.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for Shenzhen dataset.""" import importlib diff --git a/tests/test_tbpoc.py b/tests/test_tbpoc.py index b7be97d96fb1f00a1f17293e98fc3090fd8b1d62..9609ea66be7f59a655f744cba8b7f94e8cafb382 100644 --- a/tests/test_tbpoc.py +++ b/tests/test_tbpoc.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for TB-POC dataset.""" import pytest diff --git a/tests/test_tbpoc_RS.py b/tests/test_tbpoc_RS.py index 175bb5fbf9f6e70287285a4c4723488e705d1e3a..72f3e5968ba755319c9c36b3b206e342639b7152 100644 --- a/tests/test_tbpoc_RS.py +++ b/tests/test_tbpoc_RS.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for TB-POC_RS dataset.""" import pytest diff --git a/tests/test_tranforms.py b/tests/test_tranforms.py index c02c80d077e1e43f73451b01d32a9e9066067934..2c324aa1691d897c6acb0f9c71e7bd4f9d2cb089 100644 --- a/tests/test_tranforms.py +++ b/tests/test_tranforms.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch> # # SPDX-License-Identifier: GPL-3.0-or-later - """Tests for transforms.""" import numpy