Skip to content

Commit 03aa7c9

Browse files
committed
CSVs should be text files.
1 parent b4c7ea9 commit 03aa7c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

research/delf/delf/python/training/build_image_dataset.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _get_all_image_files_and_labels(name, csv_path, image_dir):
113113
image_paths = tf.io.gfile.glob(os.path.join(image_dir, '*.jpg'))
114114
file_ids = [os.path.basename(os.path.normpath(f))[:-4] for f in image_paths]
115115
if name == _TRAIN_SPLIT:
116-
with tf.io.gfile.GFile(csv_path, 'rb') as csv_file:
116+
with tf.io.gfile.GFile(csv_path, 'r') as csv_file:
117117
df = pd.read_csv(csv_file)
118118
df = df.set_index('id')
119119
labels = [int(df.loc[fid]['landmark_id']) for fid in file_ids]
@@ -140,7 +140,7 @@ def _get_clean_train_image_files_and_labels(csv_path, image_dir):
140140
a continuous set of labels.
141141
"""
142142
# Load the content of the CSV file (landmark_id/label -> images).
143-
with tf.io.gfile.GFile(csv_path, 'rb') as csv_file:
143+
with tf.io.gfile.GFile(csv_path, 'r') as csv_file:
144144
df = pd.read_csv(csv_file)
145145

146146
# Create the dictionary (key = image_id, value = {label, file_id}).

0 commit comments

Comments
 (0)