Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 11 additions & 26 deletions notebooks/FGPU_edge_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [],
Expand All @@ -43,9 +42,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -120,7 +117,6 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
Expand Down Expand Up @@ -173,9 +169,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -203,9 +197,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -221,16 +213,17 @@
}
],
"source": [
"import scipy.misc\n",
"import pickle\n",
"import sys\n",
"from cffi import FFI\n",
"import numpy as np\n",
"ffi = FFI()\n",
"\n",
"#read input image\n",
"img=scipy.misc.lena()\n",
"nRows, nCols = img.shape[0:2]; # get image dimensions\n",
"length = nRows*nCols # length of input and output array\n",
"with open('data/lena.dat', 'rb') as f:\n",
" img = np.array(pickle.load(f))\n",
"nRows, nCols = img.shape # get image dimensions\n",
"length = img.size # length of input and output array\n",
"\n",
"# Allocate continuous memory for kernel parameters\n",
"img_ptr = mem.cma_alloc(length, data_type = \"unsigned\") # for input image\n",
Expand All @@ -255,7 +248,6 @@
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [],
Expand Down Expand Up @@ -284,7 +276,6 @@
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [
Expand Down Expand Up @@ -314,9 +305,7 @@
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -360,7 +349,6 @@
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
Expand All @@ -384,7 +372,6 @@
],
"source": [
"import numpy as np\n",
"import scipy.misc \n",
"import scipy.ndimage\n",
"import time\n",
"from matplotlib import pyplot as plt\n",
Expand Down Expand Up @@ -446,9 +433,7 @@
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -489,7 +474,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3+"
"version": "3.6.3"
}
},
"nbformat": 4,
Expand Down
3 changes: 3 additions & 0 deletions notebooks/data/lena.dat

Large diffs are not rendered by default.