Commit f7121e88 authored by Cagri Eryilmaz's avatar Cagri Eryilmaz
Browse files

remove torch requirement

parent 2cb33839
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
"import migraphx\n", "import migraphx\n",
"from PIL import Image\n", "from PIL import Image\n",
"import numpy as np\n", "import numpy as np\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt"
"import torch"
] ]
}, },
{ {
...@@ -159,6 +158,17 @@ ...@@ -159,6 +158,17 @@
"output_mask.shape" "output_mask.shape"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"id": "acbd68e3",
"metadata": {},
"outputs": [],
"source": [
"def sigmoid(x):\n",
" return 1 / (1 + np.exp(-x))"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
...@@ -166,7 +176,7 @@ ...@@ -166,7 +176,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"probs = torch.sigmoid(torch.from_numpy(output_mask))\n", "probs = sigmoid(output_mask)\n",
"full_mask = probs > 0.996\n", "full_mask = probs > 0.996\n",
"plot_img_and_mask(imPrint, full_mask)" "plot_img_and_mask(imPrint, full_mask)"
] ]
......
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