wko-on-cloud-n/main.ipynb

226 lines
204 KiB
Plaintext
Raw Normal View History

2022-02-17 01:19:25 +01:00
{
"cells": [
{
"cell_type": "code",
2022-02-17 01:56:49 +01:00
"execution_count": 21,
2022-02-17 01:19:25 +01:00
"metadata": {},
"outputs": [],
"source": [
"\n",
"from src.Unet import Unet\n",
"from src.loss import jaccard_loss\n",
"from src.metrics import IOU\n",
2022-02-17 01:56:49 +01:00
"from src.consts import EPOCHS, STEPS, SEED, RGB_DIR, JPG_IMAGES, MASK_DIR, FC_DIR\n",
2022-02-17 01:19:25 +01:00
"from src.helpers import create_folder\n",
2022-02-17 03:04:00 +01:00
"from src.generators import create_generators\n",
2022-02-17 01:19:25 +01:00
"from tensorflow.keras.callbacks import ModelCheckpoint\n",
"import tensorflow as tf "
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"model = Unet(num_classes=1).build_model()\n",
"\n",
"compile_params ={\n",
" 'loss':jaccard_loss(smooth=90), \n",
" 'optimizer':'rmsprop',\n",
" 'metrics':[IOU]\n",
" }\n",
" \n",
"model.compile(**compile_params)\n",
"\n",
"model_name = \"models/unet.h5\"\n",
"modelcheckpoint = ModelCheckpoint(model_name,\n",
" monitor='val_loss',\n",
" mode='auto',\n",
" verbose=1,\n",
" save_best_only=True)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found 9399 images belonging to 1 classes.\n",
"Found 9399 images belonging to 1 classes.\n",
"Found 2349 images belonging to 1 classes.\n",
"Found 2349 images belonging to 1 classes.\n"
]
}
],
"source": [
"train_gen = create_generators('training', SEED)\n",
"val_gen = create_generators('validation', SEED)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\masob\\AppData\\Local\\Temp\\ipykernel_15244\\933514074.py:1: UserWarning: `Model.fit_generator` is deprecated and will be removed in a future version. Please use `Model.fit`, which supports generators.\n",
" history = model.fit_generator(train_gen,\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 1/5\n",
"10/10 [==============================] - 1080s 109s/step - loss: 1.0869 - IOU: 0.6101 - val_loss: 1.1605 - val_IOU: 0.6003\n",
"Epoch 2/5\n",
"10/10 [==============================] - 1066s 109s/step - loss: 1.1465 - IOU: 0.6051 - val_loss: 1.1744 - val_IOU: 0.5955\n",
"Epoch 3/5\n",
"10/10 [==============================] - 1082s 109s/step - loss: 1.1440 - IOU: 0.6060 - val_loss: 1.0622 - val_IOU: 0.6341\n",
"Epoch 4/5\n",
"10/10 [==============================] - 1060s 108s/step - loss: 1.1511 - IOU: 0.6035 - val_loss: 1.3288 - val_IOU: 0.5423\n",
"Epoch 5/5\n",
"10/10 [==============================] - 1062s 108s/step - loss: 1.1654 - IOU: 0.5986 - val_loss: 1.1816 - val_IOU: 0.5930\n"
]
}
],
"source": [
"history = model.fit_generator(train_gen,\n",
" validation_data=val_gen,\n",
" epochs=EPOCHS,\n",
" steps_per_epoch=STEPS,\n",
" validation_steps = STEPS,\n",
" shuffle=True,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"create_folder('models', '.')\n",
"model.save(filepath=model_name)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"dict_keys(['loss', 'IOU', 'val_loss', 'val_IOU'])\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA06UlEQVR4nO3dd5xU1dnA8d+znS2wjd52RVAQhAVEFIkVxQIKGILIqinW+GryRhNN1ERNMc1YYje+s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7qYPnvg7DsJRh+Bwy9KTjHzJlkB9/lLYauQ4JzTKUaQct9h5FIe70B9+mTMPtuGHgtjHo0eOW4Sw7D33pBvyth9OPBOaZSDi33rVRDVr5hk0PvUXDZP4I7V0N8CpwyxhbwKzkSvOMq1QBNEEqtnwszboas4bZTOio6+DHk5ELpES3gp0JK2CeIcGlCa0ikvM6A2/YFTMmFdn3sdKGxCd7E0W0oZJyo80SokBLWCSIhIYH8/Pyw//I0xpCfn09Cgkdfbi3V7rXw6vehdUeY9Jadq8Er1QX8PtUCfipkuHoVk4iMBB4FooHnjTF1BiOIyHjgd4ABVhhjJorIAOApoDVQAfzBGDOlqcfv0qULeXl57Nmzp/kvooVISEigS5cuXofRchzYBi+PhZh4yJ0Oye28jgj6XwUfPGjPIkbc73U0SrmXIEQkGngCGAHkAYtFZKYxZo3PNj2Bu4Fhxpj9IlL1KS0ErjHGrBeRTsBSEZltjDnQlBhiY2PJzs4OxMtR4aQg39ZXKi2AH86CtCyvI7JSOkDPC2HFZDjvXojWq9CVt9xsYho
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA3EElEQVR4nO3dd3hUZdr48e+dXggJJPQWRKX3IooFGyIgRawIa8f66vpbXXXX8qpb3Ka+lhVRWRUQK6gICLqKvSFButIChGIgEFp68vz+eE4gwUlImTNnJnN/ritXZk6Zc2dgzj3nKfcRYwxKKaXU0SK8DkAppVRw0gShlFLKJ00QSimlfNIEoZRSyidNEEoppXzSBKGUUsonTRBK+YGIvCQif6rhtpkick59X0cpt2mCUEop5ZMmCKWUUj5pglBhw2nauUtElovIIRF5U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7dWjupVcOwbpEtzFeXuQ/H0rg1XPAEvHkVfP4vGHqP/48RZlwv9+00Mb3vq5Pax7YbsX0O5wJDjTE3OMufAxYbY6ptYtJy3+Hzt6oQNety2PYD3LEaIl36fjp7Mqx4C65dZEuIq2oFbblvETlexPZSiUg/IBbIARYCw0SkidM5PcxZppQKVQd2ws8Lbd+DW8kBYMQ/7NXE7MlQdMi944QBVxOEiMwCvgY6i0iWiFwrIjeKyI3OJuOBlSKyDHgGuNRYe7DNTd87Pw+Xd1grpULUj05hvr41LMxXV3HJMPZZ2LPRdlqrOnN7FFO1wxSMMX8D/lbFummAX8asGWOQBj42uiHdGVA
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"# summarize history for accuracy\n",
"import matplotlib.pyplot as plt\n",
"print(history.history.keys())\n",
"plt.plot(history.history['IOU'])\n",
"plt.plot(history.history['val_IOU'])\n",
"plt.title('model IOU')\n",
"plt.ylabel('IOU')\n",
"plt.xlabel('epoch')\n",
"plt.legend(['train', 'test'], loc='upper left')\n",
"plt.show()\n",
"# summarize history for loss\n",
"plt.plot(history.history['loss'])\n",
"plt.plot(history.history['val_loss'])\n",
"plt.title('model loss')\n",
"plt.ylabel('loss')\n",
"plt.xlabel('epoch')\n",
"plt.legend(['train', 'test'], loc='upper left')\n",
"plt.show()"
]
},
{
"cell_type": "code",
2022-02-17 03:04:00 +01:00
"execution_count": 71,
2022-02-17 01:19:25 +01:00
"metadata": {},
2022-02-17 01:56:49 +01:00
"outputs": [
{
2022-02-17 03:04:00 +01:00
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAbkAAAI1CAYAAABLzoQWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAEAAElEQVR4nOz9ebRtW5rQBf6+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5defz3vgfwR+0rczncecFM+P/xzhP7acnVRKKe9vKDhV3Ivc+Mu3OinlnpN54qdwavw/8L7O+LH32cy/gtOs9MPwifcO5OSVdn2O+wbw586Dx3t/i1LKz+U0i42cVsL/UDpfypRSPsPJAeXHcRpI3s/v42R6+kQpZc1pIJBz3FBK+U9KKd+HkwnxX+Rb7/F9DSeT7+97bj/l/fn/18/Jzo/9gFueARPw3V70GO87//3ATxWRH8pJQf7Z94U/33bfHtm5EpHuA+I+47Ta/L7Pyc66nJxD4GSqf1my83xdvAH8qvfJdFtK+f3nMn1QP/og3gC+Qj7YYeL9df9h6uL99f9tP9RpwP0TwM/lA5Qcp1Xr3wW+eyllBfwSznJ6jv9bSik/mJNJ7ntwMi2+x2/jpIj/+Pva9/n8//xzcvp9P0cx3+DbL6c/WU5+AV/FaYx9nu+onL4o7huczL7Py0RdTvu730pOz/uoNx82wy/me3K/Cfjn5FtccH8x8DPOm4+PAETk45z2Tj4QOXkz/Uuc7P/fEf474DUR+QVy2pReishXfRtxfh+nAfMnn4+f5xHw78rJEeVf4WRj/+Mfsiw/TkR++HlT+ldwWrG+cS7j9xCRf/2crhWRf0JEvncpJXF
"text/plain": [
"<Figure size 432x648 with 9 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
2022-02-17 01:56:49 +01:00
}
],
2022-02-17 01:19:25 +01:00
"source": [
2022-02-17 03:04:00 +01:00
"from src.utils import plot_predictions_grid\n",
"import os, random\n",
2022-02-17 01:56:49 +01:00
"img_names = [random.choice(os.listdir('./images/rgb/img')) for _ in range(3)]\n",
2022-02-17 03:04:00 +01:00
"loaded_model = tf.keras.models.load_model(\"./\" + model_name, compile=False)\n",
"plot_predictions_grid(img_names, loaded_model)"
2022-02-17 01:19:25 +01:00
]
}
],
"metadata": {
"interpreter": {
"hash": "a0ec3e03c477d553d7e02db72be164410aea09f54984d03651765aaff9c92bc7"
},
"kernelspec": {
"display_name": "Python 3.9.0 ('venv': venv)",
"language": "python",
"name": "python3"
},
"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.9.0"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}