MCPcopy Create free account

hub / github.com/google-research/scenic / functions

Functions4,921 in github.com/google-research/scenic

↓ 2 callersFunctionadd_cls_token
Add the cls token.
scenic/projects/av_mae/vivit_multimodal.py:671
↓ 2 callersMethodadd_example
Add prediction of a single image to the evaluator. Args: prediction: Model prediction tuple of 4 arrays: boxes, scores, classes, ca
scenic/projects/densevoc/densevoc_evaluator.py:361
↓ 2 callersFunctionadd_int64
Adds functions to process integer feature to builders. This function expects the input to be either a `tf.train.SequenceExample` (with the featur
scenic/projects/avatar/datasets/dataset_utils.py:999
↓ 2 callersMethodadd_modality_token
Add modality learned tokens.
scenic/projects/av_mae/vivit_multimodal.py:196
↓ 2 callersFunctionadd_positional_embeddings
Add positional encodings.
scenic/projects/av_mae/vivit_multimodal.py:686
↓ 2 callersMethodassertDictEqualRecursive
(self, actual, expected)
scenic/projects/unloc/eval_utils_test.py:47
↓ 2 callersFunctionbox_iou
Compute box IoU. Boxes in format [l, t, w, h]. Args: boxes1: array in shape n x 4 boxes2: array in shape m x 4 Returns: iou: array in
scenic/projects/pixel_llm/densecap_evaluator.py:30
↓ 2 callersFunctionbrevity_penalty
Brevity penalty function for beam search penalizing short sequences. Args: alpha: float: brevity-penalty scaling parameter. length: int: le
scenic/projects/avatar/decode.py:34
↓ 2 callersFunctionbrevity_penalty
(alpha, length)
scenic/projects/pixel_llm/auto_regressive_decode.py:117
↓ 2 callersFunctionbrevity_penalty
(alpha, length)
scenic/projects/streaming_dvc/modeling/auto_regressive_decode.py:120
↓ 2 callersFunctionbuild_detection_ds
Build a detection dataset.
scenic/projects/densevoc/input_utils.py:659
↓ 2 callersMethodbuild_flax_model
(self)
scenic/projects/boundary_attention/models/boundary_attention.py:69
↓ 2 callersFunctionbuild_optimizer
Builds optimizer.
scenic/projects/verbs_in_action/utils.py:252
↓ 2 callersMethodclear
(self)
scenic/projects/baselines/detr/train_utils.py:111
↓ 2 callersMethodclear
(self)
scenic/projects/densevoc/densevoc_evaluator.py:414
↓ 2 callersFunctioncoco_load_split_from_tfds
Loads a split from the COCO dataset using TensorFlow Datasets. Args: batch_size: int; The batch size returned by the data pipeline. train:
scenic/projects/baselines/centernet/input_pipeline.py:210
↓ 2 callersFunctioncoco_load_split_from_tfds
Loads a split from the COCO dataset using TensorFlow Datasets. Args: batch_size: int; The batch size returned by the data pipeline. train:
scenic/projects/baselines/detr/input_pipeline_detection.py:148
↓ 2 callersFunctioncoco_load_split_from_tfds
Loads a split from the COCO dataset using TensorFlow Datasets. Args: batch_size: The batch size returned by the data pipeline. train: Wheth
scenic/projects/baselines/deformable_detr/input_pipeline_detection.py:148
↓ 2 callersMethodcombine_branches
Merges residual connections.
scenic/projects/baselines/mixer.py:49
↓ 2 callersFunctioncompute_cost
Computes cost matrices for DeformableDETR predictions. Relevant code: https://github.com/fundamentalvision/Deformable-DETR/blob/11169a60c33333af0
scenic/projects/baselines/deformable_detr/model.py:41
↓ 2 callersMethodcompute_cost_matrix
Implements the matching cost matrix computations. Args: predictions: Dictionary of outputs from a model. Must contain 'pred_boxes'
scenic/projects/baselines/detr/detr_base_model.py:162
↓ 2 callersFunctioncompute_distance_from_shapes
Compute distance map using dictionary of shapes. Args: shapes: list of shape dictionaries, in order of back-object to front-object h: heigh
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:325
↓ 2 callersFunctioncompute_feature_targets
Compute the feature targets for feature regression. Args: batch: A single batch of data. This is updated with the feature target. config: T
scenic/projects/av_mae/trainer_multimodal.py:124
↓ 2 callersFunctioncompute_feature_targets
Compute the feature targets for feature regression. Args: batch: A single batch of data. This is updated with the feature target. config: T
scenic/projects/av_mae/trainer.py:58
↓ 2 callersMethodcompute_loss_for_layer
Loss and metrics function for single prediction layer.
scenic/projects/baselines/deformable_detr/model.py:497
↓ 2 callersFunctioncompute_max_norm
Compute the maximum norm in a pytree of tensors.
scenic/projects/av_mae/trainer_multimodal.py:116
↓ 2 callersFunctioncompute_max_norm
Compute the maximum norm in a pytree of tensors.
scenic/projects/av_mae/trainer.py:50
↓ 2 callersMethodcompute_metrics
Computes the metrics for all added predictions.
scenic/projects/baselines/detr/train_utils.py:101
↓ 2 callersMethodcompute_metrics
Compute HOTA on coco format. Args: gt_data: coco json format with key "annotations" and "images". pred_data: coco prediction format,
scenic/projects/densevoc/chota.py:404
↓ 2 callersMethodcompute_metrics
Evaluate metrics. Args: predictions: list of dict. Each dict is a prediction of an *instance*, with keys 'image_id', 'bbox', 'capti
scenic/projects/densevoc/densevoc_evaluator.py:126
↓ 2 callersMethodcompute_metrics
Computes the metrics for all added predictions.
scenic/projects/densevoc/densevoc_evaluator.py:405
↓ 2 callersFunctioncompute_precision
Computes precision.
scenic/projects/gerald/ger_eval.py:125
↓ 2 callersMethodconstruct_result_dict
Packs the COCOEval results into a dictionary. Args: coco_metrics: an array of length 12, as returned by `COCOeval.summarize()` Returns:
scenic/dataset_lib/coco_dataset/coco_eval.py:186
↓ 2 callersFunctioncreate_dataset_iterator
( subset: Text, batch_size_local: int, num_clips: int, caption_string: str, stri
scenic/projects/vid2seq/datasets/dense_video_captioning_tfrecord_dataset.py:449
↓ 2 callersFunctioncreate_pyramid_split_indices
Generates split indices for each pyramid level.
scenic/projects/unloc/model_utils.py:70
↓ 2 callersFunctioncreate_snippet
Function creating FLT snippet encoding RPE. Computes the fourier transform (FT) in a give set of points. The FT is parameterized as a weighted su
scenic/projects/performer/performer.py:966
↓ 2 callersFunctioncustom_crop_image
Add more metadata to processors.crop_image.
scenic/projects/objectvivit/dataset_utils.py:526
↓ 2 callersFunctioncustom_unfold
Extract patches from an image. Args: im: Array of shape [N, H, W, C] patchsize: Tuple of integers representing the filter shape. stride
scenic/projects/boundary_attention/models/model_lib/model_utils.py:23
↓ 2 callersFunctiondecode_boxes
Convert yxyx [0, 1] normalized boxes to xyxy unnormalized format.
scenic/projects/pixel_llm/io/ops.py:207
↓ 2 callersFunctiondecode_ints_to_string
Decode a sequence of ASCII values into a string.
scenic/projects/avatar/generation_trainer.py:643
↓ 2 callersFunctiondecode_to_mask
Converts segmentation to mask.
scenic/projects/pixel_llm/evaluators.py:352
↓ 2 callersMethoddists2indicators
Computes the indicator functions from the distance functions. Args: dists: Array of shape [N, 2, R, R, H', W'] with samples of the two
scenic/projects/boundary_attention/field_of_junctions_jax/field_of_junctions.py:565
↓ 2 callersMethoddraw_weights
(self, key)
scenic/projects/fast_vit/model_utils.py:1243
↓ 2 callersFunctionembed_2d_patch
Embedding input patches with 2D conv.
scenic/projects/mbt/model.py:62
↓ 2 callersMethodembed_image_query
Extracts image features in the region of `desired_boxes_yxyx`. This works by taking the features of a bounding box with high IOU to the desi
scenic/projects/owl_vit/notebooks/inference.py:123
↓ 2 callersMethodencode_knowledge
( self, retr_texts, retr_images=None, bsz=None, train=False, random_drop_i
scenic/projects/knowledge_visual_language/models/fusion_in_decoder_soft.py:209
↓ 2 callersMethodencode_visual
Encode visual features. Args: features: (batch_size, num_tokens, dim) checkpoint_inds: (batch_size, num_caps_per_image) or None
scenic/projects/streaming_dvc/modeling/vid2seq_model.py:105
↓ 2 callersFunctionenqueue
(n_steps)
scenic/dataset_lib/dataset_utils.py:266
↓ 2 callersFunctioneval_and_log_summary
Eval the model and write the summary.
scenic/projects/vid2seq/trainer.py:625
↓ 2 callersFunctionevaluate
( train_state: train_utils.TrainState, step: int, valid_iter: Iterator[Batch], num_ex:
scenic/projects/svvit/transfer_trainer.py:399
↓ 2 callersFunctionextract_image_patches
Extract patches of size `rhs_shape` from `lhs`. Args: lhs: A 4-D Tensor; With shape `[batch, in_rows, in_cols, depth]. rhs_shape: tuple; S
scenic/model_lib/layers/nn_ops.py:27
↓ 2 callersFunctionflatten_beam_dim
Flattens the first two dimensions of a non-scalar array.
scenic/projects/avatar/decode.py:60
↓ 2 callersFunctionflatten_params
Flattens a dictionary, keeping empty leaves.
scenic/projects/avatar/model_utils.py:29
↓ 2 callersMethodflatten_time_to_batch
( self, inputs, gt_boxes, gt_classes, gt_text_tokens, gt_track_ids, image_caption_tokens)
scenic/projects/densevoc/modeling/densevoc_model.py:76
↓ 2 callersFunctionfmt
(i, p)
scenic/projects/adversarialtraining/train_utils.py:48
↓ 2 callersMethodfold
Fold patches into a single image. Args: patches: Array of shape [N, C, R, R, H', W'] val: Container of shape [N, C, H, W] Return
scenic/projects/boundary_attention/field_of_junctions_jax/field_of_junctions.py:414
↓ 2 callersFunctionformat_string
(s)
scenic/projects/avatar/metrics_utils.py:32
↓ 2 callersMethodforward_caption
( self, visual_features_dict, outputs, batch, *, train=False )
scenic/projects/pixel_llm/modeling/pixel_llm.py:614
↓ 2 callersMethodforward_detection
Forward second stage detection and get object features.
scenic/projects/densevoc/modeling/grit.py:234
↓ 2 callersMethodforward_mask_decode
( self, visual_features_dict, outputs, batch, train=False)
scenic/projects/pixel_llm/modeling/pixel_llm.py:805
↓ 2 callersMethodforward_object_caption
( self, detections, metrics, outputs, features, gt_classes, gt_boxes, gt_text_tokens, train=False)
scenic/projects/densevoc/modeling/grit.py:167
↓ 2 callersMethodforward_point_prediction
Forward point prediction.
scenic/projects/pixel_llm/modeling/pixel_llm.py:737
↓ 2 callersMethodforward_with_coords
Forward with points. Args: coords_input: (num_prompts, num_points, 2) image_size: (2,) Returns: embedding: (num_prompts, nu
scenic/projects/baselines/segment_anything/modeling/prompt_encoder.py:213
↓ 2 callersFunctionfull_attn
Applies kernel attention with query, key, value tensors. This function defines the computation inside `call` with projected multi-head Q, K, V in
scenic/projects/performer/performer.py:888
↓ 2 callersMethodfuse_topk_knowledge
( self, base_query, base_vals, base_masks, retr_keys, retr_vals, ret
scenic/projects/knowledge_visual_language/models/fusion_in_decoder_soft.py:315
↓ 2 callersFunctionfwd
(qs, ks, vs)
scenic/projects/fast_vit/model_utils.py:1133
↓ 2 callersFunctiongeneric_kernel_transformation
r"""Computes features based on an activation (e.g. ReLU-kernel by default). By default, computes random features for the ReLU kernel from http
scenic/projects/performer/performer.py:203
↓ 2 callersMethodget_best_inds
Compute the best index for each patch. Has two possible modes determined by self.opts.parallel_mode: 1) When True, all N values are computed
scenic/projects/boundary_attention/field_of_junctions_jax/field_of_junctions.py:319
↓ 2 callersFunctionget_bottleneck_representation
Bottleneck representation. Args: x: input tensor. pooling_type: type of the classifier layer. Options are 'gap', 'gmp', 'gsp', 't
scenic/projects/polyvit/layers.py:66
↓ 2 callersFunctionget_builder
(dataset, data_dir)
scenic/dataset_lib/dataset_utils.py:571
↓ 2 callersFunctionget_class_colors
Returns a [num_classes, 3] array of colors for the model output labels.
scenic/projects/robust_segvit/datasets/segmentation_datasets.py:155
↓ 2 callersFunctionget_class_names
Returns a list with the class names of the model output labels.
scenic/projects/robust_segvit/datasets/segmentation_datasets.py:161
↓ 2 callersFunctionget_class_proportions
Returns a [num_classes] array of pixel frequency proportions.
scenic/projects/robust_segvit/datasets/segmentation_datasets.py:166
↓ 2 callersFunctionget_dataset_at_step
(step)
scenic/projects/polyvit/trainer.py:418
↓ 2 callersFunctionget_dataset_fn
Gets a closure to create a dataset.
scenic/projects/baselines/bert/datasets/bert_glue_dataset.py:107
↓ 2 callersFunctionget_dataset_name
Extract dataset name for eval_iter in xmanager measurements. Parent directory of the dataset files is used as its name. Args: dataset_path: P
scenic/projects/svvit/datasets/pileup_window_dataset.py:113
↓ 2 callersMethodget_dense_streaming_features_perframe
Get streaming features with intermadiate outputs for all frames. Args: features: (video_batch_size, num_tot_tokens, dim) train: bool
scenic/projects/streaming_dvc/modeling/streaming_model.py:427
↓ 2 callersMethodget_dict_from_config
(self)
scenic/projects/streaming_dvc/modeling/streaming_model.py:164
↓ 2 callersMethodget_drop_pattern
(self, x, deterministic)
scenic/projects/objectvivit/object_attention.py:45
↓ 2 callersMethodget_drop_pattern
(self, x, deterministic)
scenic/projects/objectvivit/model_utils.py:147
↓ 2 callersMethodget_drop_pattern
(self, x, deterministic)
scenic/projects/mbt/model.py:201
↓ 2 callersMethodget_drop_pattern
(self, x, deterministic)
scenic/projects/fast_vit/model_utils.py:410
↓ 2 callersMethodget_drop_pattern
(self, x, deterministic)
scenic/projects/fast_vit/model_utils.py:534
↓ 2 callersMethodget_drop_pattern
(self, x, deterministic)
scenic/projects/vivit/model.py:222
↓ 2 callersMethodget_drop_pattern
Get drop pattern for drop layer.
scenic/projects/owl_vit/clip/layers.py:257
↓ 2 callersMethodget_droplayer_mask
Generate the drop-layer mask. Args: x: Input tensor. deterministic: Weather we are in the deterministic mode (e.g inference t
scenic/projects/polyvit/layers.py:348
↓ 2 callersFunctionget_encoder_reference_points
Return grid of 2D reference points within valid range by feature level. Args: spatial_shapes: [h, w] for each feature map level. valid_rati
scenic/projects/baselines/deformable_detr/deformable_transformer.py:492
↓ 2 callersFunctionget_fake_batch_and_predictions
Generates a fake `batch`.
scenic/model_lib/base_models/tests/test_regression_model.py:39
↓ 2 callersFunctionget_fake_batch_output
Generates a fake `batch`. Returns: `batch`: Dictionary of None inputs and fake ground truth targets. outputs_noaux.pop('aux_outputs')
scenic/model_lib/base_models/tests/test_classification_model.py:45
↓ 2 callersFunctionget_fake_batch_output
Generates a fake `batch`. Returns: `batch`: Dictionary of None inputs and fake ground truth targets. outputs_noaux.pop('aux_outputs')
scenic/model_lib/base_models/tests/test_encoder_decoder_model.py:46
↓ 2 callersMethodget_global_metrics_fn
Returns a callable metric function for global metrics. The return function implements metrics that require the prediction for the entire
scenic/model_lib/base_models/segmentation_model.py:223
↓ 2 callersMethodget_gt_points_from_boxes
(self, outputs, batch)
scenic/projects/pixel_llm/modeling/pixel_llm.py:983
↓ 2 callersMethodget_image_embeddings
(self, image, padding_mask=None, train=False)
scenic/projects/baselines/segment_anything/modeling/sam.py:190
↓ 2 callersFunctionget_joint_logits_labels
Returns joint pairs of logits and labels. Args: logits: Tensor of shape [n, c] one_hot_targets: Tensor of shape [n, c] class_splits: Li
scenic/projects/vivit/model_utils.py:615
↓ 2 callersMethodget_keep_pattern
DropPath Layer.
scenic/projects/baselines/centernet/modeling/vitdet.py:271
↓ 2 callersMethodget_keep_pattern
DropPath Layer.
scenic/projects/baselines/segment_anything/modeling/image_encoder.py:387
↓ 2 callersMethodget_keep_pattern
DropPath Layer.
scenic/projects/gerald/models/git_vit.py:158
↓ 2 callersMethodget_keep_pattern
DropPath Layer.
scenic/projects/pixel_llm/modeling/eva02_vit.py:132
↓ 2 callersMethodget_keep_pattern
DropPath Layer.
scenic/projects/streaming_dvc/modeling/vit.py:155
↓ 2 callersFunctionget_label_map
Returns a {label: name} dict for a TFDS dataset.
scenic/projects/owl_vit/preprocessing/label_ops.py:283
← previousnext →401–500 of 4,921, ranked by callers