Skip to content

Commit

Permalink
upated notebook added
Browse files Browse the repository at this point in the history
  • Loading branch information
faizan1234567 committed Sep 8, 2024
1 parent 9506a34 commit e53a2d4
Showing 1 changed file with 185 additions and 0 deletions.
185 changes: 185 additions & 0 deletions notebooks/BraTS_2023_running_instructions.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "cRch6DI49jre",
"outputId": "f7cceeee-d868-44e0-932b-b58b0cc5f8ec"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Mounted at /gdrive\n"
]
}
],
"source": [
"# mount google drive\n",
"from google.colab import drive\n",
"drive.mount('/gdrive')"
]
},
{
"cell_type": "code",
"source": [
"# Set up your working directory in google drive, so you dont loss the progress\n",
"root_dir = \"/gdrive/MyDrive\"\n",
"\n",
"\n",
"# create a directory in MyDrive\n",
"directory_name = \"BraTS_segmentation\"\n",
"import os\n",
"\n",
"working_dir = os.path.join(root_dir, directory_name)\n",
"os.makedirs(working_dir, exist_ok=True)\n",
"os.chdir(working_dir)"
],
"metadata": {
"id": "wS0HgrhK96FL"
},
"execution_count": 4,
"outputs": []
},
{
"cell_type": "code",
"source": [
"%pwd"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "Ny8P_EUq-igv",
"outputId": "b020cb63-7ee9-4f95-8225-0ad7bcc55bea"
},
"execution_count": 4,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'/gdrive/MyDrive/BraTS_segmentation'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 4
}
]
},
{
"cell_type": "code",
"source": [
"# clone the repo from Github\n",
"!git clone https://github.com/faizan1234567/BraTS23-Tumors-Segmentation\n",
"%cd BraTS23-Tumors-Segmentation\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "xrBqNqFQ9xdA",
"outputId": "c7a0b1ee-3e78-4648-c18e-a5e5e41f46c9"
},
"execution_count": 5,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Cloning into 'BraTS23-Tumors-Segmentation'...\n",
"remote: Enumerating objects: 1553, done.\u001b[K\n",
"remote: Counting objects: 100% (285/285), done.\u001b[K\n",
"remote: Compressing objects: 100% (174/174), done.\u001b[K\n",
"remote: Total 1553 (delta 149), reused 219 (delta 93), pack-reused 1268 (from 1)\u001b[K\n",
"Receiving objects: 100% (1553/1553), 32.51 MiB | 16.40 MiB/s, done.\n",
"Resolving deltas: 100% (858/858), done.\n",
"/gdrive/MyDrive/BraTS_segmentation/BraTS23-Tumors-Segmentation\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# now install all the required dependencies\n",
"!pip install -r requirements.txt\n",
"# virtual enviroment recommended"
],
"metadata": {
"id": "mCTSqI-P-qJI"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"# Restart Runtime"
],
"metadata": {
"id": "jukUO1gG_s0M"
}
},
{
"cell_type": "code",
"source": [
"# run the working directory cell to navigate to working directory"
],
"metadata": {
"id": "r56xxBZQAaz3"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"%pwd"
],
"metadata": {
"id": "gy8Nw5vDAhqW"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"!python train.py -h\n",
"\n",
"# setup your data path and other params in the configs direcdtory\n",
"# then run python trian.py\n",
"# python test.py"
],
"metadata": {
"id": "KGsLUzXY_0NL"
},
"execution_count": null,
"outputs": []
}
]
}

0 comments on commit e53a2d4

Please sign in to comment.