Datasets:
Tasks:
Image Classification
Sub-tasks:
multi-class-image-classification
Languages:
English
Size:
100K<n<1M
ArXiv:
License:
Add logger
Browse files
NIH-Chest-X-ray-dataset.py
CHANGED
@@ -5,6 +5,8 @@ from datasets.tasks import ImageClassification
|
|
5 |
|
6 |
from requests import get
|
7 |
|
|
|
|
|
8 |
|
9 |
_HOMEPAGE = "https://nihcc.app.box.com/v/ChestXray-NIHCC"
|
10 |
|
@@ -92,9 +94,10 @@ class XChest(datasets.GeneratorBasedBuilder):
|
|
92 |
|
93 |
def _split_generators(self, dl_manager):
|
94 |
# Get the image names that belong to the train-val dataset
|
|
|
95 |
train_val_list = get(_URLS['train_val_list']).iter_lines()
|
96 |
train_val_list = set([x.decode('UTF8') for x in train_val_list])
|
97 |
-
|
98 |
|
99 |
# Create list for store the name of the images for each dataset
|
100 |
train_files = []
|
@@ -106,6 +109,7 @@ class XChest(datasets.GeneratorBasedBuilder):
|
|
106 |
# Iterate trought image folder and check if they belong to
|
107 |
# the trainset or testset
|
108 |
for batch in data_files:
|
|
|
109 |
for img in dl_manager.download_and_extract(batch):
|
110 |
if img in train_val_list:
|
111 |
train_files.append(img)
|
|
|
5 |
|
6 |
from requests import get
|
7 |
|
8 |
+
logger = datasets.logging.get_logger(__name__)
|
9 |
+
|
10 |
|
11 |
_HOMEPAGE = "https://nihcc.app.box.com/v/ChestXray-NIHCC"
|
12 |
|
|
|
94 |
|
95 |
def _split_generators(self, dl_manager):
|
96 |
# Get the image names that belong to the train-val dataset
|
97 |
+
logger.info("Downloading the train_val_list image names")
|
98 |
train_val_list = get(_URLS['train_val_list']).iter_lines()
|
99 |
train_val_list = set([x.decode('UTF8') for x in train_val_list])
|
100 |
+
logger.info(f"Check train_val_list: {train_val_llist}")
|
101 |
|
102 |
# Create list for store the name of the images for each dataset
|
103 |
train_files = []
|
|
|
109 |
# Iterate trought image folder and check if they belong to
|
110 |
# the trainset or testset
|
111 |
for batch in data_files:
|
112 |
+
logger.info(f"Batch for data_files: {batch}")
|
113 |
for img in dl_manager.download_and_extract(batch):
|
114 |
if img in train_val_list:
|
115 |
train_files.append(img)
|