MCPcopy Create free account

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

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

↓ 2 callersMethodrun_one_eval
Runs evaluations against a single train_state/step. Args: train_state: The train state being evaluated. step: The global step corresp
scenic/projects/boundary_attention/eval_manager.py:184
↓ 2 callersFunctions3dis_load_split
Creates a split from the S3dis dataset using TensorFlow Datasets. For the training set, we drop the last partial batch. This is fine to do becaus
scenic/projects/pointcloud/s3dis_dataset.py:48
↓ 2 callersFunctionsample_cxcywh_bbox
Samples a bounding box in the [cx, cy, w, h] in [0, 1] range format.
scenic/model_lib/base_models/tests/test_box_utils.py:26
↓ 2 callersFunctionsample_cxcywh_bbox
Samples a bounding box in the [cx, cy, w, h] in [0, 1] range format.
scenic/model_lib/matchers/tests/test_matchers.py:149
↓ 2 callersFunctionsample_cxcywh_bbox
Samples a bounding box in the [cx, cy, w, h] in [0, 1] range format.
scenic/projects/baselines/detr/tests/test_train_utils.py:30
↓ 2 callersFunctionsample_cxcywh_bbox
Samples a bounding box in the [cx, cy, w, h] in [0, 1] range format.
scenic/projects/baselines/deformable_detr/tests/test_model.py:31
↓ 2 callersFunctionsample_cxcywha
Sample rotated bounding boxes [cx, cy, w, h, a (radians)].
scenic/model_lib/base_models/tests/test_box_utils.py:79
↓ 2 callersFunctionsample_random_color
Generate a random RGB vector (in [0,255]). Args: key: random key Returns: tuple: RGB color
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:167
↓ 2 callersFunctionsample_sequence_uniformly
Uniform frame sampling. Sample frames based on uniform sampling following TSN (Wang et al., 2019) used by Tong et al. in VideoMAE. The stride is
scenic/projects/objectvivit/dataset_utils.py:855
↓ 2 callersFunctionsample_sequence_uniformly_with_state
mfp sample_sequence_uniformly with state.
scenic/projects/objectvivit/dataset_utils.py:677
↓ 2 callersFunctionsample_two_sequences_uniformly
Uniform sampling two non-overlapping sequences. Sample frames based on uniform sampling following TSN (Wang et al., 2019) used by Tong et al. in
scenic/projects/objectvivit/dataset_utils.py:900
↓ 2 callersMethodsetEval
(self, score, method)
scenic/projects/streaming_dvc/cococap_eval.py:117
↓ 2 callersMethodsetImgToEvalImgs
( # pylint: disable=invalid-name self, scores, img_ids, method)
scenic/projects/streaming_dvc/cococap_eval.py:120
↓ 2 callersFunctionshuffle_and_partition
Implements random shuffling and partitioning necessary for MAE. Args: n_batch: The batch size of the sequence to generate. n_tokens: The nu
scenic/projects/av_mae/model_utils.py:29
↓ 2 callersFunctionsinespe
Sinusoidal stochastic positional encoding. Args: rng_key: A PRNGKey. key_shape: The shape of keys and queries. num_realizations: The nu
scenic/projects/performer/performer.py:417
↓ 2 callersFunctionsparse_weighted_unnormalized_softmax_cross_entropy
Computes sparse weighted softmax cross entropy give logits and targets. Args: logits: Logits of shape [batch_size, length, vocab_size]. lab
scenic/projects/baselines/bert/bert_base_model.py:41
↓ 2 callersFunctionspegate
Stochastic Positional Encoding gating mechanism. Args: rng_key: A PRNGKey. spe_code: the code of the stochastic positional encoding mechani
scenic/projects/performer/performer.py:495
↓ 2 callersMethodstop_fn
(self, inputs: Any)
scenic/projects/adatape/layers.py:189
↓ 2 callersFunctionstr_to_bytes
(string)
scenic/projects/densevoc/tools/build_vln_tfrecord.py:69
↓ 2 callersFunctiontemporal_encode
Encode video for feeding into ViT.
scenic/projects/mbt/model.py:112
↓ 2 callersFunctiontemporal_encode
Encode video for feeding into ViT.
scenic/projects/vivit/model.py:148
↓ 2 callersFunctiontf_apply_to_image_or_images
Applies a function to a single image or each image in a batch of them. Args: fn: the function to apply, receives an image, returns an image.
scenic/dataset_lib/big_transfer/preprocessing/utils.py:30
↓ 2 callersFunctiontimestampify
Tokenizes timestamps. Args: start: Start times of the events. end: End times of the events. duration: Duration of the video. abs_ti
scenic/projects/vid2seq/data_utils.py:35
↓ 2 callersFunctionto_cpu
(x)
scenic/projects/pointcloud/segmentation_trainer.py:372
↓ 2 callersFunctiontoken_indexes_not_to_drop
Returns only the token indexes to keep in a sequence of tokens.
scenic/projects/loca/vit.py:85
↓ 2 callersMethodtrain_and_evaluation
Given the train_state, trains the model on fake batches.
scenic/train_lib/tests/test_classification_trainer.py:93
↓ 2 callersMethodtrain_and_evaluation
Given the train_state, trains the model on fake batches.
scenic/projects/vivit/tests/test_vivit_trainer.py:88
↓ 2 callersMethodtrain_forward_step
(self, model_rng, variables, batch, debug=False)
scenic/projects/pixel_llm/modeling/pixel_llm.py:1197
↓ 2 callersFunctiontransform_box
Transform boxes given the state of image crop.
scenic/projects/objectvivit/dataset_utils.py:584
↓ 2 callersFunctiontree_flatten_with_names
Populates tree_flatten with leaf names. This function populates output of tree_flatten with leaf names, using a custom traversal that produces na
scenic/train_lib/optimizers.py:268
↓ 2 callersFunctiontriangle_circle_intersections
Find the points where the circle intersects with the triangle.
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:602
↓ 2 callersFunctiontypecheck
(obj)
scenic/projects/adversarialtraining/attacks/attack_compute.py:28
↓ 2 callersFunctionunflatten_beam_dim
Unflattens the first, flat batch*beam dimension of a non-scalar array.
scenic/projects/avatar/decode.py:67
↓ 2 callersFunctionunnormalize_imgnet
(input_tensors)
scenic/projects/adversarialtraining/classification_adversarialtraining_trainer.py:51
↓ 2 callersMethodupdate_memory
Function to update stale embedding as memory. Args: pmap_train_state: pmaped train state. bsz: Global batch size. retr_k: numbe
scenic/projects/knowledge_visual_language/models/local_memory.py:113
↓ 2 callersFunctionvalidate_config
(field)
scenic/projects/avatar/datasets/av_asr_tfrecord_dataset.py:880
↓ 2 callersFunctionvideo_resize_max_size
Resize video to a fixed max-size.
scenic/projects/densevoc/input_utils.py:171
↓ 2 callersFunctionweighted_unnormalized_softmax_cross_entropy
Computes weighted softmax cross entropy give logits and targets. This computes sum_(x,y) softmax-ce(x, y) for a single, potentially padded miniba
scenic/model_lib/base_models/model_utils.py:321
↓ 2 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/avatar/generation_trainer.py:585
↓ 2 callersMethodwrite_pred_annotations_to_file
Writes predictions to file in JSON format. Args: path: Path to write the prediction annotation JSON file. fname_app: Optional string
scenic/projects/densevoc/densevoc_evaluator.py:421
↓ 2 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/pixel_llm/evaluators.py:243
↓ 2 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/pixel_llm/evaluators.py:505
↓ 1 callersMethod__call__
(self, features: Features)
scenic/projects/owl_vit/preprocessing/label_ops.py:471
↓ 1 callersMethod__enter__
(self)
scenic/common_lib/debug_utils.py:315
↓ 1 callersMethod__exit__
(self, exc_type, exc_value, tb)
scenic/common_lib/debug_utils.py:323
↓ 1 callersMethod__init__
Initialize Detection model. Args: config: Configurations of the model. dataset_meta_data: Dataset meta data specifies `target_is_oneh
scenic/projects/baselines/detr/detr_base_model.py:140
↓ 1 callersMethod__init__
Initializes the instance of MomentRetrievalDatasetFactory. Initializes a data-loader using DeepMind Video Reader (DMVR) pre-processing (https
scenic/projects/unloc/datasets/dataset_factory.py:408
↓ 1 callersMethod__init__
(self)
scenic/common_lib/debug_utils.py:276
↓ 1 callersFunction_absolute_dims
(rank: int, dims: Iterable[int])
scenic/model_lib/layers/masked_layers.py:35
↓ 1 callersMethod_add_cls_token
Prepends CLS token. Args: x: A 3D float tensor of shape (batch, sequence_len, channels) representing the tokens. Returns:
scenic/projects/unloc/encoders.py:402
↓ 1 callersMethod_add_cls_token
Prepends CLS token. Args: x: A 3D float tensor of shape (batch, sequence_len, channels) representing the tokens. name: Parame
scenic/projects/mtv/model.py:407
↓ 1 callersMethod_add_cls_tokens_all_frames
Prepends CLS token for all frames. Args: x: A 4D float tensor of shape (batch, time, sequence_len, channels) representing the token
scenic/projects/mtv/model.py:426
↓ 1 callersMethod_add_cls_tokens_for_all_views
Prepends CLS tokens for all views. Args: tokens: Tokens from all views. Each one has a shape of (batch, time, sequence_len, channel
scenic/projects/mtv/model.py:446
↓ 1 callersMethod_add_context_tokens
Append random/uniformly sampled token from full_x to x. Args: full_x: batch x num_tokens x hidden_dim num_context_tokens: number of c
scenic/projects/objectvivit/model_utils.py:332
↓ 1 callersFunction_add_examples
(predictions, labels, task)
scenic/projects/layout_denoise/trainer.py:433
↓ 1 callersFunction_add_labels_from_one_pyramid_level_moment_retrieval
Adds frame labels and displacements for one pyramid level. Args: segment_start_indices: A int tensor of shape (max_num_segments,) containing
scenic/projects/unloc/datasets/dataset_utils.py:480
↓ 1 callersFunction_add_labels_from_one_pyramid_level_tal
Adds frame labels and displacements for one pyramid level.
scenic/projects/unloc/datasets/dataset_utils.py:558
↓ 1 callersMethod_add_posembed
Adds positional embeddings.
scenic/projects/mtv/model.py:252
↓ 1 callersMethod_add_positional_embedding
Adds positional embedding.
scenic/projects/unloc/encoders.py:154
↓ 1 callersMethod_add_tokenized_text
Adds tokenized text to the input pipeline.
scenic/projects/unloc/datasets/dataset_factory.py:475
↓ 1 callersFunction_add_tpu_host_options
(data)
scenic/dataset_lib/dataset_utils.py:786
↓ 1 callersMethod_align_temporal_dimension_across_views
Reshapes tokens from each view so they have the same temporal dim.
scenic/projects/mtv/model.py:499
↓ 1 callersMethod_apply_cross_attention
Applies cross view attention.
scenic/projects/mtv/model.py:140
↓ 1 callersFunction_apply_func_with_prob
Apply `func` to image w/ `args` as input with probability `prob`.
scenic/dataset_lib/big_transfer/preprocessing/autoaugment.py:575
↓ 1 callersMethod_apply_mlp
Applies MLP block.
scenic/projects/mtv/model.py:183
↓ 1 callersMethod_apply_output_conv
Apply depthwise convolutions and layer norm.
scenic/projects/unloc/video_text_fusion.py:185
↓ 1 callersMethod_apply_self_attentions
Applies self attentions for each view.
scenic/projects/mtv/model.py:120
↓ 1 callersFunction_apply_transform
Apply the i-th transformation.
scenic/projects/loca/ops.py:324
↓ 1 callersMethod_assert_tensors_equal
A wrapper that picks assertion based on tensor dtype.
scenic/projects/baselines/detr/tests/test_transforms.py:86
↓ 1 callersFunction_at_least_x_are_equal
At least `x` of `a` and `b` `Tensors` are equal.
scenic/dataset_lib/imagenet_dataset.py:101
↓ 1 callersFunction_average_multicrop_multiprompts
Averages prediction from different crops and prompts.
scenic/projects/unloc/eval_utils.py:230
↓ 1 callersFunction_barrier
(x)
scenic/train_lib/train_utils.py:840
↓ 1 callersFunction_bn_agg_mean_var
Aggregate batch statistics accross devices. Args: x: Inputs to compute batch statistics on. axis: Reduction axes for the stats. p_agg:
scenic/model_lib/layers/masked_layers.py:123
↓ 1 callersFunction_bokeh_format_image
Formats an RGB image (range [0.0, 1.0], shape [H, W, 3]) for bokeh.
scenic/projects/owl_vit/notebooks/plotting.py:187
↓ 1 callersMethod_box_loss
Computes box regression loss.
scenic/projects/unloc/moment_retrieval_base_model.py:295
↓ 1 callersFunction_box_tiles_to_mosaic
Reshapes a batch of per-tile boxes into boxes for a mosaic.
scenic/projects/owl_vit/preprocessing/mosaic.py:127
↓ 1 callersFunction_broadcast_and_concatenate
Broadcast and concatenate two tensors (_broadcat in original). Args: x: (b1, 1, d) y: (1, b2, d) Returns: ret: (b1, b2, d * 2)
scenic/projects/pixel_llm/modeling/eva02_vit.py:170
↓ 1 callersMethod_build_top_down_path
Pass information from top level to bottom in a feature pyramid.
scenic/projects/unloc/video_text_fusion.py:176
↓ 1 callersMethod_build_with_bottleneck
Builds the encoder with bottlenecks.
scenic/projects/mtv/model.py:268
↓ 1 callersMethod_build_with_cross_view_attention
Builds the encoder with bottlenecks.
scenic/projects/mtv/model.py:310
↓ 1 callersFunction_bytes_feature
(value)
scenic/projects/densevoc/tools/convert_video_tfrecord_to_image_tfrecord.py:74
↓ 1 callersFunction_ceil_divide
Ceil division of two JAX arrays.
scenic/model_lib/layers/masked_layers.py:609
↓ 1 callersMethod_check_config
Checks configuration errors.
scenic/projects/mtv/model.py:614
↓ 1 callersFunction_check_dataset_exists
(dataset_configs)
scenic/projects/robust_segvit/datasets/cityscapes_variants.py:239
↓ 1 callersFunction_close_on_exit
Call close on all writers on exit.
scenic/projects/vid2seq/generate_from_file.py:62
↓ 1 callersMethod_cls_loss
Computes classification loss.
scenic/projects/unloc/moment_retrieval_base_model.py:317
↓ 1 callersMethod_combine_sum
Combine sequence results via sum.
scenic/projects/densevoc/chota.py:323
↓ 1 callersMethod_combine_weighted_av
Combine sequence results via weighted average.
scenic/projects/densevoc/chota.py:328
↓ 1 callersMethod_compute_per_example_class_loss
Computes the unnormalized per-example classification loss and denom.
scenic/projects/baselines/detr/detr_base_model.py:367
↓ 1 callersMethod_compute_per_example_class_loss
Computes the unnormalized per-example classification loss and denom.
scenic/projects/owl_vit/matching_base_models.py:184
↓ 1 callersFunction_convert_attn_layers
Convert attention parameters.
scenic/projects/baselines/clip/model.py:235
↓ 1 callersFunction_convert_attn_layers
Convert attention parameters.
scenic/projects/owl_vit/clip/model.py:219
↓ 1 callersFunction_convert_detection
Converts the format of detections for evaluation. Args: result_lists: A dictionary holding lists of detections. num_results: Length of the
scenic/projects/unloc/activity_net_eval.py:334
↓ 1 callersFunction_convert_ground_truth
Converts the format of groundtruth segments for evaluation. Args: result_lists: A dictionary holding lists of groundtruth. num_results: Len
scenic/projects/unloc/activity_net_eval.py:281
↓ 1 callersFunction_convert_tf_boxes_to_xyxy
Convert yxyx [0, 1] normalized boxes to xyxy unnormalized format.
scenic/projects/owl_vit/preprocessing/label_ops.py:339
↓ 1 callersFunction_convert_vars
Convert torch parameters to flax parameters.
scenic/projects/baselines/clip/model.py:262
↓ 1 callersFunction_convert_vars
Convert torch parameters to flax parameters.
scenic/projects/owl_vit/clip/model.py:246
↓ 1 callersFunction_dataset_fn
Dataset function.
scenic/projects/tasseo/dataset_utils.py:100
↓ 1 callersFunction_dataset_fn
Dataset function.
scenic/projects/tasseo/datasets/chrmID_baseline_dataset.py:248
↓ 1 callersFunction_dataset_fn
Dataset function.
scenic/projects/tasseo/datasets/metaphase_sexid_dataset.py:139
← previousnext →601–700 of 4,921, ranked by callers