Skip to content

Commit

Permalink
Merge pull request #11115 from tensorflow:sineeli-patch-15
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 586467627
  • Loading branch information
tensorflower-gardener committed Nov 29, 2023
2 parents d0c80b8 + 70e9eff commit 3aed8d9
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions docs/vision/instance_segmentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@
"source": [
"# Instance Segmentation with Model Garden\n",
"\n",
"\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/tfmodels/vision/instance_segmentation\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/models/blob/master/docs/vision/instance_segmentation.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/docs/vision/instance_segmentation.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView on GitHub\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/models/docs/vision/instance_segmentation.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
" \u003c/td\u003e\n",
"\u003c/table\u003e"
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://www.tensorflow.org/tfmodels/vision/instance_segmentation\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/models/blob/master/docs/vision/instance_segmentation.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://github.com/tensorflow/models/blob/master/docs/vision/instance_segmentation.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View on GitHub</a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://storage.googleapis.com/tensorflow_docs/models/docs/vision/instance_segmentation.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
" </td>\n",
"</table>"
]
},
{
Expand Down Expand Up @@ -187,15 +187,15 @@
"source": [
"# @title Download annotation files\n",
"\n",
"!wget https://s3-us-west-2.amazonaws.com/dl.fbaipublicfiles.com/LVIS/lvis_v1_train.json.zip\n",
"!wget https://dl.fbaipublicfiles.com/LVIS/lvis_v1_train.json.zip\n",
"!unzip -q lvis_v1_train.json.zip\n",
"!rm lvis_v1_train.json.zip\n",
"\n",
"!wget https://s3-us-west-2.amazonaws.com/dl.fbaipublicfiles.com/LVIS/lvis_v1_val.json.zip\n",
"!wget https://dl.fbaipublicfiles.com/LVIS/lvis_v1_val.json.zip\n",
"!unzip -q lvis_v1_val.json.zip\n",
"!rm lvis_v1_val.json.zip\n",
"\n",
"!wget https://s3-us-west-2.amazonaws.com/dl.fbaipublicfiles.com/LVIS/lvis_v1_image_info_test_dev.json.zip\n",
"!wget https://dl.fbaipublicfiles.com/LVIS/lvis_v1_image_info_test_dev.json.zip\n",
"!unzip -q lvis_v1_image_info_test_dev.json.zip\n",
"!rm lvis_v1_image_info_test_dev.json.zip"
]
Expand Down Expand Up @@ -669,7 +669,7 @@
"source": [
"## Create the `Task` object (`tfm.core.base_task.Task`) from the `config_definitions.TaskConfig`.\n",
"\n",
"The `Task` object has all the methods necessary for building the dataset, building the model, and running training \u0026 evaluation. These methods are driven by `tfm.core.train_lib.run_experiment`."
"The `Task` object has all the methods necessary for building the dataset, building the model, and running training & evaluation. These methods are driven by `tfm.core.train_lib.run_experiment`."
]
},
{
Expand Down Expand Up @@ -1063,7 +1063,7 @@
" return tf.cast(resized_crops, box_masks.dtype)\n",
"\n",
" image_masks = tf.cond(\n",
" tf.shape(box_masks)[0] \u003e 0,\n",
" tf.shape(box_masks)[0] > 0,\n",
" reframe_box_masks_to_image_masks_default,\n",
" lambda: tf.zeros([0, image_height, image_width, 1], box_masks.dtype))\n",
" return tf.squeeze(image_masks, axis=3)"
Expand Down Expand Up @@ -1098,7 +1098,7 @@
" detection_masks, detection_boxes/256.0,\n",
" image_np.shape[0], image_np.shape[1])\n",
" detection_masks_reframed = tf.cast(\n",
" detection_masks_reframed \u003e min_score_thresh,\n",
" detection_masks_reframed > min_score_thresh,\n",
" np.uint8)\n",
"\n",
" result['detection_masks_reframed'] = detection_masks_reframed.numpy()\n",
Expand Down

0 comments on commit 3aed8d9

Please sign in to comment.