# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + colab={"base_uri": "https://localhost:8080/"} executionInfo={"elapsed": 63654, "status": "ok", "timestamp": 1611819361068, "user": {"displayName": "horst hammer", "photoUrl": "", "userId": "16387219538505432860"}, "user_tz": -60} id="3k_02h3jjoTn" outputId="634fb43f-574f-4dfd-d967-4ee1209503ca"
import os
base_mrcnn = '/content/drive/MyDrive/instance_segmentation/Mask_RCNN/'
# %cd /content
# !pip install -r /content/drive/MyDrive/instance_segmentation/Mask_RCNN/requirements.txt
# !pip install nvgpu
# !pip install -U imgaug
# !pip install tensorflow-gpu==1.15

weights_path_dir = os.path.join(base_mrcnn, 'snapshots')
weights_path = os.path.join(weights_path_dir, 'mask_rcnn_coco.h5')
if not os.path.isfile(weights_path):
    # !wget https://github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5

    weights_path_dir = os.path.join(base_mrcnn, 'snapshots')
    if not os.path.exists(weights_path_dir):
        os.mkdir(weights_path)
    # !mv mask_rcnn_coco.h5 /content/drive/MyDrive/instance_segmentation/Mask_RCNN/snapshots

# + colab={"base_uri": "https://localhost:8080/"} executionInfo={"elapsed": 489123, "status": "ok", "timestamp": 1611819786545, "user": {"displayName": "horst hammer", "photoUrl": "", "userId": "16387219538505432860"}, "user_tz": -60} id="SPt0LVj3OSst" outputId="57aa37e5-d735-43c6-a271-e1129559cade"
# !nvidia-smi
# %cd /content
# !wget https://rgbd.cs.princeton.edu/data/SUNRGBD.zip
# !unzip SUNRGBD.zip

# + [markdown] id="LC_SQXyEF9QO"
# # Evaluation

# + colab={"background_save": true, "base_uri": "https://localhost:8080/"} id="kOOgdeA-MGNH"
# # !pip install --force-reinstall /content/drive/MyDrive/instance_segmentation/Mask_RCNN
weights_path = '/content/drive/MyDrive/instance_segmentation/Mask_RCNN/logs/plain_new_eval/mask_rcnn_sun_0005.h5'
# %cd /content/drive/MyDrive/instance_segmentation/Mask_RCNN

# !python -m samples.sunrgbd.sun evaluate\
#          --dataset '/content/SUNRGBD'


# + [markdown] id="la-dV5OAF_FI"
# # Training

# + colab={"base_uri": "https://localhost:8080/"} executionInfo={"elapsed": 5121, "status": "ok", "timestamp": 1611754443668, "user": {"displayName": "horst hammer", "photoUrl": "", "userId": "16387219538505432860"}, "user_tz": -60} id="RCa4PMAbkKTL" outputId="5487ebf0-39ed-4161-e476-eddad57b81b9"
# %cd /content/drive/MyDrive/instance_segmentation/Mask_RCNN
weights_path = '/content/drive/MyDrive/instance_segmentation/Mask_RCNN/logs/snapshots/mask_rcnn_sun_0005.h5'

import sys
# !python -m samples.sunrgbd.sun train\
#                                --dataset '/content/SUNRGBD'\
#                                --epochs 25\
#                                --lr 0.001\
#                                --augm-num 2\
#                                --augm-strength 7\
#                                --depth-mode True\
#                                --weights {weights_path}


# + id="8cd_N6avNHp4"


# + colab={"base_uri": "https://localhost:8080/"} executionInfo={"elapsed": 238018, "status": "ok", "timestamp": 1608496814294, "user": {"displayName": "horst hammer", "photoUrl": "", "userId": "16387219538505432860"}, "user_tz": -60} id="56alueRcww7F" outputId="b8d919ad-6055-4d45-c088-12b8ddf43280"
import multiprocessing
import os
multiprocessing.cpu_count()
os.name is 'nt'

# + [markdown] id="HOpGH1bCbOiH"
#

# + id="1BnUzHYgey2c"
function ConnectButton(){
    console.log("Connect pushed"); 
    document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click() 
}
setInterval(ConnectButton,300000);

StarcoderdataJupyterScriptsDedupFiltered