<jupyter_start><jupyter_text>**In this colab we are going to download all the nessesary files**  **Step 1 – Check GPU configurations working properly**First of all we need to check the GPU configurations working properly. For that please execute following piece of python code in the colab file.<jupyter_code>import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
 
with tf.device('/gpu:0'):
  random_image_gpu = tf.random_normal((100, 100, 100, 3))
  net_gpu = tf.layers.conv2d(random_image_gpu, 32, 7)
  net_gpu = tf.reduce_sum(net_gpu)
   
sess = tf.Session(config=config)
 
try:
  sess.run(tf.global_variables_initializer())
  print('ok')
except tf.errors.InvalidArgumentError:
  print(
      '\n\nThis error most likely means that this notebook is not '
      'configured to use a GPU.  Change this in Notebook Settings via the '
      'command palette (cmd/ctrl-shift-P) or the Edit menu.\n\n')
  raise<jupyter_output><empty_output><jupyter_text>**Step 2 – Connect to the Google Drive**As the next step, we need to connect our colab file to the google drive. This is because, if we going to train a new model we can save it in the google drive rather than save it in the temporary location provide by the colab. To do that, please execute following code in a new code widget on colab file. Before doing this, create a new folder in your google drive<jupyter_code>from os.path import join
from google.colab import drive
 
ROOT = "/content/drive"
drive.mount(ROOT)

# This is a custom path. 'My Drive' is the root of your google drive change accordingly
PROJ = "My Drive/workshop" 
PROJECT_PATH = join(ROOT, PROJ)
 
#%cd ~/content 
%cd {PROJECT_PATH}<jupyter_output><empty_output><jupyter_text>**Step 3 – Clone the Tensorflow models repository**In this step, you can clone the github folder of Tensorflow´s Object detection API. Once completed you can check those files by navigating to Google drive -> My Drive -> your/folder/route directory.**Note:**this might take a while**do it only once if the folder already has the models downloaded**<jupyter_code>!git clone https://github.com/tensorflow/models.git<jupyter_output><empty_output><jupyter_text>**Step 4 – Download base model**Download the base model into the object_detection folderhttps://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md**this has to be done only once **<jupyter_code>ENV = "models/research/object_detection" 
PROJECT_ENV = join(PROJECT_PATH, ENV)
%cd {ENV}

import os
import shutil
import glob
import urllib.request
import tarfile

MODEL = 'faster_rcnn_inception_v2_coco_2018_01_28'
#MODEL = 'ssd_mobilenet_v1_coco_2018_01_28'
MODEL_FILE = MODEL + '.tar.gz'
DOWNLOAD_BASE = 'http://download.tensorflow.org/models/object_detection/'
#http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_v2_coco_2018_01_28.tar.gz
DEST_DIR = '/content/models/research/object_detection'

if not (os.path.exists(MODEL_FILE)):
    urllib.request.urlretrieve(DOWNLOAD_BASE + MODEL_FILE, MODEL_FILE)

tar = tarfile.open(MODEL_FILE)
tar.extractall()
tar.close()

os.remove(MODEL_FILE)
if (os.path.exists(DEST_DIR)):
    shutil.rmtree(DEST_DIR)<jupyter_output><empty_output><jupyter_text>**Step 5 - Move example files from the object_detection_workshop folder**we will need to move the following files & folders into the object detection folder(/content/drive/My Drive/workshop/models/research/object_detection)*   Images (folder containing sample images and its anotations)*   inference graph (empty folder to save our inference graph model)*   training folder (folder containing the config pipeline adn labelmap)*   test1 (sample image file to test the model)*   xml_to_csv.py (python code to collect all anotations in one csv file)*   generate_tfrecord.py (pythone code to transform the csv file into a tfrecord)<jupyter_code>from os.path import join
ENV = "/models/research/object_detection" 
PROJECT_ENV = join(PROJECT_PATH, ENV)
%cd {PROJECT_ENV}

import os
cwd = os.getcwd()
print (cwd)

!ls<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09004159530217763, 'fraction_numerical': 0.011989234157083434, 'mean_word_length': 5.3478260869565215, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '542062', 'license': 'MIT', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1269, 'n_words': 426, 'path': '1.-Object_Detection_Config.ipynb', 'repo_name': 'bwa616/object_detection_workshop', 'size': '4087'}