|
@@ -84,7 +84,8 @@
|
|
|
" imagepaths, labels = list(), list()\n",
|
|
|
" if mode == 'file':\n",
|
|
|
" # Read dataset file\n",
|
|
|
- " data = open(dataset_path, 'r').read().splitlines()\n",
|
|
|
+ " with open(dataset_path) as f:\n",
|
|
|
+ " data = f.read().splitlines()\n",
|
|
|
" for d in data:\n",
|
|
|
" imagepaths.append(d.split(' ')[0])\n",
|
|
|
" labels.append(int(d.split(' ')[1]))\n",
|