Commit f69abfd0 authored by Bryce Hepner's avatar Bryce Hepner

still long

parent 76fd64f3
......@@ -120,7 +120,7 @@
},
{
"cell_type": "code",
"execution_count": 76,
"execution_count": 43,
"metadata": {},
"outputs": [],
"source": [
......@@ -186,7 +186,7 @@
},
{
"cell_type": "code",
"execution_count": 100,
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
......@@ -293,7 +293,7 @@
},
{
"cell_type": "code",
"execution_count": 101,
"execution_count": 45,
"metadata": {},
"outputs": [],
"source": [
......@@ -333,7 +333,7 @@
},
{
"cell_type": "code",
"execution_count": 105,
"execution_count": 46,
"metadata": {},
"outputs": [],
"source": [
......@@ -365,7 +365,6 @@
" \n",
" the_keys4 = list(list_dic[4].keys())\n",
" the_values4 = list(list_dic[4].values())\n",
" \n",
" #Matrix system of points that will be used to solve the least squares fitting hyperplane\n",
" points = np.array([[-1,-1,1], [-1,0,1], [-1,1,1], [0,-1,1]])\n",
" \n",
......@@ -422,7 +421,7 @@
},
{
"cell_type": "code",
"execution_count": 106,
"execution_count": 47,
"metadata": {},
"outputs": [],
"source": [
......@@ -485,7 +484,7 @@
},
{
"cell_type": "code",
"execution_count": 107,
"execution_count": 48,
"metadata": {},
"outputs": [
{
......@@ -500,13 +499,33 @@
"source": [
"scenes = file_extractor()\n",
"images = image_extractor(scenes)\n",
"list_dic, image, new_error, diff, bound, predict, bins, A, nodes = huffman(images[0], 4, False)\n",
"list_dic, image, new_error, diff, bound, predict, bins, A, nodes = huffman(images[1], 4, False)\n",
"encoded_string = encoder(new_error, list_dic, diff, bound, bins)\n",
"reconstruct_image = decoder(A, encoded_string, list_dic, bins, False,nodes)\n",
"print(np.allclose(image, reconstruct_image))\n",
"print(len(list_dic))\n"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.4232928466796875"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"compress_rate(image, new_error, diff, bound, list_dic, bins)"
]
},
{
"cell_type": "code",
"execution_count": null,
......
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