forked from isaaccorley/torchrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added InriaAIL dataset and datamodule, updated readme
- Loading branch information
1 parent
a58877c
commit 589b5ec
Showing
6 changed files
with
99 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from typing import Optional | ||
|
||
from torchrs.transforms import Compose, ToTensor | ||
from torchrs.datasets.utils import dataset_split | ||
from torchrs.train.datamodules import BaseDataModule | ||
from torchrs.datasets import InriaAIL | ||
|
||
|
||
class InriaAILDataModule(BaseDataModule): | ||
|
||
def __init__( | ||
self, | ||
root: str = ".data/AerialImageDataset", | ||
transform: Compose = Compose([ToTensor()]), | ||
*args, **kwargs | ||
): | ||
super().__init__(*args, **kwargs) | ||
self.root = root | ||
self.transform = transform | ||
|
||
def setup(self, stage: Optional[str] = None): | ||
train_dataset = InriaAIL(root=self.root, split="train", transform=self.transform) | ||
self.train_dataset, self.val_dataset = dataset_split(train_dataset, val_pct=self.val_split) | ||
self.test_dataset = InriaAIL(root=self.root, split="test", transform=self.transform) |