Created
April 17, 2020 18:45
-
-
Save JhoLee/31411bf2b29fe936d3fbc1d382f7afe9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Change pixel values...\n", | |
"### Example dataset is 'CelebA mask'\n", | |
"\n", | |
"20.04.18 [email protected]; git.8080.kr; blog.jholee.kr\n", | |
"\n", | |
"Made just for my own needs.\n", | |
"\n", | |
"---\n", | |
"\n", | |
"There are unexpected labels at the boundary lines of the mask.\n", | |
"(like 254, 174, ...)\n", | |
"\n", | |
"0 ~ 63 -> 0; 64 ~ 190 -> 1; 191 ~ 255 -> 2\n", | |
"\n", | |
"0: Background / \n", | |
"1: skin(face) / \n", | |
"2: hair" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import os\n", | |
"import sys\n", | |
"\n", | |
"ROOT_DIR = os.path.join(os.getcwd(), '..')\n", | |
"\n", | |
"import matplotlib.pyplot as plt\n", | |
"import seaborn as sns\n", | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"DATA_DIR = os.path.join(ROOT_DIR, 'dataset/celeba')\n", | |
"TRAIN_MASK_DIR = os.path.join(DATA_DIR, 'train/mask')\n", | |
"VAL_MASK_DIR = os.path.join(DATA_DIR, 'val/mask')\n", | |
"\n", | |
"TRAIN_OUT_DIR = os.path.join(DATA_DIR, 'train/mask_')\n", | |
"VAL_OUT_DIR = os.path.join(DATA_DIR, 'val/mask_')\n", | |
"\n", | |
"if not os.path.exists(TRAIN_OUT_DIR):\n", | |
" os.makedirs(TRAIN_OUT_DIR)\n", | |
"if not os.path.exists(VAL_OUT_DIR):\n", | |
" os.makedirs(VAL_OUT_DIR)\n", | |
"\n", | |
"train_masks = os.listdir(TRAIN_MASK_DIR)\n", | |
"val_masks = os.listdir(VAL_MASK_DIR)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 96, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from PIL import Image\n", | |
"import numpy as np\n", | |
"\n", | |
"def modify(images=[], in_dir=\"\", out_dir=\"\", values=[]):\n", | |
" count = 0\n", | |
" for image in images:\n", | |
" im = Image.open(os.path.join(in_dir, image))\n", | |
" ima = np.asarray(im)\n", | |
"\n", | |
" for i, v in enumerate(values):\n", | |
" ima = np.where(ima==v, i, ima)\n", | |
" \n", | |
" im = Image.fromarray(ima)\n", | |
" im.save(os.path.join(out_dir, image))\n", | |
"\n", | |
" count += 1\n", | |
" print(count) \n", | |
" \n", | |
"def modify2(images=[], in_dir=\"\", out_dir=\"\", in_val=[], out_val=[]):\n", | |
" count = 0\n", | |
" for image in images:\n", | |
" im = Image.open(os.path.join(in_dir, image))\n", | |
" ima = np.asarray(im)\n", | |
" \n", | |
" for iv, ov in zip(in_val, out_val):\n", | |
" if type(iv) == type([]):\n", | |
" for v in iv:\n", | |
" ima = np.where(ima==v, ov, ima)\n", | |
" else:\n", | |
" ima = np.where(ima==iv, ov, ima)\n", | |
" \n", | |
" im = Image.fromarray(ima)\n", | |
" im.save(os.path.join(out_dir, image))\n", | |
" \n", | |
" count += 1\n", | |
" print(count)\n", | |
" \n", | |
"def down_the_max(images=[], in_dir=\"\", out_dir=\"\", max_val=0):\n", | |
" bads = []\n", | |
" count = 0\n", | |
" for image in images:\n", | |
" im = Image.open(os.path.join(in_dir, image))\n", | |
" ima = np.asarray(im)\n", | |
" \n", | |
"\n", | |
" mx = np.max(ima[:, :])\n", | |
" if mx > max_val:\n", | |
" ima = np.where(ima==mx, max_val, ima)\n", | |
"# print(\"{} mx: {} max_val: {}\".format(image, mx, max_val))\n", | |
" if image not in bads:\n", | |
" bads.append(image)\n", | |
" im = Image.fromarray(ima)\n", | |
" im.save(os.path.join(out_dir, image))\n", | |
" \n", | |
" count += 1\n", | |
" print(\"{} / {}\".format(len(bads), count))\n", | |
" \n", | |
" return bads\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 97, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"3200\n" | |
] | |
} | |
], | |
"source": [ | |
"modify(train_masks, TRAIN_MASK_DIR, TRAIN_OUT_DIR, [0, 128, 255])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 98, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"355\n" | |
] | |
} | |
], | |
"source": [ | |
"modify(val_masks, VAL_MASK_DIR, VAL_OUT_DIR, [0, 128, 255])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 99, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"3200\n" | |
] | |
} | |
], | |
"source": [ | |
"modify2(train_masks, TRAIN_MASK_DIR, TRAIN_OUT_DIR, [0, 128, list(range(255, 256))], [0, 1, 2])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 100, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"355\n" | |
] | |
} | |
], | |
"source": [ | |
"modify2(val_masks, VAL_MASK_DIR, VAL_OUT_DIR, [0, 128, list(range(255, 256))], [0, 1, 2, 2])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 127, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"316 / 3200\n", | |
"355 / 355\n" | |
] | |
} | |
], | |
"source": [ | |
"bts = down_the_max(train_masks, TRAIN_OUT_DIR, TRAIN_OUT_DIR, max_val=2)\n", | |
"bvs = down_the_max(val_masks, VAL_OUT_DIR, VAL_OUT_DIR, max_val=2)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 165, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import random\n", | |
"rbtn = os.path.join(TRAIN_MASK_DIR, random.choice(bts))\n", | |
"rbt = np.asarray(Image.open(rbtn))\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 169, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"/home/jho/projects/image-segmentation-keras/train_faces/../dataset/celeba/train/mask/121208.bmp\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAU8AAADnCAYAAACe9dTFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAfWElEQVR4nO3deZRU1fX28e+2NSqgggJGERARlKDggKgMjgHFAfRVXOJEJBGMqGggyvCLUWICGmMCakiIKGoA40CCEYdANAgCCohMooKi0EKgGYIMKtK13z+6aBvorr5VXXTfOjwf11lU36q+T+3Vy71u3XvrHHN3REQkPftU9RsQEclFap4iIhlQ8xQRyYCap4hIBtQ8RUQysG85z+tSvIhEZVnYRzo9Jxt5GdORp4hIBso78hQRqTTp3HduVqUHnmqeIhIfhYlE5Nfum5e3B99JhPwqTRcRKcFz6DKLmqeIxEYid3qnmqeIxEcuzbWRdvNctWoVd911F2vXrmWfffbhqquuonv37jzyyCM899xzHHrooQD87Gc/4+yzzyY/P5+LLrqIRo0aAdCyZUsGDx4cq6wQawo1K8SaQs5KVyKHmifunmrsZvXq1b5w4UJ3d9+0aZN37NjRlyxZ4sOHD/fHH398t9evWLHCL7744tJ2Va7KygqxplCzQqwpoKzy+km5Y/PXX3vUkY28ioy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zgqxplCzQqypNLm09LBWz9xLs0KsKdSsEGsqUwyOKKPS6pl7YVaINYWaFWJNqTiJyKOqafXMvSwrxJpCzQqxpvLk0jnPtK+2h7DK396SFWJNoWaFUFM2rmAfcEB1jzqq+mq7bpIXkazwLNwkf8AB1SP3nK+/3qLVM0VEABJ78Lvt2abmKSKxEYtzmRGpeYpIfKh5ioikz1HzFBFJWy4tPazmKSKxEYevXUaV8lYlEREpnWaSFxHJgJqniEgG1DxFRDKg5ikikgE1TxGRDKh5iohk4P8DhID5HnhHf1IAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 2 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"print(rbtn)\n", | |
"sns.heatmap(rbt[70:80, 70:80], annot=True, fmt=\"d\", cmap=plt.cm.bone)\n", | |
"plt.axis(\"off\")\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 172, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.axes._subplots.AxesSubplot at 0x7f1b2984e160>" | |
] | |
}, | |
"execution_count": 172, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWAAAAD9CAYAAACC7q1lAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deZwdVZ338c8XgggTQlgkBIIEEAjgwhKC87BFQQU3QGQEn0cE0TgOi+sIKq9BdEBwBAZxBIPsCMiigGwKCAFFIBHZw75GIKyyDCCk+/f8UdV4uVvV7b7V91b1982rXl331KmqU53m19WnzvmVIgIzMxt9i/W6AWZmY5UDs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bUn742vb26TeNk3qbd/imNuQdCstBbyz2TEzjtus7np56pLkbp1B8lfHFiR/aR5fogQAAAIYSURBVHy4xfd0Bv/ozlkf+FrOulsC/9Gsbl29DUj6QVsdc7O6ui3bWrPPCsCKwOk5f3ZPzVlvMvBMB/9PnJaz3kXU3ZSM9cVTkbtI0p4RcdJI60laClgrIm7Pe8yRnD8dibI3yS+SDUkegl6QbrspIjZO1/cF9smq18kxh1n330h+AbZr60EkfeDjSJ4ZzCDpftqWJMXgITXHrK+7GXB1zrpNjzvC87er2+wtNe8n6T4g0rfUNKkn4H319To55gjP3/KYY1qvfwNUaSFnruS89YqqW1+PnCNR8tbrh7ppvcWBpUme7k9Iy5eisV+163ULPH+ukUAkfx3lHTHUyeiirp9/LC+jnQ2t9CTd2moTSV9wR/WKqtvJMUn65V8CiIiHJM0EzpW0elq/03r9UHdRRAwAL0u6PyJeSPd5RVL9S8OKqFvU+acDXyZ5qPvvEXGzpFciYk5dvU1y1uvkmEWdf8xyAO7cJOBDJA+ragm4bhj1iqrbyTGfkLRhRNwMEBEvSfooyWSWdw2jXj/UfU3S0hHxMkkwSC4+mQVZH9SKqFvI+SN54+RRks5Jvy6kyf/HeesVVbeTY45pvb4FL9sCnABs0WLbGZ3WK6puh8fMNRIlb71+qEs65rpJnRWpGe5XVN2izt+kTuZIoE7qFVW3k2OOpcUP4czMesTZ0MzMesQB2MysRxyAzcx6xAHYzKxHHIDNzHrk/wN7zv5tFIXsHgAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 2 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"sns.heatmap(rbt[50:100, 50:100], fmt=\"d\", cmap=plt.cm.bone)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 218, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def modify3(images=[], in_dir=\"\", out_dir=\"\", in_val=[], out_val=[]):\n", | |
" count = 0\n", | |
" \n", | |
" in_val_ = []\n", | |
" for i in range(0, len(in_val)-1):\n", | |
" in_val_.append((in_val[i]+in_val[i+1])//2)\n", | |
" in_val_.insert(0, 0)\n", | |
" in_val_.append(in_val[-1])\n", | |
" # [0, 128, 255] => [0, 64, 191, 255]\n", | |
" \n", | |
" _in_val = []\n", | |
" for i in range(len(in_val_)-1):\n", | |
" _in_val.append(list(range(in_val_[i], in_val_[i+1])))\n", | |
" # [0, 128, 255] => [ [0,1,...,62,63], [64,65,...,189,190], [191,192,...,254,255] ]\n", | |
" \n", | |
" \n", | |
" \n", | |
" for image in images:\n", | |
" im = Image.open(os.path.join(in_dir, image))\n", | |
" ima = np.asarray(im)\n", | |
" \n", | |
" for iv, ov in zip(_in_val, out_val):\n", | |
" if type(iv) == type([]):\n", | |
" for v in iv:\n", | |
" ima = np.where(ima==v, ov, ima)\n", | |
" else:\n", | |
" ima = np.where(ima==iv, ov, ima)\n", | |
" \n", | |
" im = Image.fromarray(ima)\n", | |
" im.save(os.path.join(out_dir, image))\n", | |
" \n", | |
" count += 1\n", | |
" print(count)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 222, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"3200\n" | |
] | |
} | |
], | |
"source": [ | |
"modify3(train_masks, TRAIN_MASK_DIR, TRAIN_OUT_DIR, [0, 128, 256], [0, 1, 2])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 219, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"355\n" | |
] | |
} | |
], | |
"source": [ | |
"modify3(val_masks, VAL_MASK_DIR, VAL_OUT_DIR, [0, 128, 256], [0, 1, 2])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 223, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import random\n", | |
"\n", | |
"val_list = os.listdir(VAL_OUT_DIR)\n", | |
"rand_val_path = os.path.join(VAL_OUT_DIR, random.choice(val_list))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 224, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"/home/jho/projects/image-segmentation-keras/train_faces/../dataset/celeba/val/mask_/135827.bmp\n", | |
"(218, 178)\n" | |
] | |
} | |
], | |
"source": [ | |
"rand_val_im = np.asarray(Image.open(rand_val_path))\n", | |
"\n", | |
"print(rand_val_path)\n", | |
"print(rand_val_im.shape)\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 225, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAVMAAADxCAYAAAB26FQlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAXNklEQVR4nO3dfbBcdX3H8ffHBHFKfeChSkzCQ5XiQ0XRNLGlFVCByCixU2cMWIsW57aOVJLOdAYbRjpRHG1nSmJF8VZSxalER8GmDgLxEUeLTbAYy0PwGhhzTSyVUFFxYHL32z/2XDjc7J49e+/Z3d85+3kxZ7h7ztk9m3347Pf3+50HRQRmZrYwTxn1EzAzawKHqZlZBRymZmYVcJiamVXAYWpmVgGHqZlZBRymZtY4kpZL+rqkuyXdKemSDutI0oclTUnaJenluWUXSvphNl1Yapvez9TMmkbSEmBJRHxP0tOB24E3RsRduXXOBf4KOBdYBWyOiFWSjgJ2AiuAyO77ioh4qGibrkzNrHEiYn9EfC/7+xfA3cDSOautAa6NttuAZ2UhfA6wPSIOZAG6HVjda5uLixZKctlqZqVEhKp4mLIrSvoLYCI3azIiJjusdwJwKvDdOYuWAntzt6ezed3mFyoMUz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axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"sns.heatmap(rand_val_im[0:218, 0:178], annot=False, fmt=\"d\", cmap=plt.cm.bone)\n", | |
"plt.axis(\"off\")\n", | |
"plt.show()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "tf10-py36", | |
"language": "python", | |
"name": "tf10-py36" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.6.10" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment