MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / ImageTransform

Function ImageTransform

data/docdata.py:8–21  ·  view source on GitHub ↗
(loadSize)

Source from the content-addressed store, hash-verified

6
7
8def ImageTransform(loadSize):
9 return {"train": Compose([
10 RandomCrop(loadSize, pad_if_needed=True, padding_mode='constant', fill=255),
11 RandomAffine(10, fill=255),
12 RandomHorizontalFlip(p=0.2),
13 ToTensor(),
14 ]), "test": Compose([
15 ToTensor(),
16 ]), "train_gt": Compose([
17 RandomCrop(loadSize, pad_if_needed=True, padding_mode='constant', fill=255),
18 RandomAffine(10, fill=255),
19 RandomHorizontalFlip(p=0.2),
20 ToTensor(),
21 ])}
22
23
24class DocData(Dataset):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected