Skip to content

Commit c9b021e

Browse files
committed
Use join for path concatenation
1 parent 9efc14f commit c9b021e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/py/label_dir.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
#mkdir ('scanned')
3838

3939
for image_file in img_files:
40-
image_data = tf.gfile.FastGFile(var_path+"/"+image_file, 'rb').read()
40+
image_data = tf.gfile.FastGFile(join(var_path, image_file), 'rb').read()
4141

42-
print (var_path+"/"+image_file)
42+
print join(var_path, image_file)
4343
predictions = sess.run(softmax_tensor, \
4444
{'DecodeJpeg/contents:0': image_data})
4545

@@ -49,7 +49,7 @@
4949

5050
new_file_name = label_lines[firstElt] +"--"+ str(predictions[0][firstElt])[2:7]+".jpg"
5151
print(new_file_name)
52-
copyfile(var_path+"/"+image_file, dest_dir+"/"+new_file_name)
52+
copyfile(join(var_path, image_file), join(dest_dir, new_file_name))
5353

5454
for node_id in top_k:
5555
human_string = label_lines[node_id]

0 commit comments

Comments
 (0)