Initial commit
Browse files- docbank.py +5 -5
docbank.py
CHANGED
|
@@ -170,11 +170,11 @@ class Docbank(datasets.GeneratorBasedBuilder):
|
|
| 170 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
| 171 |
urls = _URLS[self.config.name]
|
| 172 |
data_dir = dl_manager.download_and_extract(urls)
|
| 173 |
-
print(data_dir)
|
| 174 |
-
train_txts = glob(data_dir + '/train/txt/*.csv')
|
| 175 |
-
train_data = [(txt, data_dir + '/train/img/' + os.path.basename(txt)[:-4] + '.jpg') for txt in train_txts]
|
| 176 |
-
test_txts = glob(data_dir + '/test/txt/*.csv')
|
| 177 |
-
test_data = [(txt, data_dir + '/test/img/' + os.path.basename(txt)[:-4] + '.jpg') for txt in test_txts]
|
| 178 |
# with open(os.path.join(data_dir, "train.csv")) as f:
|
| 179 |
# files_train = [{'id': row['id'], 'filepath_txt': os.path.join(data_dir, row['filepath_txt']),
|
| 180 |
# 'filepath_img': os.path.join(data_dir, row['filepath_img'])} for row in
|
|
|
|
| 170 |
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
| 171 |
urls = _URLS[self.config.name]
|
| 172 |
data_dir = dl_manager.download_and_extract(urls)
|
| 173 |
+
#print(data_dir)
|
| 174 |
+
train_txts = glob(data_dir['train'] + '/train/txt/*.csv')
|
| 175 |
+
train_data = [(txt, data_dir['train'] + '/train/img/' + os.path.basename(txt)[:-4] + '.jpg') for txt in train_txts]
|
| 176 |
+
test_txts = glob(data_dir['test'] + '/test/txt/*.csv')
|
| 177 |
+
test_data = [(txt, data_dir['test'] + '/test/img/' + os.path.basename(txt)[:-4] + '.jpg') for txt in test_txts]
|
| 178 |
# with open(os.path.join(data_dir, "train.csv")) as f:
|
| 179 |
# files_train = [{'id': row['id'], 'filepath_txt': os.path.join(data_dir, row['filepath_txt']),
|
| 180 |
# 'filepath_img': os.path.join(data_dir, row['filepath_img'])} for row in
|