projects
/
persistence.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
26d1810
)
ipynb: Update
master
author
Stefan Huber <shuber@sthu.org>
Wed, 17 Apr 2024 14:56:14 +0000
(16:56 +0200)
committer
Stefan Huber <shuber@sthu.org>
Wed, 17 Apr 2024 14:56:14 +0000
(16:56 +0200)
2Dpers.ipynb
patch
|
blob
|
history
diff --git
a/2Dpers.ipynb
b/2Dpers.ipynb
index 898a094962eee19f88fbf045f5d979fd697cd643..9e162fbb4fda767ac30ef2dd477bff4c1e1b3e55 100644
(file)
--- a/
2Dpers.ipynb
+++ b/
2Dpers.ipynb
@@
-7,6
+7,7
@@
"outputs": [],
"source": [
"from scipy import misc\n",
"outputs": [],
"source": [
"from scipy import misc\n",
+ "from PIL import Image\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"\n",
@@
-22,7
+23,10
@@
"outputs": [],
"source": [
"im = np.loadtxt('paws.numpy')\n",
"outputs": [],
"source": [
"im = np.loadtxt('paws.numpy')\n",
- "im = misc.imresize(im, 2.0)\n",
+ "print(\"pre shape:\", im.shape)\n",
+ "w, h = im.shape\n",
+ "im = np.array(Image.fromarray(im).resize((h*2, w*2)))\n",
+ "print(\"post shape:\", im.shape)\n",
"im = im * (255 / np.max(im))"
]
},
"im = im * (255 / np.max(im))"
]
},
@@
-103,10
+107,12
@@
"metadata": {},
"outputs": [],
"source": [
"metadata": {},
"outputs": [],
"source": [
- "fig = plt.figure()\n",
- "ax = fig.gca(projection='3d')\n",
+ "fig = plt.figure(figsize=(6, 6))\n",
+ "ax = fig.add_subplot(111, projection='3d')\n",
+ "ax.set_zlim(0, 800)\n",
"ax.plot_surface(xx, yy, im ,rstride=1, cstride=1, cmap=plt.cm.jet,\n",
"ax.plot_surface(xx, yy, im ,rstride=1, cstride=1, cmap=plt.cm.jet,\n",
- " linewidth=0)"
+ " linewidth=0)\n",
+ "plt.show()"
]
},
{
]
},
{
@@
-114,24
+120,20
@@
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": null,
"metadata": {},
"outputs": [],
- "source": [
- "plt.show()"
- ]
+ "source": []
},
{
"cell_type": "code",
"execution_count": null,
},
{
"cell_type": "code",
"execution_count": null,
- "metadata": {
- "collapsed": true
- },
+ "metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
- "language": "python
3.5
",
+ "display_name": "Python 3
(ipykernel)
",
+ "language": "python",
"name": "python3"
},
"language_info": {
"name": "python3"
},
"language_info": {
@@
-144,9
+146,9
@@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.
5.5
"
+ "version": "3.
11.8
"
}
},
"nbformat": 4,
}
},
"nbformat": 4,
- "nbformat_minor":
1
+ "nbformat_minor":
4
}
}