Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
reiinakano committed Apr 12, 2019
1 parent b0a6768 commit 9a2fead
Showing 1 changed file with 61 additions and 33 deletions.
94 changes: 61 additions & 33 deletions notebooks/train_vae_painter.ipynb
Expand Up @@ -24,7 +24,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/reiinakano/diff-painter/blob/master/notebooks/train_vae_painter.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/reiinakano/neural-painters/blob/master/notebooks/train_vae_painter.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down Expand Up @@ -52,7 +52,7 @@
"#from google.colab import drive\n",
"#drive.mount('/drive')"
],
"execution_count": 7,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -127,7 +127,7 @@
"source": [
"!pip install future-fstrings"
],
"execution_count": 3,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -155,7 +155,7 @@
"!cd SPIRAL-tensorflow && git checkout reiinakano-patch-2 #reiinakano-patches\n",
"!cd SPIRAL-tensorflow && git pull"
],
"execution_count": 4,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -190,7 +190,7 @@
"!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip\n",
"!unzip ngrok-stable-linux-amd64.zip"
],
"execution_count": 5,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -222,37 +222,23 @@
"source": [
"# Download episodes. \n",
"\n",
"If you want to generate your own brushstrokes, go to https://github.com/reiinakano/diff-painter/blob/master/notebooks/generate_stroke_examples.ipynb or put your data under the data/ folder "
"If you want to use/generate your own brushstrokes, go to https://github.com/reiinakano/diff-painter/blob/master/notebooks/generate_stroke_examples.ipynb or put your data under the data/ folder.\n",
"\n",
"Otherwise, you can download pre-calculated brushstrokes from Kaggle. You will need to set your API credentials via https://github.com/Kaggle/kaggle-api#api-credentials"
]
},
{
"metadata": {
"id": "wAV5YBk6vu3z",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"outputId": "fae6cc73-2747-45b3-ac3c-c989e06ebbab"
"colab": {}
},
"cell_type": "code",
"source": [
"!mkdir data\n",
"#!mkdir tf_vae\n",
"!cp /drive/My\\ Drive/world-painter5/episodes_*.npz data/\n",
"#!cp /drive/My\\ Drive/world-painter5/tf_vae/* tf_vae/\n",
"#!cp -r /drive/My\\ Drive/world-painter5/logdir_tf_vae logdir"
"!pip install kaggle"
],
"execution_count": 8,
"outputs": [
{
"output_type": "stream",
"text": [
"mkdir: cannot create directory ‘data’: File exists\n"
],
"name": "stdout"
}
]
"execution_count": 0,
"outputs": []
},
{
"metadata": {
Expand All @@ -262,7 +248,10 @@
},
"cell_type": "code",
"source": [
""
"!mkdir -p ~/.kaggle\n",
"\n",
"# Make sure to upload your Kaggle key from somewhere. I saved mine in Drive\n",
"#!cp \"/drive/My Drive/kaggle.json\" ~/.kaggle/"
],
"execution_count": 0,
"outputs": []
Expand All @@ -274,6 +263,45 @@
"colab": {}
},
"cell_type": "code",
"source": [
"!kaggle datasets download reiinakano/mypaint_brushstrokes"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "2ahBjWypZbUE",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!unzip mypaint_brushstrokes.zip"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "1x2_6feNZbYD",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
"!mv strokes-dataset data"
],
"execution_count": 0,
"outputs": []
},
{
"metadata": {
"id": "XK6wamHyZbct",
"colab_type": "code",
"colab": {}
},
"cell_type": "code",
"source": [
""
],
Expand Down Expand Up @@ -607,7 +635,7 @@
" plt.imshow(img)\n",
"plt.show()"
],
"execution_count": 4,
"execution_count": 0,
"outputs": [
{
"output_type": "display_data",
Expand Down Expand Up @@ -924,7 +952,7 @@
" reuse=False,\n",
" gpu_mode=True)\n"
],
"execution_count": 9,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -1002,7 +1030,7 @@
"!curl -s http://localhost:4040/api/tunnels | python3 -c \\\n",
" \"import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])\"\n"
],
"execution_count": 10,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -1198,7 +1226,7 @@
" reuse=False,\n",
" gpu_mode=False)"
],
"execution_count": 14,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -1258,7 +1286,7 @@
" \n",
"experiment(20, 'tf_vae')\n"
],
"execution_count": 16,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -1344,7 +1372,7 @@
"_test_gans[0].load_checkpoint('tf_vae')\n",
"experiment5(_test_gans, 20.)\n"
],
"execution_count": 17,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down

0 comments on commit 9a2fead

Please sign in to comment.