Skip to content

Commit

Permalink
internal
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 246656018
  • Loading branch information
MarkDaoust authored and copybara-github committed May 4, 2019
1 parent fabc828 commit 3191b90
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@
" img_path = os.path.join(base_dir, cl)\n",
" images = glob.glob(img_path + '/*.jpg')\n",
" print(\"{}: {} Images\".format(cl, len(images)))\n",
" train, val = images[:round(len(images)*0.8)], images[round(len(images)*0.8):]\n",
" num_train = int(round(len(images)*0.8))\n",
" train, val = images[:num_train], images[num_train:]\n",
"\n",
" for t in train:\n",
" if not os.path.exists(os.path.join(base_dir, 'train', cl)):\n",
Expand All @@ -294,6 +295,19 @@
" shutil.move(v, os.path.join(base_dir, 'val', cl))"
]
},
{
"cell_type": "code",
"execution_count": 0,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "yP85YhYol8ER"
},
"outputs": [],
"source": [
"round(len(images)*0.8)"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down

0 comments on commit 3191b90

Please sign in to comment.