Commit e68b397c authored by josh's avatar josh
Browse files

modularizing the ml pipeline

parent 77a69531
{
"cells": [
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"from modules.ai4hdrModel import *\n",
"\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"PosixPath('/home/josh/projects/suli_fall2021/ai4hdr_backend/roadTest')"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sampleDir = Path.cwd().joinpath(\"roadTest\")\n",
"sampleDir"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(10, 128, 128, 3)\n",
"(10, 128, 128)\n"
]
}
],
"source": [
"(xSamples, ySamples) = getSamples(sampleDir)\n",
"print(xSamples.shape)\n",
"print(ySamples.shape)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# "
]
},
{
......
This diff is collapsed.
%% Cell type:code id: tags:
``` python
import pickle
from pathlib import Path
from tensorflow import keras
```
%% Cell type:code id: tags:
``` python
VGG_DIR = "VGG16"
model = keras.models.load_model(VGG_DIR)
```
%%%% Output: error
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-13-164cb73ad621> in <module>()
1 VGG_DIR = "VGG16"
----> 2 model = keras.models.load_model(VGG_DIR)
/home/josh/anaconda3/envs/gpu_tf/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/save.py in load_model(filepath, custom_objects, compile)
147
148 if isinstance(filepath, six.string_types):
--> 149 loader_impl.parse_saved_model(filepath)
150 return saved_model_load.load(filepath, compile)
151
/home/josh/anaconda3/envs/gpu_tf/lib/python3.6/site-packages/tensorflow_core/python/saved_model/loader_impl.py in parse_saved_model(export_dir)
81 (export_dir,
82 constants.SAVED_MODEL_FILENAME_PBTXT,
---> 83 constants.SAVED_MODEL_FILENAME_PB))
84
85
OSError: SavedModel file does not exist at: VGG16/{saved_model.pbtxt|saved_model.pb}
%% Cell type:code id: tags:
``` python
obj = pickle.load(inFile)
```
%%%% Output: error
---------------------------------------------------------------------------
UnpicklingError Traceback (most recent call last)
<ipython-input-7-9fbfa10e9190> in <module>()
----> 1 obj = pickle.load(inFile)
UnpicklingError: invalid load key, '\x0a'.
%% Cell type:code id: tags:
``` python
```
......@@ -18,10 +18,6 @@ def getSamples(dataDir: Path) -> [(np.array, np.array)]:
inputImage = Image.open(inputPath)
maskImage = Image.open(maskPath)
#newSize = (128, 128)
#resizeInput = inputImage.resize(newSize)
#resizeMask = maskImage.resize(newSize)
inputArr = np.array(inputImage)
maskArr = np.array(maskImage.convert("L"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment