Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed several typos #11180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion research/cvt_text/base/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ['<pad>', '<unk>', '<start>', '<end>', '<missing>']
Expand Down
2 changes: 1 addition & 1 deletion research/deep_speech/data/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion research/deep_speech/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/core/feature_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/core/nas_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/core/preprocess_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/core/xception.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions research/deeplab/datasets/build_ade20k_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/datasets/build_cityscapes_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/datasets/data_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions research/deeplab/deeplab_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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",
"<h3><a href=\"https://cloud.google.com/tpu/\"><img valign=\"middle\" src=\"https://raw.githubusercontent.com/GoogleCloudPlatform/tensorflow-without-a-phd/master/tensorflow-rl-pong/images/tpu-hexagon.png\" width=\"50\"></a> &nbsp;&nbsp;Use a free TPU device</h3>\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."
]
},
{
Expand All @@ -41,7 +41,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"cellView": "code",
"colab": {},
Expand Down Expand Up @@ -82,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"cellView": "code",
"colab": {},
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -243,7 +243,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"colab": {},
"colab_type": "code",
Expand Down Expand Up @@ -299,7 +299,7 @@
},
{
"cell_type": "code",
"execution_count": 0,
"execution_count": null,
"metadata": {
"cellView": "form",
"colab": {},
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/evaluation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defined as follows:
</p>

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).

Expand Down
4 changes: 2 additions & 2 deletions research/deeplab/evaluation/eval_coco_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion research/deeplab/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down