python_code
stringlengths
0
679k
repo_name
stringlengths
9
41
file_path
stringlengths
6
149
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Recommendation/DLRM_and_DCNv2/deployment/hps/deploy_sparse.py
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Recommendation/DLRM_and_DCNv2/deployment/hps/deploy_ensemble.py
""" Script to benchmark model throughput and latency """ import os import numpy as np from tqdm import tqdm from timeit import default_timer as timer import hydra from omegaconf import DictConfig import tensorflow as tf from tensorflow.keras import mixed_precision from data_generators import tf_data_generator from uti...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/benchmark_inference.py
""" Prediction script used to visualize model output """ import os import hydra from omegaconf import DictConfig from data_generators import tf_data_generator from utils.general_utils import join_paths, suppress_warnings from utils.images_utils import display from utils.images_utils import postprocess_mask, denormaliz...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/predict.py
""" Training script """ import numpy as np from datetime import datetime, timedelta import hydra from omegaconf import DictConfig import tensorflow as tf from tensorflow.keras import mixed_precision from tensorflow.keras.callbacks import ( EarlyStopping, ModelCheckpoint, TensorBoard, CSVLogger ) from d...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/train.py
""" Evaluation script used to calculate accuracy of trained model """ import os import hydra from omegaconf import DictConfig import tensorflow as tf from tensorflow.keras import mixed_precision from data_generators import data_generator from utils.general_utils import join_paths, set_gpus, suppress_warnings from mode...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/evaluate.py
""" Implementation of different loss functions """ import tensorflow as tf import tensorflow.keras.backend as K def iou(y_true, y_pred, smooth=1.e-9): """ Calculate intersection over union (IoU) between images. Input shape should be Batch x Height x Width x #Classes (BxHxWxN). Using Mean as reduction ...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/losses/loss.py
""" UNet 3+ Loss """ from .loss import focal_loss, ssim_loss, iou_loss def unet3p_hybrid_loss(y_true, y_pred): """ Hybrid loss proposed in UNET 3+ (https://arxiv.org/ftp/arxiv/papers/2004/2004.08790.pdf) Hybrid loss for segmentation in three-level hierarchy – pixel, patch and map-level, which is a...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/losses/unet_loss.py
import sys from timeit import default_timer as timer import tensorflow as tf class TimingCallback(tf.keras.callbacks.Callback): """ Custom callback to note training time, latency and throughput """ def __init__(self, ): super(TimingCallback, self).__init__() self.train_start_time = No...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/callbacks/timing_callback.py
""" Verify for each image corresponding mask exist or not. Check against both train and val data """ import os import sys from omegaconf import DictConfig from tqdm import tqdm sys.path.append(os.path.abspath("./")) from utils.general_utils import join_paths from utils.images_utils import image_to_mask_name def chec...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/data_preparation/verify_data.py
""" Convert LiTS 2017 (Liver Tumor Segmentation) data into UNet3+ data format LiTS: https://competitions.codalab.org/competitions/17094 """ import os import sys from glob import glob from pathlib import Path from tqdm import tqdm import numpy as np import multiprocessing as mp import cv2 import nibabel as nib import hy...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/data_preparation/preprocess_data.py
""" General Utility functions """ import os import tensorflow as tf from omegaconf import DictConfig from .images_utils import image_to_mask_name def create_directory(path): """ Create Directory if it already does not exist. """ if not os.path.exists(path): os.makedirs(path) def join_paths(*...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/utils/general_utils.py
""" Utility functions for image processing """ import numpy as np import cv2 from omegaconf import DictConfig import matplotlib.pyplot as plt def read_image(img_path, color_mode): """ Read and return image as np array from given path. In case of color image, it returns image in BGR mode. """ retur...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/utils/images_utils.py
""" UNet3+ base model """ import tensorflow as tf import tensorflow.keras as k from .unet3plus_utils import conv_block def unet3plus(encoder_layer, output_channels, filters): """ UNet3+ base model """ """ Encoder """ e1 = encoder_layer[0] e2 = encoder_layer[1] e3 = encoder_layer[2] e4 = encod...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/models/unet3plus.py
""" UNet_3Plus with Deep Supervision and Classification Guided Module """ import tensorflow as tf import tensorflow.keras as k from .unet3plus_utils import conv_block, dot_product def unet3plus_deepsup_cgm(encoder_layer, output_channels, filters, training=False): """ UNet_3Plus with Deep Supervision and Classific...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/models/unet3plus_deep_supervision_cgm.py
""" Unet3+ backbones """ import tensorflow as tf import tensorflow.keras as k from .unet3plus_utils import conv_block def vgg16_backbone(input_layer, ): """ VGG-16 backbone as encoder for UNet3P """ base_model = tf.keras.applications.VGG16( input_tensor=input_layer, weights=None, incl...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/models/backbones.py
""" Returns Unet3+ model """ import tensorflow as tf from omegaconf import DictConfig from .backbones import vgg16_backbone, vgg19_backbone, unet3plus_backbone from .unet3plus import unet3plus from .unet3plus_deep_supervision import unet3plus_deepsup from .unet3plus_deep_supervision_cgm import unet3plus_deepsup_cgm ...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/models/model.py
""" UNet3+ with Deep Supervision """ import tensorflow as tf import tensorflow.keras as k from .unet3plus_utils import conv_block def unet3plus_deepsup(encoder_layer, output_channels, filters, training=False): """ UNet_3Plus with Deep Supervision """ """ Encoder """ e1 = encoder_layer[0] e2 = encoder...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/models/unet3plus_deep_supervision.py
""" Utility functions for Unet3+ models """ import tensorflow as tf import tensorflow.keras as k def conv_block(x, kernels, kernel_size=(3, 3), strides=(1, 1), padding='same', is_bn=True, is_relu=True, n=2): """ Custom function for conv2d: Apply 3*3 convolutions with BN and relu. """ ...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/models/unet3plus_utils.py
""" NVIDIA DALI data generator object. """ import nvidia.dali.fn as fn from nvidia.dali import pipeline_def import nvidia.dali.types as types import nvidia.dali.plugin.tf as dali_tf import tensorflow as tf from omegaconf import DictConfig from utils.general_utils import get_data_paths, get_gpus_count def data_genera...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/data_generators/dali_data_generator.py
""" Data generator """ import os import tensorflow as tf from omegaconf import DictConfig from utils.general_utils import join_paths, get_gpus_count from .tf_data_generator import DataGenerator as tf_data_generator try: from .dali_data_generator import data_generator as dali_data_generator except ModuleNotFoundEr...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/data_generators/data_generator.py
""" Tensorflow data generator class. """ import tensorflow as tf import numpy as np from omegaconf import DictConfig from utils.general_utils import get_data_paths from utils.images_utils import prepare_image, prepare_mask class DataGenerator(tf.keras.utils.Sequence): """ Generate batches of data for model b...
DeepLearningExamples-master
TensorFlow2/Segmentation/Contrib/UNet3P/data_generators/tf_data_generator.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/main.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/config.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/arguments.py
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/__init__.py
from .dataset import Dataset
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/dataset/__init__.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/dataset/dataset.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/dataset/dataset_parser.py
""" Custom mapping that maps model backbone to weights from NVIDIA ResNet50 v1.5 checkpoint. """ # pylint: disable=line-too-long WEIGHTS_MAPPING = { 'mrcnn/resnet50/bottleneck_group/bottleneck_block/conv2d_block_1/batch_normalization_2/beta': 'resnet50/btlnck_block_0_0/bottleneck_1/BatchNorm/beta', 'mrcnn/resn...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/runtime/weights_mapping.py
import logging import os import tensorflow as tf import dllogger from mrcnn_tf2.model.mask_rcnn import MaskRCNN from mrcnn_tf2.runtime.callbacks import DLLoggerMetricsCallback, DLLoggerPerfCallback, PretrainedWeightsLoadingCallback from mrcnn_tf2.runtime.evaluation import evaluate from mrcnn_tf2.runtime.learning_rate...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/runtime/run.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/runtime/evaluation.py
import tensorflow as tf class PiecewiseConstantWithWarmupSchedule(tf.keras.optimizers.schedules.LearningRateSchedule): """ Schedule that starts with learning rate at `init_value` and monotonically increases it up to `values[0]` at step `boundaries[0]`. After that the learning rate changes on each boun...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/runtime/learning_rate.py
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/runtime/__init__.py
import logging import time from collections import defaultdict import numpy as np import tensorflow as tf from mrcnn_tf2.utils.keras import KerasCallback CONFIDENCE_INTERVAL_Z = { 80.0: 1.282, 85.0: 1.440, 90.0: 1.645, 95.0: 1.960, 99.0: 2.576, 99.5: 2.807, 99.9: 3.291, } class DLLogger...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/runtime/callbacks.py
import tensorflow as tf class KerasCallback(tf.keras.callbacks.Callback): """ Utility class that simplifies usage of Keras callback across different modes. """ def __init__(self): super().__init__() self._current_epoch = None def on_any_begin(self, mode, logs): pass def on_a...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/utils/keras.py
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/utils/__init__.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/utils/box_utils.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/utils/dllogger.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/utils/coco_metric.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/utils/coco_utils.py
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/__init__.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/anchors.py
import tensorflow as tf from mrcnn_tf2.model import anchors from mrcnn_tf2.model.losses import MaskRCNNLoss, FastRCNNLoss, RPNLoss from mrcnn_tf2.model.models.fpn import FPNNetwork from mrcnn_tf2.model.models.heads import RPNHead, BoxHead, MaskHead from mrcnn_tf2.model.models.resnet50 import ResNet50 from mrcnn_tf2.op...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/mask_rcnn.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/losses.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/fpn.py
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/__init__.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/heads.py
import tensorflow as tf from mrcnn_tf2.model.models.resnet50 import BottleneckBlock class BottleneckGroup(tf.keras.layers.Layer): def __init__(self, blocks, filters, strides, trainable=True): super().__init__(trainable=trainable) self.blocks = [] for block_id in range(blocks): ...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/resnet50/bottleneck_group.py
import tensorflow as tf from mrcnn_tf2.model.models.resnet50 import Conv2DBlock class BottleneckBlock(tf.keras.layers.Layer): def __init__(self, filters, strides, expansion=1, shortcut='conv2d', trainable=True, *args, **kwargs): super().__init__(trainable=trainable, *args, **kwargs) if shortcut...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/resnet50/bottleneck_block.py
from .conv2d_block import Conv2DBlock from .bottleneck_block import BottleneckBlock from .bottleneck_group import BottleneckGroup from .resnet import ResNet50
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/resnet50/__init__.py
import tensorflow as tf from mrcnn_tf2.model.models.resnet50 import BottleneckGroup, Conv2DBlock class ResNet50(tf.keras.Model): def __init__(self, name='resnet50', *args, **kwargs): super().__init__(name=name, *args, **kwargs) self.conv2d = Conv2DBlock( filters=64, kern...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/resnet50/resnet.py
import tensorflow as tf class Conv2DBlock(tf.keras.layers.Layer): def __init__(self, filters, kernel_size, strides, padding='SAME', use_batch_norm=True, use_relu=True, trainable=True, trainable_batch_norm=False, *args, **kwargs): super().__init__(trainable=trainable, *ar...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/model/models/resnet50/conv2d_block.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/target_assigner.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/matcher.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/faster_rcnn_box_coder.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/shape_utils.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/box_coder.py
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/__init__.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/minibatch_sampler.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/preprocessor.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/ops.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/balanced_positive_negative_sampler.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/box_list.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/region_similarity_calculator.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/tf_example_decoder.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/object_detection/argmax_matcher.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/ops/training_ops.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/ops/spatial_transform_ops.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/ops/postprocess_ops.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/ops/roi_ops.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/ops/preprocess_ops.py
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/ops/__init__.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/ops/box_utils.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/dataset/create_coco_tf_record.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/scripts/benchmark_training.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/scripts/benchmark_inference.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/scripts/download_weights.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/scripts/train.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/scripts/inference.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/MaskRCNN/scripts/evaluate.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/download_dataset.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/main.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/data_loading/data_loader.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/runtime/run.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/runtime/parse_results.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/runtime/arguments.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/runtime/setup.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/runtime/losses.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/model/unet.py
import os from operator import itemgetter import tensorflow as tf from tensorflow.python.compiler.tensorrt import trt_convert as trt from tensorflow.compat.v1.saved_model import tag_constants, signature_constants def export_model(model_dir, prec, tf_trt_model_dir=None): model = tf.keras.models.load_model(os.path...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/model/tf_trt.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/UNet_Medical/model/layers.py
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/preprocess.py
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/download.py
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/evaluate.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/main.py
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/data_loading/data_module.py
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/data_loading/dali_loader.py
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/data_loading/utils.py
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
DeepLearningExamples-master
TensorFlow2/Segmentation/nnUNet/runtime/logging.py