From f693bb0b6f3ed836e71edc1bbac8e3e14f54ba6d Mon Sep 17 00:00:00 2001 From: Venkat6871 Date: Mon, 4 Mar 2024 12:42:51 +0530 Subject: [PATCH] Fixed several typos --- research/cvt_text/base/embeddings.py | 2 +- research/deep_speech/data/download.py | 2 +- research/deep_speech/decoder.py | 2 +- research/deeplab/core/feature_extractor.py | 2 +- research/deeplab/core/nas_network.py | 2 +- .../deeplab/core/preprocess_utils_test.py | 2 +- research/deeplab/core/xception.py | 2 +- .../deeplab/datasets/build_ade20k_data.py | 4 ++-- .../deeplab/datasets/build_cityscapes_data.py | 2 +- research/deeplab/datasets/data_generator.py | 2 +- research/deeplab/deeplab_demo.ipynb | 20 +++++++++---------- research/deeplab/evaluation/README.md | 2 +- .../deeplab/evaluation/eval_coco_format.py | 4 ++-- research/deeplab/train.py | 2 +- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/research/cvt_text/base/embeddings.py b/research/cvt_text/base/embeddings.py index 8863f547efb..0f638ee6031 100644 --- a/research/cvt_text/base/embeddings.py +++ b/research/cvt_text/base/embeddings.py @@ -52,7 +52,7 @@ '00-00', '00-00-00', '0-00-00', '00-00-0000', '0-00-0000', '0000-00-00', '00-0-00-0', '00000000', '0:00.000', '00:00.000', '0%', '00%', '00.' '0000.', '0.0bn', '0.0m', '0-', '00-', - # ontonotes uses **f to represent formulas and -amp- instead of amperstands + # ontonotes uses **f to represent formulas and -amp- instead of ampersands '**f', '-amp-' ] SPECIAL_TOKENS = ['', '', '', '', ''] diff --git a/research/deep_speech/data/download.py b/research/deep_speech/data/download.py index 3ea6e2f3e54..21153fceae1 100644 --- a/research/deep_speech/data/download.py +++ b/research/deep_speech/data/download.py @@ -102,7 +102,7 @@ def convert_audio_and_split_transcript(input_dir, source_name, target_name, Parse the transcript file and generate a new csv file which has three columns: "wav_filename": the absolute path to a wav file. "wav_filesize": the size of the corresponding wav file. - "transcript": the transcript for this audio segement. + "transcript": the transcript for this audio segment. Args: input_dir: the directory which holds the input dataset. diff --git a/research/deep_speech/decoder.py b/research/deep_speech/decoder.py index bf618bcb63c..e54af2fd32c 100644 --- a/research/deep_speech/decoder.py +++ b/research/deep_speech/decoder.py @@ -82,7 +82,7 @@ def cer(self, decode, target): def decode(self, logits): """Decode the best guess from logits using greedy algorithm.""" - # Choose the class with maximimum probability. + # Choose the class with maximum probability. best = list(np.argmax(logits, axis=1)) # Merge repeated chars. merge = [k for k, _ in itertools.groupby(best)] diff --git a/research/deeplab/core/feature_extractor.py b/research/deeplab/core/feature_extractor.py index 553bd9b6a73..591e034d506 100644 --- a/research/deeplab/core/feature_extractor.py +++ b/research/deeplab/core/feature_extractor.py @@ -574,7 +574,7 @@ def extract_features(images, depthwise convolution weights. preprocess_images: Performs preprocessing on images or not. Defaults to True. Set to False if preprocessing will be done by other functions. We - supprot two types of preprocessing: (1) Mean pixel substraction and (2) + support two types of preprocessing: (1) Mean pixel subtraction and (2) Pixel values normalization to be [-1, 1]. preprocessed_images_dtype: The type after the preprocessing function. num_classes: Number of classes for image classification task. Defaults diff --git a/research/deeplab/core/nas_network.py b/research/deeplab/core/nas_network.py index 1da2e04dbaa..a86799abb78 100644 --- a/research/deeplab/core/nas_network.py +++ b/research/deeplab/core/nas_network.py @@ -135,7 +135,7 @@ def _build_nas_base(images, hparams: Hyperparameters needed to construct the network. global_pool: If True, we perform global average pooling before computing the logits. Set to True for image classification, False for dense prediction. - output_stride: Interger, the stride of output feature maps. + output_stride: Integer, the stride of output feature maps. nas_use_classification_head: Boolean, use image classification head. reuse: Whether or not the network and its variables should be reused. To be able to reuse 'scope' must be given. diff --git a/research/deeplab/core/preprocess_utils_test.py b/research/deeplab/core/preprocess_utils_test.py index 606fe46dd62..dd34e800f87 100644 --- a/research/deeplab/core/preprocess_utils_test.py +++ b/research/deeplab/core/preprocess_utils_test.py @@ -178,7 +178,7 @@ def testReturnDifferentCropAreasOnTwoEvals(self): crop1 = cropped.eval(feed_dict={image_placeholder: image}) self.assertFalse(np.isclose(crop0, crop1).all()) - def testReturnConsistenCropsOfImagesInTheList(self): + def testReturnConsistentCropsOfImagesInTheList(self): tf.compat.v1.set_random_seed(0) height, width = 10, 20 diff --git a/research/deeplab/core/xception.py b/research/deeplab/core/xception.py index f9925714716..ef0d6bf02e6 100644 --- a/research/deeplab/core/xception.py +++ b/research/deeplab/core/xception.py @@ -901,7 +901,7 @@ def xception_arg_scope(weight_decay=0.00004, normalizing activations by their variance in batch normalization. batch_norm_scale: If True, uses an explicit `gamma` multiplier to scale the activations in the batch normalization layer. - weights_initializer_stddev: The standard deviation of the trunctated normal + weights_initializer_stddev: The standard deviation of the truncated normal weight initializer. regularize_depthwise: Whether or not apply L2-norm regularization on the depthwise convolution weights. diff --git a/research/deeplab/datasets/build_ade20k_data.py b/research/deeplab/datasets/build_ade20k_data.py index fc04ed0db04..87d184793dc 100644 --- a/research/deeplab/datasets/build_ade20k_data.py +++ b/research/deeplab/datasets/build_ade20k_data.py @@ -32,11 +32,11 @@ tf.app.flags.DEFINE_string( 'train_image_folder', './ADE20K/ADEChallengeData2016/images/training', - 'Folder containing trainng images') + 'Folder containing training images') tf.app.flags.DEFINE_string( 'train_image_label_folder', './ADE20K/ADEChallengeData2016/annotations/training', - 'Folder containing annotations for trainng images') + 'Folder containing annotations for training images') tf.app.flags.DEFINE_string( 'val_image_folder', diff --git a/research/deeplab/datasets/build_cityscapes_data.py b/research/deeplab/datasets/build_cityscapes_data.py index 53c11e30310..8f93e56a489 100644 --- a/research/deeplab/datasets/build_cityscapes_data.py +++ b/research/deeplab/datasets/build_cityscapes_data.py @@ -19,7 +19,7 @@ The Cityscapes dataset is expected to have the following directory structure: + cityscapes - - build_cityscapes_data.py (current working directiory). + - build_cityscapes_data.py (current working directory). - build_data.py + cityscapesscripts + annotation diff --git a/research/deeplab/datasets/data_generator.py b/research/deeplab/datasets/data_generator.py index d84e66f9c48..b79f6785d6f 100644 --- a/research/deeplab/datasets/data_generator.py +++ b/research/deeplab/datasets/data_generator.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== -"""Wrapper for providing semantic segmentaion data. +"""Wrapper for providing semantic segmentation data. The SegmentationDataset class provides both images and annotations (semantic segmentation and/or instance segmentation) for TensorFlow. Currently, we diff --git a/research/deeplab/deeplab_demo.ipynb b/research/deeplab/deeplab_demo.ipynb index 81ccfde1b64..45add25279b 100644 --- a/research/deeplab/deeplab_demo.ipynb +++ b/research/deeplab/deeplab_demo.ipynb @@ -9,7 +9,7 @@ "source": [ "# Overview\n", "\n", - "This colab demonstrates the steps to use the DeepLab model to perform semantic segmentation on a sample input image. Expected outputs are semantic labels overlayed on the sample image.\n", + "This colab demonstrates the steps to use the DeepLab model to perform semantic segmentation on a sample input image. Expected outputs are semantic labels overlaid on the sample image.\n", "\n", "### About DeepLab\n", "The models used in this colab perform semantic segmentation. Semantic segmentation models focus on assigning semantic labels, such as sky, person, or car, to multiple objects and stuff in a single image." @@ -23,10 +23,10 @@ }, "source": [ "# Instructions\n", - "\u003ch3\u003e\u003ca href=\"https://cloud.google.com/tpu/\"\u003e\u003cimg valign=\"middle\" src=\"https://raw.githubusercontent.com/GoogleCloudPlatform/tensorflow-without-a-phd/master/tensorflow-rl-pong/images/tpu-hexagon.png\" width=\"50\"\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;Use a free TPU device\u003c/h3\u003e\n", + "

  Use a free TPU device

\n", "\n", " 1. On the main menu, click Runtime and select **Change runtime type**. Set \"TPU\" as the hardware accelerator.\n", - " 1. Click Runtime again and select **Runtime \u003e Run All**. You can also run the cells manually with Shift-ENTER." + " 1. Click Runtime again and select **Runtime > Run All**. You can also run the cells manually with Shift-ENTER." ] }, { @@ -41,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 0, + "execution_count": null, "metadata": { "cellView": "code", "colab": {}, @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 0, + "execution_count": null, "metadata": { "cellView": "code", "colab": {}, @@ -154,8 +154,8 @@ "\n", " for shift in reversed(range(8)):\n", " for channel in range(3):\n", - " colormap[:, channel] |= ((ind \u003e\u003e channel) \u0026 1) \u003c\u003c shift\n", - " ind \u003e\u003e= 3\n", + " colormap[:, channel] |= ((ind >> channel) & 1) << shift\n", + " ind >>= 3\n", "\n", " return colormap\n", "\n", @@ -180,7 +180,7 @@ "\n", " colormap = create_pascal_label_colormap()\n", "\n", - " if np.max(label) \u003e= len(colormap):\n", + " if np.max(label) >= len(colormap):\n", " raise ValueError('label value too large.')\n", "\n", " return colormap[label]\n", @@ -243,7 +243,7 @@ }, { "cell_type": "code", - "execution_count": 0, + "execution_count": null, "metadata": { "colab": {}, "colab_type": "code", @@ -299,7 +299,7 @@ }, { "cell_type": "code", - "execution_count": 0, + "execution_count": null, "metadata": { "cellView": "form", "colab": {}, diff --git a/research/deeplab/evaluation/README.md b/research/deeplab/evaluation/README.md index 69255384e9a..ad23197eaa1 100644 --- a/research/deeplab/evaluation/README.md +++ b/research/deeplab/evaluation/README.md @@ -30,7 +30,7 @@ defined as follows:

where R and R' are groundtruth regions and predicted regions respectively, -and |TP|, |FP|, and |FN| are the number of true positives, false postives, +and |TP|, |FP|, and |FN| are the number of true positives, false positives, and false negatives. The matching is determined by a threshold of 0.5 Intersection-Over-Union (IOU). diff --git a/research/deeplab/evaluation/eval_coco_format.py b/research/deeplab/evaluation/eval_coco_format.py index 1a26446f16b..ff92759f160 100644 --- a/research/deeplab/evaluation/eval_coco_format.py +++ b/research/deeplab/evaluation/eval_coco_format.py @@ -100,7 +100,7 @@ def _build_metric(metric, max_instances_per_category, intersection_offset=None, normalize_by_image_size=True): - """Creates a metric aggregator objet of the given name.""" + """Creates a metric aggregator object of the given name.""" if metric == 'pq': logging.warning('One should check Panoptic Quality results against the ' 'official COCO API code. Small numerical differences ' @@ -299,7 +299,7 @@ def eval_coco_format(gt_json_file, for ann_pair in _matched_annotations(gt_json, pred_json): work_queue.put(ann_pair, block=True) - # Will cause each worker to return a result and terminate upon recieving a + # Will cause each worker to return a result and terminate upon receiving a # None task. for _ in six.moves.range(num_workers): work_queue.put(None, block=True) diff --git a/research/deeplab/train.py b/research/deeplab/train.py index fbe060dccd4..db51deaf1ec 100644 --- a/research/deeplab/train.py +++ b/research/deeplab/train.py @@ -172,7 +172,7 @@ 'Fine tune the batch norm parameters or not.') flags.DEFINE_float('min_scale_factor', 0.5, - 'Mininum scale factor for data augmentation.') + 'Minimum scale factor for data augmentation.') flags.DEFINE_float('max_scale_factor', 2., 'Maximum scale factor for data augmentation.')