Skip to content

Refactor VIEDataset by removing unused self.dataset #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions DocumentUnderstanding/GeoLayoutLM/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ def main():
)

dataset = VIEDataset(
cfg.dataset,
cfg.dataset_root_path,
cfg.task,
backbone_type,
cfg.model.head,
cfg.dataset_root_path,
net.tokenizer,
mode=mode,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ def _get_train_loader(self):
start_time = time.time()

dataset = VIEDataset(
self.cfg.dataset,
self.cfg.dataset_root_path,
self.cfg.task,
self.backbone_type,
self.cfg.model.head,
self.cfg.dataset_root_path,
self.tokenizer,
self.cfg.train.max_seq_length,
self.cfg.train.max_block_num,
Expand All @@ -74,11 +73,10 @@ def _get_train_loader(self):

def _get_val_test_loaders(self, mode):
dataset = VIEDataset(
self.cfg.dataset,
self.cfg.dataset_root_path,
self.cfg.task,
self.backbone_type,
self.cfg.model.head,
self.cfg.dataset_root_path,
self.tokenizer,
self.cfg.train.max_seq_length,
self.cfg.train.max_block_num,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,22 @@
class VIEDataset(Dataset):
def __init__(
self,
dataset,
dataset_root_path,
task,
backbone_type,
model_head,
dataset_root_path,
tokenizer,
max_seq_length=512,
max_block_num=256,
img_h=768,
img_w=768,
mode=None,
):
self.dataset = dataset
self.dataset_root_path = dataset_root_path
self.task = task
self.backbone_type = backbone_type
self.model_head = model_head

self.dataset_root_path = dataset_root_path
self.tokenizer = tokenizer
self.max_seq_length = max_seq_length
self.max_block_num = max_block_num
Expand Down