Datasets:
Update CC6204-Hackaton-Cub-Dataset.py
Browse files
CC6204-Hackaton-Cub-Dataset.py
CHANGED
|
@@ -108,13 +108,13 @@ class CubDataset(datasets.GeneratorBasedBuilder):
|
|
| 108 |
|
| 109 |
|
| 110 |
img_path_files = dl_manager.iter_files(img_data_files)
|
| 111 |
-
|
| 112 |
|
| 113 |
#for img, text in zip(img_path_files, text_path_files):
|
| 114 |
for img in img_path_files:
|
| 115 |
print(os.path.basename(img))
|
| 116 |
-
print(
|
| 117 |
-
text =
|
| 118 |
img_idx = _IMGNAME2ID[os.path.basename(img)]
|
| 119 |
if img_idx in _TRAIN_IDX_SET:
|
| 120 |
train_files.append((img, text))
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
img_path_files = dl_manager.iter_files(img_data_files)
|
| 111 |
+
text_path_files = dl_manager.iter_files(text_data_files)
|
| 112 |
|
| 113 |
#for img, text in zip(img_path_files, text_path_files):
|
| 114 |
for img in img_path_files:
|
| 115 |
print(os.path.basename(img))
|
| 116 |
+
print(text_path_files)
|
| 117 |
+
text = text_path_files[text_path_files.index(os.path.basename(img).replace("jpg", "txt"))]
|
| 118 |
img_idx = _IMGNAME2ID[os.path.basename(img)]
|
| 119 |
if img_idx in _TRAIN_IDX_SET:
|
| 120 |
train_files.append((img, text))
|