Skip to content
Snippets Groups Projects
Commit 549dcba0 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[bob] Lowercase all new datasets (CXR)

parent 23a01bed
No related branches found
No related tags found
No related merge requests found
Pipeline #54360 canceled
Showing
with 78 additions and 87 deletions
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
def _maker(protocol): def _maker(protocol):
from ....data.JSRT import dataset as raw from ....data.jsrt import dataset as raw
from ....data.transforms import Resize from ....data.transforms import Resize
from .. import make_dataset as mk from .. import make_dataset as mk
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
"""Japanese Society of Radiological Technology dataset for Lung Segmentation (default protocol) """Japanese Society of Radiological Technology dataset for Lung Segmentation (default protocol)
* Split reference: [GAÁL-2020]_ * Split reference: [GAAL-2020]_
* Configuration resolution: 512 x 512 * Configuration resolution: 512 x 512
* See :py:mod:`bob.ip.binseg.data.JSRT` for dataset details * See :py:mod:`bob.ip.binseg.data.jsrt` for dataset details
""" """
from bob.ip.binseg.configs.datasets.JSRT import _maker from bob.ip.binseg.configs.datasets.jsrt import _maker
dataset = _maker("default") dataset = _maker("default")
#!/usr/bin/env python #!/usr/bin/env python
# coding=utf-8 # coding=utf-8
"""JSRT cross-evaluation dataset """JSRT CXR cross-evaluation dataset
""" """
from bob.ip.binseg.configs.datasets.JSRT.default import dataset as _jsrt from bob.ip.binseg.configs.datasets.jsrt.default import dataset as _jsrt
from bob.ip.binseg.configs.datasets.MC.default import dataset as _mc from bob.ip.binseg.configs.datasets.montgomery.default import dataset as _mc
from bob.ip.binseg.configs.datasets.Shenzhen.default import dataset as _shenzhen from bob.ip.binseg.configs.datasets.shenzhen.default import dataset as _shenzhen
dataset = { dataset = {
"train": _jsrt["train"], "train": _jsrt["train"],
"validation": _jsrt["validation"], "validation": _jsrt["validation"],
"test": _jsrt["test"], "test": _jsrt["test"],
"MC (train)": _mc["train"], "montgomery (train)": _mc["train"],
"MC (validation)": _mc["validation"], "montgomery (validation)": _mc["validation"],
"MC (test)": _mc["test"], "montgomery (test)": _mc["test"],
"Shenzhen (train)": _shenzhen["train"], "shenzhen (train)": _shenzhen["train"],
"Shenzhen (validation)": _shenzhen["validation"], "shenzhen (validation)": _shenzhen["validation"],
"Shenzhen (test)": _shenzhen["test"], "shenzhen (test)": _shenzhen["test"],
} }
#!/usr/bin/env python
# coding=utf-8
"""MC cross-evaluation dataset
"""
from bob.ip.binseg.configs.datasets.JSRT.default import dataset as _jsrt
from bob.ip.binseg.configs.datasets.MC.default import dataset as _mc
from bob.ip.binseg.configs.datasets.Shenzhen.default import dataset as _shenzhen
dataset = {
"train": _mc["train"],
"validation": _mc["validation"],
"test": _mc["test"],
"JSRT (train)": _jsrt["train"],
"JSRT (validation)": _jsrt["validation"],
"JSRT (test)": _jsrt["test"],
"Shenzhen (train)": _shenzhen["train"],
"Shenzhen (validation)": _shenzhen["validation"],
"Shenzhen (test)": _shenzhen["test"],
}
...@@ -2,19 +2,10 @@ ...@@ -2,19 +2,10 @@
# coding=utf-8 # coding=utf-8
def _maker(protocol): def _maker(protocol, n):
from ....data.Shenzhen import dataset as raw from ....data.shenzhen import dataset as raw
from ....data.transforms import Resize from ....data.transforms import Resize
from .. import make_dataset as mk from .. import make_dataset as mk
return mk(raw.subsets(protocol), [Resize((512, 512))]) return mk(raw.subsets(protocol), [Resize((n, n))])
def _maker_256(protocol):
from ....data.Shenzhen import dataset as raw
from ....data.transforms import Resize
from .. import make_dataset as mk
return mk(raw.subsets(protocol), [Resize((256, 256))])
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
"""Shenzhen dataset for Lung Segmentation (default protocol) """Shenzhen dataset for Lung Segmentation (default protocol)
* Split reference: [GAÁL-2020]_ * Split reference: [GAAL-2020]_
* Configuration resolution: 512 x 512 * Configuration resolution: 512 x 512
* See :py:mod:`bob.ip.binseg.data.Shenzhen` for dataset details * See :py:mod:`bob.ip.binseg.data.shenzhen` for dataset details
""" """
from bob.ip.binseg.configs.datasets.Shenzhen import _maker from bob.ip.binseg.configs.datasets.shenzhen import _maker
dataset = _maker("default") dataset = _maker("default", 512)
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
"""Shenzhen dataset for Lung Segmentation (default protocol) """Shenzhen dataset for Lung Segmentation (default protocol)
* Split reference: [GAÁL-2020]_ * Split reference: [GAAL-2020]_
* Configuration resolution: 512 x 512 * Configuration resolution: 256 x 256 pixels
* See :py:mod:`bob.ip.binseg.data.Shenzhen` for dataset details * See :py:mod:`bob.ip.binseg.data.shenzhen` for dataset details
""" """
from bob.ip.binseg.configs.datasets.Shenzhen import _maker_256 from bob.ip.binseg.configs.datasets.shenzhen import _maker
dataset = _maker_256("default") dataset = _maker("default", 256)
...@@ -4,18 +4,18 @@ ...@@ -4,18 +4,18 @@
"""Shenzhen cross-evaluation dataset """Shenzhen cross-evaluation dataset
""" """
from bob.ip.binseg.configs.datasets.JSRT.default import dataset as _jsrt from bob.ip.binseg.configs.datasets.jsrt.default import dataset as _jsrt
from bob.ip.binseg.configs.datasets.MC.default import dataset as _mc from bob.ip.binseg.configs.datasets.montgomery.default import dataset as _mc
from bob.ip.binseg.configs.datasets.Shenzhen.default import dataset as _shenzhen from bob.ip.binseg.configs.datasets.shenzhen.default import dataset as _shenzhen
dataset = { dataset = {
"train": _shenzhen["train"], "train": _shenzhen["train"],
"validation": _shenzhen["validation"], "validation": _shenzhen["validation"],
"test": _shenzhen["test"], "test": _shenzhen["test"],
"MC (train)": _mc["train"], "montgomery (train)": _mc["train"],
"MC (validation)": _mc["validation"], "montgomery (validation)": _mc["validation"],
"MC (test)": _mc["test"], "montgomery (test)": _mc["test"],
"JSRT (train)": _jsrt["train"], "jsrt (train)": _jsrt["train"],
"JSRT (validation)": _jsrt["validation"], "jsrt (validation)": _jsrt["validation"],
"JSRT (test)": _jsrt["test"], "jsrt (test)": _jsrt["test"],
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
def _maker(protocol): def _maker(protocol):
from ....data.MC import dataset as raw from ....data.montgomery import dataset as raw
from ....data.transforms import Resize from ....data.transforms import Resize
from .. import make_dataset as mk from .. import make_dataset as mk
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
"""Montgomery County dataset for Lung Segmentation (default protocol) """Montgomery County dataset for Lung Segmentation (default protocol)
* Split reference: [GAÁL-2020]_ * Split reference: [GAAL-2020]_
* Configuration resolution: 512 x 512 * Configuration resolution: 512 x 512
* See :py:mod:`bob.ip.binseg.data.MC` for dataset details * See :py:mod:`bob.ip.binseg.data.montgomery` for dataset details
""" """
from bob.ip.binseg.configs.datasets.MC import _maker from bob.ip.binseg.configs.datasets.montgomery import _maker
dataset = _maker("default") dataset = _maker("default")
#!/usr/bin/env python
# coding=utf-8
"""Montgomery County cross-evaluation dataset
"""
from bob.ip.binseg.configs.datasets.jsrt.default import dataset as _jsrt
from bob.ip.binseg.configs.datasets.montgomery.default import dataset as _mc
from bob.ip.binseg.configs.datasets.shenzhen.default import dataset as _shenzhen
dataset = {
"train": _mc["train"],
"validation": _mc["validation"],
"test": _mc["test"],
"jsrt (train)": _jsrt["train"],
"jsrt (validation)": _jsrt["validation"],
"jsrt (test)": _jsrt["test"],
"shenzhen (train)": _shenzhen["train"],
"shenzhen (validation)": _shenzhen["validation"],
"shenzhen (test)": _shenzhen["test"],
}
...@@ -10,7 +10,7 @@ available. ...@@ -10,7 +10,7 @@ available.
* Reference: [JSRT-2000]_ * Reference: [JSRT-2000]_
* Original resolution (height x width): 2048 x 2048 * Original resolution (height x width): 2048 x 2048
* Configuration resolution: 512 x 512 (after rescaling) * Configuration resolution: 512 x 512 (after rescaling)
* Split reference: [GAÁL-2020]_ * Split reference: [GAAL-2020]_
* Protocol ``default``: * Protocol ``default``:
* Training samples: 172 (including labels) * Training samples: 172 (including labels)
...@@ -36,7 +36,7 @@ _protocols = [ ...@@ -36,7 +36,7 @@ _protocols = [
] ]
_root_path = bob.extension.rc.get( _root_path = bob.extension.rc.get(
"bob.ip.binseg.JSRT.datadir", os.path.realpath(os.curdir) "bob.ip.binseg.jsrt.datadir", os.path.realpath(os.curdir)
) )
......
...@@ -11,7 +11,7 @@ available for 566 of the 662 images. ...@@ -11,7 +11,7 @@ available for 566 of the 662 images.
* Reference: [SHENZHEN-2014]_ * Reference: [SHENZHEN-2014]_
* Original resolution (height x width): Approximately 3K x 3K (varies) * Original resolution (height x width): Approximately 3K x 3K (varies)
* Configuration resolution: 512 x 512 (after rescaling) * Configuration resolution: 512 x 512 (after rescaling)
* Split reference: [GAÁL-2020]_ * Split reference: [GAAL-2020]_
* Protocol ``default``: * Protocol ``default``:
* Training samples: 396 (including labels) * Training samples: 396 (including labels)
...@@ -34,7 +34,7 @@ _protocols = [ ...@@ -34,7 +34,7 @@ _protocols = [
] ]
_root_path = bob.extension.rc.get( _root_path = bob.extension.rc.get(
"bob.ip.binseg.Shenzhen.datadir", os.path.realpath(os.curdir) "bob.ip.binseg.shenzhen.datadir", os.path.realpath(os.curdir)
) )
...@@ -55,4 +55,4 @@ dataset = JSONDataset( ...@@ -55,4 +55,4 @@ dataset = JSONDataset(
protocols=_protocols, fieldnames=("data", "label"), loader=_loader protocols=_protocols, fieldnames=("data", "label"), loader=_loader
) )
"""Shenzhen dataset object""" """Shenzhen CXR dataset object"""
...@@ -10,7 +10,7 @@ normal cases. It contains a total of 138 resolution of 4020 x 4892, or ...@@ -10,7 +10,7 @@ normal cases. It contains a total of 138 resolution of 4020 x 4892, or
* Reference: [MC-2014]_ * Reference: [MC-2014]_
* Original resolution (height x width): 4020 x 4892, or 4892 x 4020 * Original resolution (height x width): 4020 x 4892, or 4892 x 4020
* Configuration resolution: 512 x 512 (after rescaling) * Configuration resolution: 512 x 512 (after rescaling)
* Split reference: [GAÁL-2020]_ * Split reference: [GAAL-2020]_
* Protocol ``default``: * Protocol ``default``:
* Training samples: 96 (including labels) * Training samples: 96 (including labels)
...@@ -36,7 +36,7 @@ _protocols = [ ...@@ -36,7 +36,7 @@ _protocols = [
] ]
_root_path = bob.extension.rc.get( _root_path = bob.extension.rc.get(
"bob.ip.binseg.MC.datadir", os.path.realpath(os.curdir) "bob.ip.binseg.montgomery.datadir", os.path.realpath(os.curdir)
) )
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
import numpy import numpy
import pytest import pytest
from ..data.JSRT import dataset from ..data.jsrt import dataset
from .utils import count_bw from .utils import count_bw
...@@ -32,7 +32,7 @@ def test_protocol_consistency(): ...@@ -32,7 +32,7 @@ def test_protocol_consistency():
assert s.key.startswith("JSRT") assert s.key.startswith("JSRT")
@pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.JSRT.datadir") @pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.jsrt.datadir")
def test_loading(): def test_loading():
image_size = (2048, 2048) image_size = (2048, 2048)
...@@ -74,6 +74,6 @@ def test_loading(): ...@@ -74,6 +74,6 @@ def test_loading():
del proportions # only to satisfy flake8 del proportions # only to satisfy flake8
@pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.JSRT.datadir") @pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.jsrt.datadir")
def test_check(): def test_check():
assert dataset.check() == 0 assert dataset.check() == 0
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
# coding=utf-8 # coding=utf-8
"""Tests for Montgomery County""" """Tests for Montgomery County CXR dataset"""
import numpy import numpy
import pytest import pytest
from ..data.MC import dataset from ..data.montgomery import dataset
from .utils import count_bw from .utils import count_bw
...@@ -32,7 +32,7 @@ def test_protocol_consistency(): ...@@ -32,7 +32,7 @@ def test_protocol_consistency():
assert s.key.startswith("MontgomerySet") assert s.key.startswith("MontgomerySet")
@pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.MC.datadir") @pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.montgomery.datadir")
def test_loading(): def test_loading():
image_size_1 = (4892, 4020) image_size_1 = (4892, 4020)
...@@ -80,6 +80,6 @@ def test_loading(): ...@@ -80,6 +80,6 @@ def test_loading():
del proportions # only to satisfy flake8 del proportions # only to satisfy flake8
@pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.MC.datadir") @pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.montgomery.datadir")
def test_check(): def test_check():
assert dataset.check() == 0 assert dataset.check() == 0
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
# coding=utf-8 # coding=utf-8
"""Tests for Shenzhen""" """Tests for Shenzhen CXR dataset"""
import numpy import numpy
import pytest import pytest
from ..data.Shenzhen import dataset from ..data.shenzhen import dataset
from .utils import count_bw from .utils import count_bw
...@@ -32,7 +32,7 @@ def test_protocol_consistency(): ...@@ -32,7 +32,7 @@ def test_protocol_consistency():
assert s.key.startswith("ChinaSet_AllFiles") assert s.key.startswith("ChinaSet_AllFiles")
@pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.Shenzhen.datadir") @pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.shenzhen.datadir")
def test_loading(): def test_loading():
min_image_size = (1130, 948) min_image_size = (1130, 948)
...@@ -76,6 +76,6 @@ def test_loading(): ...@@ -76,6 +76,6 @@ def test_loading():
del proportions # only to satisfy flake8 del proportions # only to satisfy flake8
@pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.Shenzhen.datadir") @pytest.mark.skip_if_rc_var_not_set("bob.ip.binseg.shenzhen.datadir")
def test_check(): def test_check():
assert dataset.check() == 0 assert dataset.check() == 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment