Skip to content

Commit

Permalink
Created using Colaboratory
Browse files Browse the repository at this point in the history
  • Loading branch information
KD-3 committed Jun 3, 2020
1 parent ffc34e4 commit 7b8a3e9
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions btp_cnn_model1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"drive.mount('/gdrive')\n",
"%cd /gdrive"
],
"execution_count": 1,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -93,7 +93,7 @@
" print(os.path.join(DATADIR_ANNOTATIONS, img))\n",
" break"
],
"execution_count": 10,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -125,7 +125,7 @@
" plt.show()\n",
" break"
],
"execution_count": 11,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -200,7 +200,7 @@
"\n",
" training_data = []"
],
"execution_count": 13,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand All @@ -217,19 +217,19 @@
"metadata": {
"id": "cTesscveu-57",
"colab_type": "code",
"outputId": "e37b63fb-26d2-4fda-d92f-8bb68070180b",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 419
},
"outputId": "e37b63fb-26d2-4fda-d92f-8bb68070180b"
}
},
"source": [
"!pip install opencv-python==4.1.2.30\n",
"!pip install keras==2.3.1\n",
"%tensorflow_version 1.x\n",
"!pip install imageai --upgrade"
"!pip install imageai --upgrade #necessary"
],
"execution_count": 11,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -266,17 +266,17 @@
"metadata": {
"id": "H-RCBXsoxRUb",
"colab_type": "code",
"outputId": "f0b831d3-165e-40c8-d30b-091647946f7d",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 471
},
"outputId": "f0b831d3-165e-40c8-d30b-091647946f7d"
}
},
"source": [
"import tensorflow\n",
"print(tensorflow.__version__)"
],
"execution_count": 2,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -328,16 +328,16 @@
"metadata": {
"id": "CYl0HauDOWB7",
"colab_type": "code",
"outputId": "16c247d8-7bc9-44ec-c4d0-4b9668fa1492",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"outputId": "16c247d8-7bc9-44ec-c4d0-4b9668fa1492"
}
},
"source": [
"from imageai.Detection.Custom import DetectionModelTrainer"
],
"execution_count": 4,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -367,17 +367,17 @@
"metadata": {
"id": "IZQvsMx5wpc4",
"colab_type": "code",
"outputId": "b153e340-5387-4311-808b-ab6884b093eb",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 87
},
"outputId": "b153e340-5387-4311-808b-ab6884b093eb"
}
},
"source": [
"trainer.setDataDirectory(data_directory=\"/gdrive/My Drive/NEU-DET/NEU-DET\")\n",
"trainer.setTrainConfig(object_names_array=[\"crazing\", \"inclusion\", \"patches\", \"pitted_surface\", \"rolled-in_scale\", \"scratches\"], batch_size=4, num_experiments=100, train_from_pretrained_model=\"/gdrive/My Drive/NEU-DET/NEU-DET/models/pretrained-yolov3.h5\")"
],
"execution_count": 12,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand All @@ -396,16 +396,16 @@
"metadata": {
"id": "2sIIBLr8KU2-",
"colab_type": "code",
"outputId": "6b77062d-56db-4f23-efe4-44c651ef63c8",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 505
},
"outputId": "6b77062d-56db-4f23-efe4-44c651ef63c8"
}
},
"source": [
"trainer.trainModel()"
],
"execution_count": 16,
"execution_count": 0,
"outputs": [
{
"output_type": "stream",
Expand Down

0 comments on commit 7b8a3e9

Please sign in to comment.