Update PlotQA_dataset.py
Browse files73 unmodified lines7475767778798079 unmodified lines1601611621631641651661671681693 unmodified lines17317417517617717817973 unmodified linesfeatures = datasets.Features({"imgname": datasets.Value("string"),"image": datasets.Image(),#"version": datasets.Value("string"),"query": datasets.Sequence(datasets.Value("string")),"query_token": datasets.Sequence(datasets.Value("string")),79 unmodified linesdef _generate_examples(self, annotation_v1_path:str, annotation_v2_path:str, img_anno_path:str ,images_path: str):#Load image folder# open filefile = tarfile.open(images_path)# extracting filefile.extractall('./imgs')file.close()_multi_anno = [annotation_v1_path, annotation_v2_path]idx = 03 unmodified linesitem = {}item["img_ann"] = eleitem["imgname"] = str(ele['image_index'])+'.png'item['image'] = os.path.join('./imgs',item['imgname'])item["query_token"] = []qa_returns = find_qa(annotation_v1_path,annotation_v2_path, item['image_index'])_question = []73 unmodified lines7475767778798079 unmodified lines1601611621631641651661671681693 unmodified lines17317417517617717817973 unmodified linesfeatures = datasets.Features({"imgname": datasets.Value("string"),#"image": datasets.Image(),#"version": datasets.Value("string"),"query": datasets.Sequence(datasets.Value("string")),"query_token": datasets.Sequence(datasets.Value("string")),79 unmodified linesdef _generate_examples(self, annotation_v1_path:str, annotation_v2_path:str, img_anno_path:str ,images_path: str):#Load image folder# open file## file = tarfile.open(images_path)# extracting file## file.extractall('./imgs')## file.close()_multi_anno = [annotation_v1_path, annotation_v2_path]idx = 03 unmodified linesitem = {}item["img_ann"] = eleitem["imgname"] = str(ele['image_index'])+'.png'# item['image'] = os.path.join('./imgs',item['imgname'])item["query_token"] = []qa_returns = find_qa(annotation_v1_path,annotation_v2_path, item['image_index'])_question = []
PlotQA_dataset.py+5-5