Skip to content
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
2 changes: 1 addition & 1 deletion pythia/common/defaults/configs/tasks/vqa/textvqa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ task_attributes:
return_info: true
# Return OCR information
use_ocr: true
# Return spatial information of OCR tokens if present
# Return spatial information of OCR tokens if present (main)
use_ocr_info: false
training_parameters:
monitored_metric: textvqa_vqa_accuracy
Expand Down
2 changes: 2 additions & 0 deletions pythia/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
from .base_dataset import BaseDataset

__all__ = ["BaseTask", "BaseDatasetBuilder", "BaseDataset", "MultiTask"]

print(" ## Test1 : Checking whether this tasks is getting initialized or not ## ")
2 changes: 2 additions & 0 deletions pythia/tasks/vqa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
__all__ = ["VQATask"]

from .vqa_task import VQATask

print(" ## Test2 : Checking whether this vqa_task is getting initialized or not ## ")
2 changes: 2 additions & 0 deletions pythia/tasks/vqa/textvqa/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Copyright (c) Facebook, Inc. and its affiliates.

print(" ## Test3 : Checking whether this textvqa task is getting initialized or not ## ")
2 changes: 2 additions & 0 deletions pythia/tasks/vqa/vqa2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

from .builder import VQA2Builder
from .dataset import VQA2Dataset

print(" ## Test4 : Checking whether this vqa2 is getting initialized or not ## ")
2 changes: 2 additions & 0 deletions pythia/tasks/vqa/vqa2/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def add_ocr_details(self, sample_info, sample):
self.ocr_token_processor({"text": token})["text"]
for token in sample_info["ocr_tokens"]
]
print(" ## Test5 : checking for OCR tokens # ")
print(ocr_tokens)
# Get embeddings for tokens
context = self.context_processor({"tokens": ocr_tokens})
sample.context = context["text"]
Expand Down
2 changes: 2 additions & 0 deletions pythia/tasks/vqa/vqa2/ocr_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

@Registry.register_builder("vqa2_ocr")
class TextVQABuilder(VizWizBuilder):
print(" ## Test6 : VQA2OCRDataset # ")
#print(ocr_tokens)
def __init__(self):
super().__init__()
self.dataset_name = "VQA2_OCR"
Expand Down