uakarsh / latr

Implementation of LaTr: Layout-aware transformer for scene-text VQA,a novel multimodal architecture for Scene Text Visual Question Answering (STVQA)
https://uakarsh.github.io/latr/
MIT License
52 stars 7 forks source link

how to change dataser #4

Closed kobrafarshidi closed 2 years ago

kobrafarshidi commented 2 years ago

I am trying to run your project .First I start run with pre-training step by step until eighth block but in the ninth block you mention ## There can be error, if the Image file does not exist, so I request you to make changes in the dataset object, such that those address are removed ## and I have error but I cant understand where I should change in script dataset in src folder and what is image file? I would be grateful if you guided me through this.

uakarsh commented 2 years ago

HI @kobrafarshidi, can you let me know the error message you get, while running the code?

kobrafarshidi commented 2 years ago

yes sure .


TypeError Traceback (most recent call last) in 1 ## There can be error, if the Image file does not exist, so I request you to make changes in the dataset object, such that those address are removed 2 ----> 3 dl_entry = next(iter(dl)) 4 masked_boxes, masked_tokenized_words, tokenized_words = dl_entry

4 frames in getitem(self, idx) 39 use_ocr = False, 40 bounding_box = coordinates, ---> 41 words = words 42 ) 43 boxes = torch.as_tensor(boxes, dtype=torch.int32)

TypeError: create_features() got an unexpected keyword argument 'image_path'


TypeError Traceback (most recent call last) in 1 ## There can be error, if the Image file does not exist, so I request you to make changes in the dataset object, such that those address are removed 2 ----> 3 dl_entry = next(iter(dl)) 4 masked_boxes, masked_tokenized_words, tokenized_words = dl_entry

4 frames in getitem(self, idx) 39 use_ocr = False, 40 bounding_box = coordinates, ---> 41 words = words 42 ) 43 boxes = torch.as_tensor(boxes, dtype=torch.int32)

TypeError: create_features() got an unexpected keyword argument 'image_path'

kobrafarshidi commented 2 years ago

1e

uakarsh commented 2 years ago

I think, the code should be img, boxes, tokenized_words = create_features(img_path = tif_path, tokenizer = self.tokenizer, target_size = (1000, 1000), use_ocr = False, bounding_box = coordinates, words = words ), I think, I changed the name of the parameter after releasing the example. Do, let me know, if it works or not

The reference is taken from here

Regards, Akarsh

kobrafarshidi commented 2 years ago

yes I changed it and worked Many thanks for your assistant.