code
stringlengths
501
5.19M
package
stringlengths
2
81
path
stringlengths
9
304
filename
stringlengths
4
145
r"""A Beam job to add contextual memory banks to tf.Examples. This tool groups images containing bounding boxes and embedded context features by a key, either `image/location` or `image/seq_id`, and time horizon, then uses these groups to build up a contextual memory bank from the embedded context features from each i...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/dataset_tools/context_rcnn/add_context_to_examples.py
add_context_to_examples.py
r"""A Beam job to generate embedding data for camera trap images. This tool runs inference with an exported Object Detection model in `saved_model` format and produce raw embeddings for camera trap data. These embeddings contain an object-centric feature embedding from Faster R-CNN, the datetime that the image was tak...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/dataset_tools/context_rcnn/generate_embedding_data.py
generate_embedding_data.py
r"""Beam pipeline to create COCO Camera Traps Object Detection TFRecords. Please note that this tool creates sharded output files. This tool assumes the input annotations are in the COCO Camera Traps json format, specified here: https://github.com/Microsoft/CameraTraps/blob/master/data_management/README.md Example u...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/dataset_tools/context_rcnn/create_cococameratraps_tfexample_main.py
create_cococameratraps_tfexample_main.py
r"""Training executable for detection models. This executable is used to train DetectionModels. There are two ways of configuring the training job: 1) A single pipeline_pb2.TrainEvalPipelineConfig configuration file can be specified by --pipeline_config_path. Example usage: ./train \ --logtostderr \ ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/legacy/train.py
train.py
import logging import tensorflow.compat.v1 as tf from object_detection import eval_util from object_detection.core import prefetcher from object_detection.core import standard_fields as fields from object_detection.metrics import coco_evaluation from object_detection.utils import object_detection_evaluation # A dicti...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/legacy/evaluator.py
evaluator.py
r"""Evaluation executable for detection models. This executable is used to evaluate DetectionModels. There are two ways of configuring the eval job. 1) A single pipeline_pb2.TrainEvalPipelineConfig file maybe specified instead. In this mode, the --eval_training_data flag may be given to force the pipeline to evaluate...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/legacy/eval.py
eval.py
import functools import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.builders import optimizer_builder from object_detection.builders import preprocessor_builder from object_detection.core import batcher from object_detection.core import preprocessor from object_detection.core import standa...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/legacy/trainer.py
trainer.py
r"""Infers detections on a TFRecord of TFExamples given an inference graph. Example usage: ./infer_detections \ --input_tfrecord_paths=/path/to/input/tfrecord1,/path/to/input/tfrecord2 \ --output_tfrecord_path=/path/to/output/detections.tfrecord \ --inference_graph=/path/to/frozen_weights_inference_graph...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/inference/infer_detections.py
infer_detections.py
"""Utility functions for detection inference.""" from __future__ import division import tensorflow.compat.v1 as tf from object_detection.core import standard_fields def build_input(tfrecord_paths): """Builds the graph's input. Args: tfrecord_paths: List of paths to the input TFRecords Returns: seria...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/inference/detection_inference.py
detection_inference.py
"""SSD feature extractors based on Resnet v1 and PPN architectures.""" import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import context_manager from object_detect...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_resnet_v1_ppn_feature_extractor.py
ssd_resnet_v1_ppn_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import context_manager from object_detection.utils import ops from object_detection.utils import shape_utils from...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v1_feature_extractor.py
ssd_mobilenet_v1_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range import tensorflow.compat.v1 as tf from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.mode...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v2_fpn_keras_feature_extractor.py
ssd_mobilenet_v2_fpn_keras_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.utils import variables_helper #...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_nas_feature_extractor.py
faster_rcnn_nas_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators fro...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_resnet_v1_fpn_feature_extractor.py
ssd_resnet_v1_fpn_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import functools from six.moves import range from six.moves import zip import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.utils import ops from object_detection.uti...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/feature_map_generators.py
feature_map_generators.py
"""SSDFeatureExtractor for InceptionV2 features.""" import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import ops from object_detection.utils import shape_utils fr...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_inception_v2_feature_extractor.py
ssd_inception_v2_feature_extractor.py
import collections import functools from six.moves import range from six.moves import zip import tensorflow as tf from object_detection.utils import bifpn_utils def _create_bifpn_input_config(fpn_min_level, fpn_max_level, input_max_level, ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/bidirectional_feature_pyramid_generators.py
bidirectional_feature_pyramid_generators.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.models.keras_models import mobilenet_v2 from object_detection.utils import ops from object_detection.utils import shape_utils class SSDMobil...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v2_keras_feature_extractor.py
ssd_mobilenet_v2_keras_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import faster_rcnn_meta_arch from nets import inception_v2 def _batch_norm_arg_scope(list_ops, use_batch_norm=True, batch_norm_decay=0.9997, ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_inception_v2_feature_extractor.py
faster_rcnn_inception_v2_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.utils import variables_helper from nets import inception_resnet_v2 class FasterRCNNInceptionResnetV2FeatureExtractor( faster_rcnn_meta_arch.FasterRCNNFeatureExtract...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_inception_resnet_v2_feature_extractor.py
faster_rcnn_inception_resnet_v2_feature_extractor.py
# Skip pylint for this file because it times out # pylint: skip-file import tensorflow.compat.v1 as tf from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.models.keras_models import inception_resnet_v2 from object_detection.utils import model_util from object_detection.utils im...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_inception_resnet_v2_keras_feature_extractor.py
faster_rcnn_inception_resnet_v2_keras_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import context_manager from object_detection.utils import ops from nets import mobilenet_v1 class EmbeddedSSDMo...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/embedded_ssd_mobilenet_v1_feature_extractor.py
embedded_ssd_mobilenet_v1_feature_extractor.py
"""Mobilenet v1 Faster R-CNN implementation.""" import numpy as np import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.utils import shape_utils from nets import mobilenet_v1 def _get_mobilenet_conv_no_last_stride_defs(...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_mobilenet_v1_feature_extractor.py
faster_rcnn_mobilenet_v1_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import context_manager from object_detection.utils import ops from object_detection.utils import shape_utils from...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v1_ppn_feature_extractor.py
ssd_mobilenet_v1_ppn_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import context_manager from object_detection.utils import ops from object_detection.utils import variables_helper...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_pnasnet_feature_extractor.py
ssd_pnasnet_feature_extractor.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.models.keras_models import resnet_v1 from object_detection.utils import model_util _RESNET_MODEL_CONV4_LAST_LAYERS = { 'resnet_v1_50': 'conv4_block6_out', 'resnet_v1_101': 'conv4_bloc...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_resnet_keras_feature_extractor.py
faster_rcnn_resnet_keras_feature_extractor.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.models import feature_map_generators from object_detection.models.keras_models import resnet_v1 from object_detection.utils import ops _RESNET_MODEL_OUTPUT_LAYERS = { 'resnet_v1_50': ['co...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_resnet_v1_fpn_keras_feature_extractor.py
faster_rcnn_resnet_v1_fpn_keras_feature_extractor.py
"""SSDFeatureExtractor for MobileDet features.""" import functools import numpy as np import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import ops from object_det...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobiledet_feature_extractor.py
ssd_mobiledet_feature_extractor.py
"""SSD MobilenetV2 NAS-FPN Feature Extractor.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import functools from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectur...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v2_mnasfpn_feature_extractor.py
ssd_mobilenet_v2_mnasfpn_feature_extractor.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures import center_net_meta_arch from object_detection.models.keras_models import mobilenet_v2 as mobilenetv2 class CenterNetMobileNetV2FeatureExtractor( center_net_meta_arch.CenterNetFeatureExtractor): """The MobileNet V2 feature extractor ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/center_net_mobilenet_v2_feature_extractor.py
center_net_mobilenet_v2_feature_extractor.py
"""SSDFeatureExtractor for MobileNetV3 features.""" import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import context_manager from object_detection.utils import op...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v3_feature_extractor.py
ssd_mobilenet_v3_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import context_manager from object_detection.utils import ops from object_detection.utils import shape_utils from...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v2_feature_extractor.py
ssd_mobilenet_v2_feature_extractor.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.models.keras_models import mobilenet_v1 from object_detection.utils import ops from object_detection.utils import shape_utils class SSDMobil...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v1_keras_feature_extractor.py
ssd_mobilenet_v1_keras_feature_extractor.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures import center_net_meta_arch from object_detection.models.keras_models import mobilenet_v2 as mobilenetv2 _MOBILENET_V2_FPN_SKIP_LAYERS = [ 'block_2_add', 'block_5_add', 'block_9_add', 'out_relu' ] class CenterNetMobileNetV2FPNFeatureExt...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/center_net_mobilenet_v2_fpn_feature_extractor.py
center_net_mobilenet_v2_fpn_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range import tensorflow.compat.v1 as tf from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.mode...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v1_fpn_keras_feature_extractor.py
ssd_mobilenet_v1_fpn_keras_feature_extractor.py
from object_detection.meta_architectures import center_net_meta_arch from object_detection.models.keras_models import hourglass_network class CenterNetHourglassFeatureExtractor( center_net_meta_arch.CenterNetFeatureExtractor): """The hourglass feature extractor for CenterNet. This class is a thin wrapper aro...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/center_net_hourglass_feature_extractor.py
center_net_hourglass_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import functools from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models impo...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v1_fpn_feature_extractor.py
ssd_mobilenet_v1_fpn_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range from six.moves import zip import tensorflow.compat.v1 as tf from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_resnet_v1_fpn_keras_feature_extractor.py
ssd_resnet_v1_fpn_keras_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import functools from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models impo...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_mobilenet_v2_fpn_feature_extractor.py
ssd_mobilenet_v2_fpn_feature_extractor.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures.center_net_meta_arch import CenterNetFeatureExtractor class CenterNetResnetFeatureExtractor(CenterNetFeatureExtractor): """Resnet v2 base feature extractor for the CenterNet model.""" def __init__(self, resnet_type, channel_means=(0., 0....
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/center_net_resnet_feature_extractor.py
center_net_resnet_feature_extractor.py
"""SSD Keras-based EfficientNet + BiFPN (EfficientDet) Feature Extractor.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import logging from six.moves import range from six.moves import zip import tensorflow.compat.v2 as tf from tensorflow.py...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_efficientnet_bifpn_feature_extractor.py
ssd_efficientnet_bifpn_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.utils import variables_helper fr...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_pnas_feature_extractor.py
faster_rcnn_pnas_feature_extractor.py
import tensorflow.compat.v1 as tf from object_detection.meta_architectures.center_net_meta_arch import CenterNetFeatureExtractor from object_detection.models.keras_models import resnet_v1 _RESNET_MODEL_OUTPUT_LAYERS = { 'resnet_v1_18': ['conv2_block2_out', 'conv3_block2_out', 'conv4_block2_o...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py
center_net_resnet_v1_fpn_feature_extractor.py
"""SSDFeatureExtractor for InceptionV3 features.""" import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import ssd_meta_arch from object_detection.models import feature_map_generators from object_detection.utils import ops from object_detection.utils import shape_utils fr...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/ssd_inception_v3_feature_extractor.py
ssd_inception_v3_feature_extractor.py
import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.meta_architectures import faster_rcnn_meta_arch from nets import resnet_utils from nets import resnet_v1 class FasterRCNNResnetV1FeatureExtractor( faster_rcnn_meta_arch.FasterRCNNFeatureExtractor): """Faster R-CNN Resnet V1 feature ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/faster_rcnn_resnet_v1_feature_extractor.py
faster_rcnn_resnet_v1_feature_extractor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from object_detection.core import freezable_batch_norm class _LayersOverride(object): """Alternative Keras layers interface for the Keras InceptionResNetV2.""" def __in...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/keras_models/inception_resnet_v2.py
inception_resnet_v2.py
from __future__ import print_function import os from absl import app import numpy as np import tensorflow.compat.v1 as tf FLAGS = tf.flags.FLAGS tf.flags.DEFINE_string('model', 'resnet_v2_101', 'The model to load. The following are supported: ' '"resnet_v1_50", "resnet...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/keras_models/convert_keras_models.py
convert_keras_models.py
import tensorflow.compat.v2 as tf BATCH_NORM_EPSILON = 1e-5 BATCH_NORM_MOMENTUM = 0.1 BATCH_NORM_FUSED = True class IdentityLayer(tf.keras.layers.Layer): """A layer which passes through the input as it is.""" def call(self, inputs): return inputs def _get_padding_for_kernel_size(kernel_size): if kernel...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/keras_models/hourglass_network.py
hourglass_network.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from tensorflow.python.keras.applications import resnet from object_detection.core import freezable_batch_norm from object_detection.models.keras_models import model_utils d...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/keras_models/resnet_v1.py
resnet_v1.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from object_detection.core import freezable_batch_norm from object_detection.models.keras_models import model_utils def _fixed_padding(inputs, kernel_size, rate=1): # pylin...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/keras_models/mobilenet_v1.py
mobilenet_v1.py
"""A wrapper around the MobileNet v2 models for Keras, for object detection.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from object_detection.core import freezable_batch_norm from object_detection.models.keras_mode...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/models/keras_models/mobilenet_v2.py
mobilenet_v2.py
import tensorflow.compat.v1 as tf from object_detection.core import box_coder from object_detection.core import box_list EPSILON = 1e-8 class SquareBoxCoder(box_coder.BoxCoder): """Encodes a 3-scalar representation of a square box.""" def __init__(self, scale_factors=None): """Constructor for SquareBoxCode...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/box_coders/square_box_coder.py
square_box_coder.py
import tensorflow.compat.v1 as tf from object_detection.core import box_coder from object_detection.core import box_list EPSILON = 1e-8 class FasterRcnnBoxCoder(box_coder.BoxCoder): """Faster RCNN box coder.""" def __init__(self, scale_factors=None): """Constructor for FasterRcnnBoxCoder. Args: ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/box_coders/faster_rcnn_box_coder.py
faster_rcnn_box_coder.py
import tensorflow.compat.v1 as tf from object_detection.core import box_coder from object_detection.core import box_list from object_detection.core import standard_fields as fields EPSILON = 1e-8 class KeypointBoxCoder(box_coder.BoxCoder): """Keypoint box coder.""" def __init__(self, num_keypoints, scale_facto...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/box_coders/keypoint_box_coder.py
keypoint_box_coder.py
"""Library functions for ContextRCNN.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf import tf_slim as slim # The negative value used in padding the invalid weights. _NEGATIVE_PADDING_VALUE = -100000 def filter_weigh...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/context_rcnn_lib.py
context_rcnn_lib.py
import abc import collections import functools import tensorflow.compat.v1 as tf import tensorflow.compat.v2 as tf2 from object_detection.core import box_list from object_detection.core import box_list_ops from object_detection.core import keypoint_ops from object_detection.core import model from object_detection.core...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/center_net_meta_arch.py
center_net_meta_arch.py
from __future__ import print_function import abc import functools import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.builders import box_predictor_builder from object_detection.builders import hyperparams_builder from object_detection.core import box_list from object_detection.core import b...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/faster_rcnn_meta_arch.py
faster_rcnn_meta_arch.py
import collections import numpy as np import tensorflow as tf from object_detection.builders import losses_builder from object_detection.core import box_list from object_detection.core import box_list_ops from object_detection.core import losses from object_detection.core import preprocessor from object_detection.cor...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/deepmac_meta_arch.py
deepmac_meta_arch.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import tensorflow.compat.v1 as tf from object_detection.core import box_predictor from object_detection.core import standard_fields as fields from object_detection.meta_architectures import c...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/context_rcnn_meta_arch.py
context_rcnn_meta_arch.py
import tensorflow.compat.v1 as tf from object_detection.core import box_predictor from object_detection.meta_architectures import faster_rcnn_meta_arch from object_detection.utils import ops class RFCNMetaArch(faster_rcnn_meta_arch.FasterRCNNMetaArch): """R-FCN Meta-architecture definition.""" def __init__(self...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/rfcn_meta_arch.py
rfcn_meta_arch.py
"""Library functions for Context R-CNN.""" import tensorflow as tf from object_detection.core import freezable_batch_norm # The negative value used in padding the invalid weights. _NEGATIVE_PADDING_VALUE = -100000 class ContextProjection(tf.keras.layers.Layer): """Custom layer to do batch normalization and projec...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/context_rcnn_lib_tf2.py
context_rcnn_lib_tf2.py
import abc import tensorflow.compat.v1 as tf from tensorflow.python.util.deprecation import deprecated_args from object_detection.core import box_list from object_detection.core import box_list_ops from object_detection.core import matcher from object_detection.core import model from object_detection.core import standa...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/meta_architectures/ssd_meta_arch.py
ssd_meta_arch.py
"""RFCN Box Predictor.""" import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.core import box_predictor from object_detection.utils import ops BOX_ENCODINGS = box_predictor.BOX_ENCODINGS CLASS_PREDICTIONS_WITH_BACKGROUND = ( box_predictor.CLASS_PREDICTIONS_WITH_BACKGROUND) MASK_PREDICT...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/rfcn_box_predictor.py
rfcn_box_predictor.py
"""Convolutional Box Predictors with and without weight sharing.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from six.moves import range from six.moves import zip import tensorflow.compat.v1 as tf import tf_slim as slim from object_de...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/convolutional_box_predictor.py
convolutional_box_predictor.py
"""Convolutional Box Predictors with and without weight sharing.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from six.moves import range import tensorflow.compat.v1 as tf from object_detection.core import box_predictor from objec...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/convolutional_keras_box_predictor.py
convolutional_keras_box_predictor.py
"""Mask R-CNN Box Predictor.""" from object_detection.core import box_predictor BOX_ENCODINGS = box_predictor.BOX_ENCODINGS CLASS_PREDICTIONS_WITH_BACKGROUND = ( box_predictor.CLASS_PREDICTIONS_WITH_BACKGROUND) MASK_PREDICTIONS = box_predictor.MASK_PREDICTIONS class MaskRCNNBoxPredictor(box_predictor.BoxPredic...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/mask_rcnn_box_predictor.py
mask_rcnn_box_predictor.py
"""Mask R-CNN Box Predictor.""" from object_detection.core import box_predictor BOX_ENCODINGS = box_predictor.BOX_ENCODINGS CLASS_PREDICTIONS_WITH_BACKGROUND = ( box_predictor.CLASS_PREDICTIONS_WITH_BACKGROUND) MASK_PREDICTIONS = box_predictor.MASK_PREDICTIONS class MaskRCNNKerasBoxPredictor(box_predictor.Kera...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/mask_rcnn_keras_box_predictor.py
mask_rcnn_keras_box_predictor.py
"""RFCN Box Predictor.""" import tensorflow.compat.v1 as tf from object_detection.core import box_predictor from object_detection.utils import ops BOX_ENCODINGS = box_predictor.BOX_ENCODINGS CLASS_PREDICTIONS_WITH_BACKGROUND = ( box_predictor.CLASS_PREDICTIONS_WITH_BACKGROUND) MASK_PREDICTIONS = box_predictor.MAS...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/rfcn_keras_box_predictor.py
rfcn_keras_box_predictor.py
import tensorflow.compat.v1 as tf from object_detection.predictors.heads import head from object_detection.utils import shape_utils class ConvolutionalClassHead(head.KerasHead): """Convolutional class prediction head.""" def __init__(self, is_training, num_class_slots, ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/heads/keras_class_head.py
keras_class_head.py
import functools import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.predictors.heads import head from object_detection.utils import shape_utils class MaskRCNNClassHead(head.Head): """Mask RCNN class prediction head. Please refer to Mask RCNN paper: https://arxiv.org/abs/1703.06870 ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/heads/class_head.py
class_head.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.predictors.heads import head from object_detection.utils import ops class MaskRCNNMaskHe...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/heads/mask_head.py
mask_head.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math from six.moves import range import tensorflow.compat.v1 as tf from object_detection.predictors.heads import head from object_detection.utils import ops from object_detection.utils import shape_util...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/heads/keras_mask_head.py
keras_mask_head.py
import functools import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.predictors.heads import head class MaskRCNNBoxHead(head.Head): """Box prediction head. Please refer to Mask RCNN paper: https://arxiv.org/abs/1703.06870 """ def __init__(self, is_training, ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/heads/box_head.py
box_head.py
import tensorflow.compat.v1 as tf from object_detection.predictors.heads import head class ConvolutionalBoxHead(head.KerasHead): """Convolutional box prediction head.""" def __init__(self, is_training, box_code_size, kernel_size, num_predictions_per_lo...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/heads/keras_box_head.py
keras_box_head.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.predictors.heads import head class MaskRCNNKeypointHead(head.Head): """Mask RCNN keypoint predicti...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/predictors/heads/keypoint_head.py
keypoint_head.py
"""Python library for ssd model, tailored for TPU inference.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf # pylint: disable=g-import-not-at-top # Checking TF version, because this module relies on TPUPartitionedCall #...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/tpu_exporters/ssd.py
ssd.py
"""Python library for faster_rcnn model, tailored for TPU inference.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=protected-access import tensorflow.compat.v1 as tf # pylint: disable=g-import-not-at-top # Checking TF version, because...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/tpu_exporters/faster_rcnn.py
faster_rcnn.py
"""Python library for exporting SavedModel, tailored for TPU inference.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from google.protobuf import text_format # pylint: disable=g-direct-tensorflow-import from tensorflow...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/tpu_exporters/export_saved_model_tpu_lib.py
export_saved_model_tpu_lib.py
import tensorflow.compat.v1 as tf from object_detection.core import preprocessor from object_detection.protos import preprocessor_pb2 def _get_step_config_from_proto(preprocessor_step_config, step_name): """Returns the value of a field named step_name from proto. Args: preprocessor_step_config: A preprocess...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/preprocessor_builder.py
preprocessor_builder.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import zip from object_detection.anchor_generators import flexible_grid_anchor_generator from object_detection.anchor_generators import grid_anchor_generator from object_detection.anchor_generator...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/anchor_generator_builder.py
anchor_generator_builder.py
import functools import sys from absl import logging from object_detection.builders import anchor_generator_builder from object_detection.builders import box_coder_builder from object_detection.builders import box_predictor_builder from object_detection.builders import hyperparams_builder from object_detection.builde...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/model_builder.py
model_builder.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from object_detection.data_decoders import tf_example_decoder from object_detection.data_decoders import tf_sequence_example_decoder from object_detection.protos import input_reader_pb2 def build(input_reader...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/decoder_builder.py
decoder_builder.py
import functools from object_detection.core import balanced_positive_negative_sampler as sampler from object_detection.core import losses from object_detection.protos import losses_pb2 from object_detection.utils import ops def build(loss_config): """Build losses based on the config. Builds classification, local...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/losses_builder.py
losses_builder.py
import collections import tensorflow.compat.v1 as tf from object_detection.predictors import convolutional_box_predictor from object_detection.predictors import convolutional_keras_box_predictor from object_detection.predictors import mask_rcnn_box_predictor from object_detection.predictors import mask_rcnn_keras_box_p...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/box_predictor_builder.py
box_predictor_builder.py
"""A function to build an object detection box coder from configuration.""" from object_detection.box_coders import faster_rcnn_box_coder from object_detection.box_coders import keypoint_box_coder from object_detection.box_coders import mean_stddev_box_coder from object_detection.box_coders import square_box_coder fro...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/box_coder_builder.py
box_coder_builder.py
import tensorflow.compat.v1 as tf from object_detection.utils import learning_schedules from object_detection.utils import tf_version # pylint: disable=g-import-not-at-top if tf_version.is_tf2(): from official.modeling.optimization import ema_optimizer # pylint: enable=g-import-not-at-top try: from tensorflow.co...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/optimizer_builder.py
optimizer_builder.py
"""Builder function to construct tf-slim arg_scope for convolution, fc ops.""" import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.core import freezable_batch_norm from object_detection.protos import hyperparams_pb2 from object_detection.utils import context_manager from object_detection.ut...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/hyperparams_builder.py
hyperparams_builder.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import math import tensorflow.compat.v1 as tf from object_detection.builders import decoder_builder from object_detection.protos import input_reader_pb2 def make_initializable_iterator(datas...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/dataset_builder.py
dataset_builder.py
import tensorflow.compat.v1 as tf from object_detection.utils import shape_utils def _find_interval_containing_new_value(x, new_value): """Find the index of x (ascending-ordered) after which new_value occurs.""" new_value_shape = shape_utils.combined_static_and_dynamic_shape(new_value)[0] x_shape = shape_utils....
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/calibration_builder.py
calibration_builder.py
"""Builder function for image resizing operations.""" import functools import tensorflow.compat.v1 as tf from object_detection.core import preprocessor from object_detection.protos import image_resizer_pb2 def _tf_resize_method(resize_method): """Maps image resize method from enumeration type to TensorFlow. Arg...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/image_resizer_builder.py
image_resizer_builder.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf import tf_slim as slim from object_detection.data_decoders import tf_example_decoder from object_detection.data_decoders import tf_sequence_example_decoder from object_detecti...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/input_reader_builder.py
input_reader_builder.py
"""Builder function for post processing operations.""" import functools import tensorflow.compat.v1 as tf from object_detection.builders import calibration_builder from object_detection.core import post_processing from object_detection.protos import post_processing_pb2 def build(post_processing_config): """Builds...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/builders/post_processing_builder.py
post_processing_builder.py
from abc import abstractmethod import tensorflow.compat.v1 as tf BOX_ENCODINGS = 'box_encodings' CLASS_PREDICTIONS_WITH_BACKGROUND = 'class_predictions_with_background' MASK_PREDICTIONS = 'mask_predictions' class BoxPredictor(object): """BoxPredictor.""" def __init__(self, is_training, num_classes): """Cons...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/box_predictor.py
box_predictor.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import inspect import math import sys import six from six.moves import range from six.moves import zip import tensorflow.compat.v1 as tf from tensorflow.python.ops import control_flow_ops fro...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/preprocessor.py
preprocessor.py
"""Provides functions to batch a dictionary of input tensors.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from six.moves import range import tensorflow.compat.v1 as tf from object_detection.core import prefetcher rt_shape_str = ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/batcher.py
batcher.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import six import tensorflow.compat.v1 as tf from object_detection.core import box_list from object_detection.core import box_list_ops from object_detection.utils import ops from object_detection.uti...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/losses.py
losses.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import six import tensorflow.compat.v1 as tf from object_detection.utils import ops class Match(object): """Class to store results from the matcher. This class is used to store the results fr...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/matcher.py
matcher.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import range from six.moves import zip import tensorflow.compat.v1 as tf import tensorflow.compat.v2 as tf2 from object_detection.box_coders import faster_rcnn_box_coder from object_detection.bo...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/target_assigner.py
target_assigner.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from abc import ABCMeta from abc import abstractmethod import six import tensorflow.compat.v1 as tf from object_detection.core import box_list_ops from object_detection.core import standard_fields as fields ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/region_similarity_calculator.py
region_similarity_calculator.py
import numpy as np import tensorflow.compat.v1 as tf def scale(keypoints, y_scale, x_scale, scope=None): """Scales keypoint coordinates in x and y dimensions. Args: keypoints: a tensor of shape [num_instances, num_keypoints, 2] y_scale: (float) scalar tensor x_scale: (float) scalar tensor scope: ...
123-object-detection
/123_object_detection-0.1.tar.gz/123_object_detection-0.1/object_detection/core/keypoint_ops.py
keypoint_ops.py