MCPcopy Create free account

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

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

↓ 3 callersMethod_separate_heads
(self, x)
scenic/projects/baselines/segment_anything/modeling/transformer.py:185
↓ 3 callersFunction_wait
(future: Optional[futures.Future])
scenic/projects/layout_denoise/trainer.py:428
↓ 3 callersMethodadd_example
Add a single example to the evaluator. Args: prediction: Model prediction dictionary with keys 'pred_img_ids', 'pred_probs' in shap
scenic/projects/baselines/detr/train_utils.py:53
↓ 3 callersFunctionadd_gaussian_noise
Add gaussian noise to the given image. Args: image: A single image,must be in 0-1 range. noise_magnitude: Amount of noise to be added to th
scenic/projects/robust_segvit/datasets/denoise_utils.py:123
↓ 3 callersFunctionadd_per_class_results
(metric: Array, name: str)
scenic/projects/vivit/evaluation_lib.py:175
↓ 3 callersMethodapply_2d_rotary_pos_emb
Applies the rotary embedding to the input.
scenic/projects/boundary_attention/models/model_lib/rope_embedding.py:62
↓ 3 callersFunctionapply_label_smoothing
Apply label smoothing to the one-hot targets. Applies label smoothing such that the on-values are transformed from 1.0 to `1.0 - label_smoothing
scenic/model_lib/base_models/model_utils.py:289
↓ 3 callersFunctionapply_process_fn_with_populated_seed
Maps `ds` using the preprocess_fn and a deterministic RNG per example. Args: ds: Dataset containing Python dictionary with the features. The 'r
scenic/dataset_lib/flexio/flexio.py:80
↓ 3 callersFunctionapply_specaugment
Performs SpecAugment on the inputs. SpecAugment is a data augmentation technique from arXiv:1904.08779, that combines three transformations: -
scenic/projects/av_mae/datasets/dataset_utils.py:545
↓ 3 callersFunctionbilinear_interpolate
Performs 2D bilinear interpolation. It is assumed that the center of the top-left pixel in `im` has coordinate (0.5, 0.5). If you want a differen
scenic/projects/baselines/deformable_detr/attention.py:40
↓ 3 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/densevoc/densevoc_evaluator.py:35
↓ 3 callersMethodboxes_losses_and_metrics
Bounding box losses: L1 regression loss and GIoU loss.. Args: outputs: dict; Model predictions. For the purpose of this loss, outputs
scenic/projects/baselines/detr/detr_base_model.py:630
↓ 3 callersFunctionbuild_dataset
Dataset builder that takes care of strategy, batching and shuffling. Args: dataset_fn: function; A function that loads the dataset. batch_s
scenic/projects/tasseo/datasets/chrmID_baseline_dataset.py:228
↓ 3 callersFunctionbuild_dataset
Dataset builder that takes care of strategy, batching and shuffling. Args: dataset_fn: function; A function that loads the dataset. batch_s
scenic/projects/tasseo/datasets/metaphase_sexid_dataset.py:119
↓ 3 callersFunctionbuild_dataset
Dataset builder that takes care of strategy, batching and shuffling. Args: dataset_fn: function; A function that loads the dataset. batch_s
scenic/projects/tasseo/datasets/chrmID_big_metaphase_context_dataset.py:110
↓ 3 callersFunctionbuild_dataset
Dataset builder that takes care of strategy, batching and shuffling. Args: dataset_fn: function; A function that loads the dataset. batch_s
scenic/projects/tasseo/datasets/chrmID_metaphase_context_dataset.py:104
↓ 3 callersFunctionbuild_dataset
Dataset builder that takes care of strategy, batching and shuffling. Args: dataset_fn: function; A function that loads the dataset. batch_s
scenic/projects/tasseo/datasets/chrmID_dataset.py:103
↓ 3 callersFunctionbuild_dataset
Dataset builder that takes care of strategy, batching and shuffling. Args: dataset_fn: function; A function that loads the dataset. batch_s
scenic/projects/svvit/datasets/pileup_coverage_dataset.py:123
↓ 3 callersFunctionbuild_dataset
Dataset builder that takes care of strategy, batching and shuffling. Args: dataset_fn: function; A function that loads the dataset. batch_s
scenic/projects/svvit/datasets/pileup_window_dataset.py:126
↓ 3 callersFunctionchoose_valid_point
Randomly select a non-zero element from a 2D mask. Args: key: random key array: 2D array of non-zero elements Returns: point: [x,y]
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:28
↓ 3 callersMethodclear
(self)
scenic/projects/pixel_llm/evaluators.py:963
↓ 3 callersMethodcompute
(self)
scenic/projects/knowledge_visual_language/models/metrics_vqa.py:57
↓ 3 callersFunctioncompute_cost
Computes cost matrices for a batch of predictions. Relevant code: https://github.com/facebookresearch/detr/blob/647917626d5017e63c1217b99537deb2d
scenic/model_lib/matchers/tests/test_matchers.py:48
↓ 3 callersFunctioncompute_inner_product
Compute inner product between videos and text embeddings.
scenic/projects/verbs_in_action/utils.py:516
↓ 3 callersFunctioncopy_matched_params
Copy matched parameters from a restored one.
scenic/projects/pixel_llm/train_utils.py:82
↓ 3 callersFunctioncreate_dataset_iterator
( subset: str, batch_size_local: int, num_clips: int, keep_key_local: bool = False,
scenic/projects/objectvivit/datasets.py:293
↓ 3 callersFunctioncreate_dataset_iterator
( subset: Text, batch_size_local: int, num_clips: int, keep_key_local: bool = False)
scenic/projects/mbt/datasets/audiovisual_tfrecord_dataset.py:449
↓ 3 callersFunctioncreate_dataset_iterator
( subset: Text, batch_size_local: int, num_clips: int, num_captions: int, captio
scenic/projects/verbs_in_action/tfrecord_dataset.py:525
↓ 3 callersFunctioncreate_dataset_iterator
( subset: Text, batch_size_local: int, num_clips: int, keep_key_local: bool = False)
scenic/projects/vivit/data/video_tfrecord_dataset.py:423
↓ 3 callersFunctioncreate_dataset_iterator
Creates a moment retrieval dataset iterator.
scenic/projects/unloc/datasets/moment_retrieval_dataset.py:157
↓ 3 callersFunctioncreate_dataset_iterator
Creates a temporal localization dataset iterator.
scenic/projects/unloc/datasets/temporal_localization_dataset.py:122
↓ 3 callersFunctioncreate_dataset_iterator
( subset: str, batch_size_local: int, num_clips: int, keep_key_local: bool = False,
scenic/projects/av_mae/datasets/audiovisual_tfrecord_dataset.py:744
↓ 3 callersMethoddecode
Applies Transformer decoder-branch on encoded-input and target. Args: encoded: encoded input data from encoder. targets: target data.
scenic/projects/avatar/models.py:487
↓ 3 callersMethoddists2boundaries
Compute boundary map for each patch, given distance functions. The width of the boundary is determined by self.opts.delta. Args: dists
scenic/projects/boundary_attention/field_of_junctions_jax/field_of_junctions.py:666
↓ 3 callersMethodembed_text_queries
Embeds text queries. Args: queries: Tuple of query strings. Returns: Numpy arrays containing query embeddings.
scenic/projects/owl_vit/notebooks/inference.py:104
↓ 3 callersMethodencode
(self, *args, **kwargs)
scenic/projects/vid2seq/models.py:121
↓ 3 callersMethodencode_text
Encode text. Args: encoder_input_tokens: (batch_size, max_cap_len) for ASR or (batch_size, num_caps_per_image, max_cap_len) for p
scenic/projects/streaming_dvc/modeling/vid2seq_model.py:163
↓ 3 callersFunctionf
(t)
scenic/projects/boundary_attention/helpers/perlin_noise.py:27
↓ 3 callersFunctiongather_beams
Gathers the beam slices indexed by beam_indices into new beam array. Args: nested: pytree of arrays or scalars (the latter ignored). beam_i
scenic/projects/gerald/ger_eval.py:421
↓ 3 callersFunctiongather_beams
Gathers the beam slices indexed by beam_indices into new beam array. Args: nested: pytree of arrays or scalars (the latter ignored). beam_i
scenic/projects/pixel_llm/auto_regressive_decode.py:181
↓ 3 callersFunctiongather_beams
Gathers the beam slices indexed by beam_indices into new beam array. Args: nested: pytree of arrays or scalars (the latter ignored). beam_i
scenic/projects/streaming_dvc/modeling/auto_regressive_decode.py:184
↓ 3 callersFunctiongeneral_kernel_linearization
r"""Computes general features of kernel's linearization. Args: data: input data tensor of the shape [B..., L, H, D], where: B - batch dim
scenic/projects/performer/subquadratic_attention.py:27
↓ 3 callersMethodget_base_encoded
( self, image=None, text_tokens=None, train=False, random_drop_image=False,
scenic/projects/knowledge_visual_language/models/fusion_in_decoder_soft.py:100
↓ 3 callersFunctionget_coco_config
Returns the configuration for COCO detection using DeformableDETR.
scenic/projects/baselines/deformable_detr/configs/common.py:28
↓ 3 callersFunctionget_coco_ref_eval_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ eval source.
scenic/projects/pixel_llm/configs/bert/pixel_llm_bert_ref.py:128
↓ 3 callersFunctionget_coco_ref_eval_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ eval source.
scenic/projects/pixel_llm/configs/t5/pixel_llm_t5_ref.py:128
↓ 3 callersFunctionget_coco_ref_train_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ train source.
scenic/projects/pixel_llm/configs/bert/pixel_llm_bert_ref.py:25
↓ 3 callersFunctionget_coco_ref_train_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ train source.
scenic/projects/pixel_llm/configs/bert/pixel_llm_bert_trace_ref_densecap_llava.py:219
↓ 3 callersFunctionget_coco_ref_train_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ train source.
scenic/projects/pixel_llm/configs/t5/pixel_llm_t5_trace_ref_densecap_llava.py:219
↓ 3 callersFunctionget_coco_ref_train_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ train source.
scenic/projects/pixel_llm/configs/t5/pixel_llm_t5_ref.py:25
↓ 3 callersFunctionget_droplayer_p
Stochastic drop-layer probability. Args: layer: Layer index. num_layers: Total number of layers. stochastic_droplayer_rate: Proba
scenic/projects/polyvit/layers.py:92
↓ 3 callersFunctionget_fake_batch_output
Generates a fake `batch`. Args: array_size: size of the label and output array. Returns: `batch`: Dictionary of None inputs and fake gro
scenic/model_lib/base_models/tests/test_multilabel_classification_model.py:46
↓ 3 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_segmentation_model.py:47
↓ 3 callersMethodget_global_supervision_loss
Calculates the loss for global supervision.
scenic/projects/boundary_attention/loss_lib/boundary_attention_loss.py:51
↓ 3 callersFunctionget_hw
Return the height, width of image as float32 tf.Tensors.
scenic/projects/baselines/centernet/transforms.py:173
↓ 3 callersFunctionget_iterator
Given a (dict of) Dataset object(s), returns iterators and metadata. Args: ds: A tf.data.Dataset instance or a dictionary of TFDS instances.
scenic/projects/pixel_llm/io/flexio.py:623
↓ 3 callersFunctionget_iterator
Given a (dict of) Dataset object(s), returns iterators and metadata. Different from the original flexio, this function uses a custom get_number_o
scenic/projects/streaming_dvc/io/flexio.py:317
↓ 3 callersFunctionget_iterator
Given a (dict of) Dataset object(s), returns iterators and metadata. Args: ds: A tf.data.Dataset instance or a dictionary of TFDS instances.
scenic/dataset_lib/flexio/flexio.py:487
↓ 3 callersMethodget_loss
Compute the objective of the model (see Equation 8 of the paper). 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:589
↓ 3 callersMethodget_loss
Calculates the loss function.
scenic/projects/boundary_attention/loss_lib/boundary_attention_loss.py:96
↓ 3 callersMethodget_metrics_fn
Returns a callable metric function for the model. Args: split: The split for which we calculate the metrics. It should be one of th
scenic/projects/vivit/model.py:725
↓ 3 callersMethodget_prompt_boxes_and_points
(self, outputs, batch, train=False)
scenic/projects/pixel_llm/modeling/pixel_llm.py:960
↓ 3 callersMethodget_visual_features
Forward image backbone and aggregate video features. Args: images: (total_batch_size, height, width, 3). Note for videos, the total
scenic/projects/streaming_dvc/modeling/model.py:232
↓ 3 callersFunctionglobal_l2_norm
(x: jnp.ndarray)
scenic/projects/streaming_dvc/partition_utils.py:166
↓ 3 callersMethodglobal_registry
()
scenic/dataset_lib/big_transfer/registry.py:160
↓ 3 callersFunctioninit_posemb
Initialize the positional embeddings.
scenic/projects/av_mae/mbt.py:1399
↓ 3 callersFunctioninspect_params
Inspects whether the params are consistent with the expected keys. Based on https://github.com/google-research/big_vision/blob/main/big_vision/mo
scenic/train_lib/pretrain_utils.py:208
↓ 3 callersMethodis_valid
Helper function to assert that tensor `t` does not have `nan`, `inf`.
scenic/model_lib/base_models/tests/test_multilabel_classification_model.py:68
↓ 3 callersMethodis_valid
Helper function to assert that tensor `t` does not have `nan`, `inf`.
scenic/model_lib/base_models/tests/test_classification_model.py:64
↓ 3 callersMethodis_valid
Helper function to assert that tensor `t` does not have `nan`, `inf`.
scenic/model_lib/base_models/tests/test_encoder_decoder_model.py:68
↓ 3 callersMethodis_valid
Helper function to assert that tensor `t` does not have `nan`, `inf`.
scenic/model_lib/base_models/tests/test_model_utils.py:281
↓ 3 callersMethodis_valid_loss
Helper function to assert that `loss` is of shape [] and `is_valid`.
scenic/projects/baselines/detr/tests/test_model.py:184
↓ 3 callersMethodis_valid_loss
Helper function to assert that `loss` is of shape [] and `is_valid`.
scenic/projects/baselines/detr/tests/test_detr_base_model.py:131
↓ 3 callersFunctionload_split
Loads OVEN or entity-based pretraining dataset using TensorFlow Datasets. Args: batch_size: int; The batch size returned by the data pipeline.
scenic/projects/gerald/input_pipeline.py:114
↓ 3 callersMethodloss_function
Returns the loss. Args: logits: Output of model in shape [batch, length, num_classes]. batch: Batch of data that has 'label' and opti
scenic/model_lib/base_models/base_model.py:162
↓ 3 callersFunctionmake_2d_boxes
Make 2D boxes out of 1D segments. We reuse tf.image.non_max_suppression_with_scores() for non-maximal suppression, which takes 2D boxes. Args:
scenic/projects/unloc/postprocessing_utils.py:80
↓ 3 callersFunctionmask_for_shape
Create boolean mask by resizing from given mask or set all True.
scenic/projects/baselines/deformable_detr/backbone.py:87
↓ 3 callersFunctionmin_without_none
Returns the minimum of two integers, ignoring None values.
scenic/train_lib/transfer/fewshot_utils.py:359
↓ 3 callersFunctionnum_parameters_from_tree
(tree)
scenic/projects/pixel_llm/partition_utils.py:323
↓ 3 callersFunctionnum_parameters_from_tree
(tree)
scenic/projects/streaming_dvc/partition_utils.py:248
↓ 3 callersFunctionpad_string_tensor
(tensor, target_shape)
scenic/projects/densevoc/input_utils.py:522
↓ 3 callersFunctionplot_box
Plots a single bounding box into axes.
scenic/projects/owl_vit/evaluator.py:566
↓ 3 callersFunctionpool_txt_embs
Aggregate text embedding for a UI element.
scenic/projects/layout_denoise/layers/embedding.py:351
↓ 3 callersMethodpreprocess
Proprocess images. Normalize pixels for non-padded pixels.
scenic/projects/streaming_dvc/modeling/model.py:365
↓ 3 callersFunctionrepresentation_fn
Feeds the inputs to the model and returns their representations. Args: train_state: TrainState, the state of training including the current
scenic/train_lib/transfer/transfer_trainer.py:208
↓ 3 callersFunctionshapenet_load_split
Creates a split from the ShapeNet dataset using TensorFlow Datasets. For the training set, we drop the last partial batch. This is fine to do bec
scenic/projects/pointcloud/shapenet_dataset.py:70
↓ 3 callersFunctionsimple_gather
Gathers `x` using the indices in `idx`. `output[i] = x[i, idx[i]]` . This simple gather operation assumes that the first dimension is the batch d
scenic/model_lib/base_models/model_utils.py:879
↓ 3 callersFunctionstack_forest
Transposes a list of dicts to dict of lists. For example, given [{'a':1,'b':2}, {'a':3,'b':4}], the output is: {'a': ([1, 3]), 'b': ([2, 4]
scenic/train_lib/train_utils.py:777
↓ 3 callersFunctionstr_to_bytes
(string)
scenic/projects/pixel_llm/tools/build_llava_tfrecord.py:72
↓ 3 callersFunctionstr_to_bytes
(string)
scenic/projects/pixel_llm/tools/build_mdetr_ref_tfrecord.py:69
↓ 3 callersFunctiontokenize
(text: str, max_token_len: int = 77)
scenic/projects/owl_vit/clip/tokenizer.py:31
↓ 3 callersFunctionuniform_initializer
(minval, maxval, dtype=jnp.float32)
scenic/projects/baselines/detr/model.py:42
↓ 3 callersFunctionvalidate_config
(field)
scenic/projects/verbs_in_action/tfrecord_dataset.py:510
↓ 3 callersFunctionvalidate_config
(field)
scenic/projects/vid2seq/datasets/dense_video_captioning_tfrecord_dataset.py:434
↓ 3 callersMethodwrite
Write to the given writer and training step. After writing, the state gets reset. Args: writer: The summary will be written with this
scenic/projects/knowledge_visual_language/trainer_utils.py:199
↓ 3 callersMethodwrite_pred_annotations_to_file
Writes predictions to file in JSON format. Args: path: Path to write the prediction annotation JSON file. is_groundtruth: bool; if th
scenic/projects/streaming_dvc/caption_evaluator.py:134
↓ 2 callersMethod__init__
Initializes detection model. Args: config: Hyper-parameter dictionary. dataset_meta_data: Dataset meta data specifies `target_is_oneh
scenic/projects/owl_vit/matching_base_models.py:357
↓ 2 callersMethod_add_coord_channels
(self, features)
scenic/projects/owl_vit/layers.py:478
↓ 2 callersFunction_add_labels
(state: Dict[str, Any], feature_dict: builders.FeaturesDict)
scenic/projects/unloc/datasets/dataset_utils.py:448
↓ 2 callersMethod_add_positional_embedding
Adds positional embedding.
scenic/projects/unloc/video_text_fusion.py:107
← previousnext →201–300 of 4,921, ranked by callers