Skip to content
Snippets Groups Projects
Commit 128cc99d authored by Daniel CARRON's avatar Daniel CARRON :b:
Browse files

Renamed JSONDataset to JSONProtocol

parent dbb0d87e
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ from clapper.logging import setup
from ....data import return_subsets
from ....data.base_datamodule import BaseDataModule
from ....data.dataset import JSONDataset
from ....data.dataset import JSONProtocol
from ....data.shenzhen import _cached_loader, _delayed_loader, _protocols
logger = setup(__name__.split(".")[0], format="%(levelname)s: %(message)s")
......@@ -52,7 +52,7 @@ class DefaultModule(BaseDataModule):
)
samples_loader = _delayed_loader
json_dataset = JSONDataset(
json_protocol = JSONProtocol(
protocols=_protocols,
fieldnames=("data", "label"),
loader=samples_loader,
......@@ -63,7 +63,7 @@ class DefaultModule(BaseDataModule):
self.train_dataset,
self.validation_dataset,
self.extra_validation_datasets,
) = return_subsets(json_dataset, "default", stage)
) = return_subsets(json_protocol, "default", stage)
self.has_setup_fit = True
if not self.has_setup_predict and stage == "predict":
......@@ -71,7 +71,7 @@ class DefaultModule(BaseDataModule):
self.train_dataset,
self.validation_dataset,
self.extra_validation_datasets,
) = return_subsets(json_dataset, "default", stage)
) = return_subsets(json_protocol, "default", stage)
self.has_setup_predict = True
......
......@@ -14,7 +14,7 @@ from torchvision import transforms
from ....data import return_subsets
from ....data.base_datamodule import BaseDataModule
from ....data.dataset import JSONDataset
from ....data.dataset import JSONProtocol
from ....data.shenzhen import _cached_loader, _delayed_loader, _protocols
logger = setup(__name__.split(".")[0], format="%(levelname)s: %(message)s")
......@@ -57,7 +57,7 @@ class DefaultModule(BaseDataModule):
)
samples_loader = _delayed_loader
self.json_dataset = JSONDataset(
self.json_protocol = JSONProtocol(
protocols=_protocols,
fieldnames=("data", "label"),
loader=samples_loader,
......@@ -69,7 +69,7 @@ class DefaultModule(BaseDataModule):
self.train_dataset,
self.validation_dataset,
self.extra_validation_datasets,
) = return_subsets(self.json_dataset, "default", stage)
) = return_subsets(self.json_protocol, "default", stage)
self.has_setup_fit = True
......
......@@ -20,7 +20,7 @@ RANDOM_ROTATION = [RandomRotation(15)]
logger = logging.getLogger(__name__)
class JSONDataset:
class JSONProtocol:
"""Generic multi-protocol/subset filelist dataset that yields samples.
To create a new dataset, you need to provide one or more JSON formatted
......
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