Unverified Commit 8f70ff1c authored by Tyler Ganter's avatar Tyler Ganter Committed by GitHub
Browse files

[object detection] Bug fixes in colab tutorial (#9725)

* OD tutorial colab working

* fixing install instructions link
parent 6e65d027
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
"id": "awjrpqy-6MaQ" "id": "awjrpqy-6MaQ"
}, },
"source": [ "source": [
"Important: If you're running on a local machine, be sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md). This notebook includes only what's necessary to run in Colab." "Important: If you're running on a local machine, be sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md). This notebook includes only what's necessary to run in Colab."
] ]
}, },
{ {
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install --upgrade pip\n",
"!pip install -U --pre tensorflow==\"2.*\"\n", "!pip install -U --pre tensorflow==\"2.*\"\n",
"!pip install tf_slim" "!pip install tf_slim"
] ]
...@@ -158,23 +159,12 @@ ...@@ -158,23 +159,12 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"%%bash\n", "%%bash\n",
"cd models/research/\n",
"protoc object_detection/protos/*.proto --python_out=."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
"id": "s62yJyQUcYbp"
},
"outputs": [],
"source": [
"%%bash \n",
"cd models/research\n", "cd models/research\n",
"pip install ." "# Compile protos.\n",
"protoc object_detection/protos/*.proto --python_out=.\n",
"# Install TensorFlow Object Detection API.\n",
"cp object_detection/packages/tf2/setup.py .\n",
"python -m pip install --use-feature=2020-resolver ."
] ]
}, },
{ {
...@@ -621,7 +611,7 @@ ...@@ -621,7 +611,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"masking_model.output_shapes" "masking_model.signatures['serving_default'].output_shapes"
] ]
}, },
{ {
......
...@@ -822,7 +822,7 @@ def reframe_box_masks_to_image_masks(box_masks, boxes, image_height, ...@@ -822,7 +822,7 @@ def reframe_box_masks_to_image_masks(box_masks, boxes, image_height,
A tensor of size [num_masks, image_height, image_width] with the same dtype A tensor of size [num_masks, image_height, image_width] with the same dtype
as `box_masks`. as `box_masks`.
""" """
resize_method = 'nearest' if box_masks.dtype == tf.uint8 else resize_method resize_method = 'nearest' if tf.uint8 == box_masks.dtype else resize_method
# TODO(rathodv): Make this a public function. # TODO(rathodv): Make this a public function.
def reframe_box_masks_to_image_masks_default(): def reframe_box_masks_to_image_masks_default():
"""The default function when there are more than 0 box masks.""" """The default function when there are more than 0 box masks."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment