# ---
# 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
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/Namrathask/models/blob/master/tensorflow.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + id="CsFr1XMC7kI3" colab={"base_uri": "https://localhost:8080/"} outputId="3877495f-926d-44b1-faf1-b3e78e68fd8c"
# !pip install tensorflow-gpu

# + id="44RojY_374xX" colab={"base_uri": "https://localhost:8080/"} outputId="636acf42-bf09-40ec-b165-c8295842187b"
import tensorflow as tf
print(tf.__version__)


# + id="b8oRdI2k7-rp" colab={"base_uri": "https://localhost:8080/"} outputId="2a99d6a7-741c-470b-c506-c84511f79f6b"
# !git clone https://github.com/tensorflow/models.git

# + id="8WniYn0X8HxH" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="4fbbd61a-c414-43c7-956b-24bae6c57b4e"
pwd


# + id="Y4c-gSZJ8OST" colab={"base_uri": "https://localhost:8080/"} outputId="bc1ae0b9-9ef9-41b9-a1f2-5789f954a4e8"
# cd /content/models/research

# + id="fAuUzagy8TgB" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="d13aac98-4243-44ad-802c-5291c58203a9"
pwd

# + id="dDjdYARn8Z4k"
# !protoc object_detection/protos/*.proto --python_out=.

# + id="MyFZsYxH8ezO" colab={"base_uri": "https://localhost:8080/"} outputId="64d00d1e-423f-445c-e9eb-6d8f4acae7a5"
# !git clone https://github.com/cocodataset/cocoapi.git

# + id="gEubNVCI8neD" colab={"base_uri": "https://localhost:8080/"} outputId="cdda9cea-a933-4ab4-a6c5-5c44a4d14f14"
# cd cocoapi/PythonAPI

# + id="QU7d9UKj8tva" colab={"base_uri": "https://localhost:8080/"} outputId="eb113e1d-dc6f-4bd0-c21e-e322729dc6ad"
# !make

# + id="XZ5lJRFI825-"
# cp -r pycocotools /content/models/research

# + id="zvNRhSY69BQf" colab={"base_uri": "https://localhost:8080/"} outputId="08940997-427d-4c47-a925-8fe4f1eb806a"
# cd ..

# + id="0tCu_NwJ9D7m" colab={"base_uri": "https://localhost:8080/"} outputId="0640cfea-97bf-44c3-9536-0949b39e4f9c"
# cd ..

# + id="4Qbr9C1x9IzO"
# cp object_detection/packages/tf2/setup.py .

# + id="hLiyWOT69M3W" colab={"base_uri": "https://localhost:8080/"} outputId="82365237-1f73-46b5-a7ca-b4b72b603802"
# !python -m pip install .


# + id="T0oiGsDM-ac2" colab={"base_uri": "https://localhost:8080/"} outputId="27314abe-0328-489d-ea67-8fb2fff591da"
# !python object_detection/builders/model_builder_tf2_test.py

# + id="Xpt6gU8n-mx7" colab={"base_uri": "https://localhost:8080/"} outputId="835c2210-4aea-4d73-aa8d-4e6c4b9af375"
# cd /content/training_demo/pre_trained_models

# + id="6QKQqVMaYE-Q" colab={"base_uri": "https://localhost:8080/"} outputId="83c552cf-3907-490a-8253-1631308e73ce"
# !wget http://download.tensorflow.org/models/object_detection/tf2/20200711/ssd_resnet101_v1_fpn_640x640_coco17_tpu-8.tar.gz

# + id="mbpllL0cYT-W" colab={"base_uri": "https://localhost:8080/"} outputId="2fde3ff5-f952-45b0-94c4-fa7843fc24a2"
# !tar -xvf ssd_resnet101_v1_fpn_640x640_coco17_tpu-8.tar.gz

# + id="mP2dy1P-Y0FC" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="f1c162f5-9e8c-4a41-b870-913e4ce8bec3"
pwd


# + id="1n0rks7OQOPM" colab={"base_uri": "https://localhost:8080/"} outputId="c8b6ec7b-c426-41cc-9a42-f6cb8c1ebf7a"
# cd /content/training_demo

# + id="HR2Cu6svT2Ei" colab={"base_uri": "https://localhost:8080/"} outputId="50d50229-d264-4f40-eb3d-320b37168993"
# Create train data:
# !python generate_tfrecord.py -x /content/training_demo/images/train -l /content/training_demo/annotations/label_map.pbtxt -o /content/training_demo/annotations/train.record

# Create test data:
# !python generate_tfrecord.py -x /content/training_demo/images/test -l /content/training_demo/annotations/label_map.pbtxt -o /content/training_demo/annotations/test.record


# + id="vAVf4FlGVV8Z" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="f3307591-7488-4bbb-f515-922f5c6c1377"
pwd

# + id="6ZAOfy_TVV36" colab={"base_uri": "https://localhost:8080/"} outputId="a61d07b9-4328-4473-f204-1c26247c6939"
# ls

# + id="HrynXN5RVVx8" colab={"base_uri": "https://localhost:8080/"} outputId="760d9ef1-567e-435a-a8ed-91d5990e6e18"
# !python model_main_tf2.py --model_dir=/content/training_demo/models/my_ssd_resnet101_v1_fpn --pipeline_config_path=/content/training_demo/models/my_ssd_resnet101_v1_fpn/pipeline.config

# + id="-bmJNSvUVVgz" colab={"base_uri": "https://localhost:8080/", "height": 35} outputId="7687dd31-234f-4bc6-de0b-e70d2c7c656e"
pwd


# + id="C66Q9v7IVVZy"


StarcoderdataJupyterScriptsDedupFiltered