MCPcopy Create free account

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

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

↓ 1 callersFunctionbig_vision_linear_regression
Computes fewshot regression with eigenvalue solver in big_vision.
scenic/train_lib/transfer/tests/test_fewshot_utils.py:26
↓ 1 callersFunctionbn_and_freeze_batch_stats
(path)
scenic/projects/baselines/deformable_detr/trainer.py:60
↓ 1 callersFunctionboundary_to_zero
Set to zero all elements within dist of the outer boundary. Args: array: 2D array of non-zero elements dist: distance of boundary Return
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:89
↓ 1 callersFunctionbox_iou
Computes IoU between two sets of boxes. Boxes are in [x, y, x', y'] format [x, y] is top-left, [x', y'] is bottom right. Args: boxes1: Pre
scenic/model_lib/base_models/box_utils.py:74
↓ 1 callersFunctionbox_iou
Compute box IoU. Boxes in format [-l, -t, b, r]. Args: boxes1: array in shape B x n x 4 or n x 4 boxes2: array in shape B x m x 4 or m x 4
scenic/projects/baselines/centernet/modeling/centernet_utils.py:27
↓ 1 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/chota.py:50
↓ 1 callersMethodbox_predictor
Predicts bounding boxes from image features. Args: image_features: Features extracted from the image, flattened into a 1d sequence
scenic/projects/owl_vit/models.py:168
↓ 1 callersFunctionboxes_to_points
Sample points from boxes.
scenic/projects/pixel_llm/io/ops.py:549
↓ 1 callersFunctionbuild_and_apply_nas_policy
Build a policy from the given policies passed in and apply to image. Args: policies: list of lists of tuples in the form `(func, prob, level)`,
scenic/dataset_lib/big_transfer/preprocessing/autoaugment.py:607
↓ 1 callersFunctionbuild_datasets
Build datasets.
scenic/projects/robust_segvit/datasets/datasets_info.py:320
↓ 1 callersMethodbuild_flax_model
(self)
scenic/model_lib/base_models/base_model.py:179
↓ 1 callersMethodbuild_flax_model
(self)
scenic/projects/layout_denoise/base_model.py:180
↓ 1 callersMethodbuild_flax_model
(self)
scenic/projects/knowledge_visual_language/models/knowledge_fid.py:559
↓ 1 callersMethodbuild_flax_model
Sequence to sequence flax module.
scenic/projects/avatar/models.py:625
↓ 1 callersMethodbuild_flax_model
(self)
scenic/projects/polyvit/polyvit_base_model.py:409
↓ 1 callersMethodbuild_flax_model
(self)
scenic/projects/mtv/model.py:694
↓ 1 callersFunctionbuild_lut
(histo, step)
scenic/dataset_lib/big_transfer/preprocessing/autoaugment.py:376
↓ 1 callersFunctionbuild_solid_grid
Generates a 2D grid of points evenly spaced in [0, 1] x [0, 1].
scenic/projects/pixel_llm/modeling/utils.py:43
↓ 1 callersFunctionbuild_solid_grid
Generates a 2D grid of points evenly spaced in [0, 1] x [0, 1].
scenic/projects/pixel_llm/io/ops.py:529
↓ 1 callersFunctionbuild_tokenizer
Returns CLIP's tokenizer.
scenic/projects/owl_vit/clip/tokenizer.py:42
↓ 1 callersFunctioncached_wrapper
(*hashable_args, **hashable_kwargs)
scenic/projects/owl_vit/notebooks/numpy_cache.py:33
↓ 1 callersMethodcalc_and_apply
Calculates and applies the rotary embedding.
scenic/projects/boundary_attention/models/model_lib/rope_embedding.py:31
↓ 1 callersMethodce_loss
Returns softmax cross entropy loss with an L2 penalty on the weights. Args: logits: Output of model in shape [batch, length, num_classes].
scenic/projects/ncr/base_model.py:65
↓ 1 callersFunctioncentral_frame_init_embedding
Initialize input embedding from a ViT model. This function is adapted from scenic.projects.vivit.google.model_utils. Here, we add support to inte
scenic/projects/mtv/model_utils.py:144
↓ 1 callersFunctionchased_dp_assignment
Run dp matching as https://github.com/fujiso/SODA/blob/master/soda.py.
scenic/projects/vid2seq/dvc_eval.py:71
↓ 1 callersFunctioncheck_leaf_spec
(spec: Sequence[PyTree])
scenic/train_lib/train_utils.py:244
↓ 1 callersFunctioncheck_leaf_spec
(spec: Sequence[PyTree])
scenic/projects/unloc/train_utils.py:315
↓ 1 callersFunctioncheck_leaf_spec
(spec: Sequence[PyTree])
scenic/common_lib/debug_utils.py:172
↓ 1 callersFunctioncheck_weights_different
Check all leaves are different in two PyTrees.
scenic/projects/objectvivit/tools/convert_videomae_checkpoint.py:307
↓ 1 callersFunctionchrom_auc_pr_score
Compute Area Under the PR Curve for abnormal. Args: target: Numpy array of targets of shape (n_samples, n_classes). Since this metric is
scenic/projects/tasseo/train_utils.py:24
↓ 1 callersFunctionchrom_f1_score
Compute F1 score. Args: target: Numpy array of targets of shape (n_samples, n_classes). prediction: Numpy array of model predictions of sha
scenic/projects/tasseo/train_utils.py:76
↓ 1 callersFunctionchrom_precision
Compute precision. Args: target: Numpy array of targets of shape (n_samples, n_classes). prediction: Numpy array of model predictions of sh
scenic/projects/tasseo/train_utils.py:137
↓ 1 callersFunctionchrom_recall
Compute recall. Args: target: Numpy array of targets of shape (n_samples, n_classes). prediction: Numpy array of model predictions of shape
scenic/projects/tasseo/train_utils.py:95
↓ 1 callersFunctionchrom_roc_auc_score
Compute Area Under the ROC Curve for abnormal. Args: target: Numpy array of targets of shape (n_samples, n_classes). Since this metric is
scenic/projects/tasseo/train_utils.py:51
↓ 1 callersFunctionchrom_specificity
Compute recall. Args: target: Numpy array of targets of shape (n_samples, n_classes). prediction: Numpy array of model predictions of shape
scenic/projects/tasseo/train_utils.py:114
↓ 1 callersFunctioncircle_circle_intersections
Find the points where two circles intersect.
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:529
↓ 1 callersFunctioncircle_line_segment_intersection
Find the points where the circle intersects with the line segment.
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:575
↓ 1 callersFunctioncityscapes_load_split
Creates a split from the Cityscapes dataset using TensorFlow Datasets. For the training set, we drop the last partial batch. This is fine to do b
scenic/projects/robust_segvit/datasets/cityscapes_variants.py:171
↓ 1 callersMethodclass_predictor
Applies the class head to the image features. Args: image_features: Feature tokens extracted by the image embedder. query_embeddings:
scenic/projects/owl_vit/models.py:210
↓ 1 callersFunctionclassification_metrics_function
Calculates metrics for the classification task. Currently we assume each metric_fn has the API: ```metric_fn(logits, targets, weights)``` an
scenic/model_lib/base_models/classification_model.py:36
↓ 1 callersMethodclassification_metrics_function
(logits, batch, metrics, class_splits, split_names)
scenic/projects/mbt/model.py:823
↓ 1 callersMethodclear
(self)
scenic/projects/baselines/centernet/evaluators.py:183
↓ 1 callersMethodclear
(self)
scenic/projects/baselines/bert/train_utils.py:206
↓ 1 callersMethodclear
Clears predictions/labels for previous run.
scenic/projects/layout_denoise/train_utils.py:239
↓ 1 callersMethodclear
(self)
scenic/projects/tasseo/train_utils.py:224
↓ 1 callersMethodclear
(self)
scenic/projects/svvit/metrics.py:235
↓ 1 callersMethodclear
(self)
scenic/projects/pixel_llm/evaluators.py:111
↓ 1 callersMethodclear
(self)
scenic/projects/pixel_llm/evaluators.py:234
↓ 1 callersMethodclear
(self)
scenic/projects/pixel_llm/evaluators.py:499
↓ 1 callersMethodclear
(self)
scenic/projects/pixel_llm/evaluators.py:725
↓ 1 callersMethodclear
(self)
scenic/projects/streaming_dvc/densecap_evaluator.py:150
↓ 1 callersMethodclear
(self)
scenic/projects/streaming_dvc/caption_evaluator.py:126
↓ 1 callersFunctionclip_boxes
Clips boxes to image boundaries. It's called from roi_ops.py. Args: boxes: a tensor whose last dimension is 4 representing the coordinates
scenic/projects/baselines/centernet/modeling/roi_head_utils.py:188
↓ 1 callersFunctioncoco_decode_example
Convert custom tfrecord into tfds builder format.
scenic/projects/baselines/centernet/input_pipeline.py:100
↓ 1 callersFunctioncollapse_str_to_int
(workdir)
scenic/projects/boundary_attention/main.py:41
↓ 1 callersMethodcombine_sequences
Combines metrics across all sequences. Args: all_res: dict of dict; video_id to res from eval_sequence. Returns: res: same format
scenic/projects/densevoc/chota.py:276
↓ 1 callersFunctioncompute_average_precision_detection_ng
Computes average precision (detection task). Notes: The open source implementation is extremely slow, due to the way it iterates through the pr
scenic/projects/unloc/activity_net_eval.py:32
↓ 1 callersFunctioncompute_bert_loss
Computes BERT loss. Args: mlm_logits: Masked LM logits of shape [batch, length, vocab_size]. nsp_logits: Next sentence prediction logits of s
scenic/projects/baselines/bert/bert_base_model.py:188
↓ 1 callersMethodcompute_caption_similarity
Compute caption metrics.
scenic/projects/densevoc/chota.py:114
↓ 1 callersMethodcompute_coco_metrics
Compute the COCO metrics for the collected annotations. Args: clear_annotations: if True, clears the `self.annotations` parameter a
scenic/dataset_lib/coco_dataset/coco_eval.py:312
↓ 1 callersFunctioncompute_cost
Computes cost matrices for a batch of predictions. Relevant code: https://github.com/facebookresearch/detr/blob/647917626d5017e63c1217b99537deb2d
scenic/projects/baselines/detr/detr_base_model.py:34
↓ 1 callersMethodcompute_cost_matrix
Computes the matching cost matrix. Args: predictions: Dictionary of outputs from a model. targets: Dictionary of ground truth targets
scenic/projects/owl_vit/matching_base_models.py:62
↓ 1 callersMethodcompute_fewshot_metrics
Compute few-shot metrics on one dataset.
scenic/train_lib/transfer/fewshot_utils.py:281
↓ 1 callersMethodcompute_fewshot_metrics
Compute few-shot metrics on one dataset.
scenic/train_lib/transfer/fewshot_utils.py:449
↓ 1 callersMethodcompute_fewshot_metrics
Compute few-shot metrics on one dataset.
scenic/projects/baselines/bert/train_utils.py:366
↓ 1 callersFunctioncompute_flops
Performs static analysis of the graph to compute theoretical FLOPs. This function is branched from scenic/common_lib/debug_utils.py. The differen
scenic/projects/mbt/train_utils.py:33
↓ 1 callersFunctioncompute_ft
Computes a Fourier Transform in a given set of points. Computes the fourier transform (FT) in a give set of points. The FT is parameterized as a
scenic/projects/performer/performer.py:920
↓ 1 callersFunctioncompute_intersections_and_vertices
Compute the intersections and vertices of a list of shapes.
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:714
↓ 1 callersFunctioncompute_iou
Computes the IoU score between two temporal segments.
scenic/projects/unloc/metrics.py:138
↓ 1 callersMethodcompute_metrics
Computes the metrics for all added predictions.
scenic/projects/baselines/centernet/evaluators.py:108
↓ 1 callersMethodcompute_metrics
Computes the relevant metrics for all added <target, output> pairs.
scenic/projects/baselines/bert/train_utils.py:178
↓ 1 callersMethodcompute_metrics
Computes the metrics for all added predictions.
scenic/projects/layout_denoise/train_utils.py:201
↓ 1 callersMethodcompute_metrics
Computes the metrics for all added predictions.
scenic/projects/pixel_llm/evaluators.py:917
↓ 1 callersMethodcompute_metrics
Computes the metrics for all added predictions.
scenic/projects/streaming_dvc/densecap_evaluator.py:98
↓ 1 callersMethodcompute_sentence_likelihood
Compute likelihood of a given tokenized sentence. This implements section 3.5 in the Dense VOC paper https://arxiv.org/pdf/2306.11729.pdf
scenic/projects/densevoc/modeling/grit.py:421
↓ 1 callersFunctioncompute_similarity_scores
Computes similarity scores and dump them directly instead of metrics.
scenic/projects/tasseo/inference.py:117
↓ 1 callersFunctioncompute_similarity_scores
Computes similarity scores and dump them directly instead of metrics.
scenic/projects/svvit/inference.py:117
↓ 1 callersFunctionconcat_and_encode
()
scenic/projects/av_mae/vivit_multimodal.py:539
↓ 1 callersMethodconcate_context_tokens_to_visual
Concatenate context tokens (e.g., input question) to visual tokens. Args: visual_features: (batch_size, feature_length, object_feat_size).
scenic/projects/gerald/models/ger_model.py:104
↓ 1 callersMethodconcate_context_tokens_to_visual
Concatenate context tokens (e.g., questions in QA) to visual tokens. Args: visual_features: (batch_size, feature_length, object_feat_size).
scenic/projects/pixel_llm/modeling/text_decoder.py:339
↓ 1 callersMethodconcate_context_tokens_to_visual
Concatenate context tokens (e.g., questions in QA) to visual tokens. Args: visual_features: (batch_size, feature_length, object_feat_size).
scenic/projects/streaming_dvc/modeling/text_decoder.py:392
↓ 1 callersFunctionconstruct_example
Creates a single tf.SequenceExample proto.
scenic/projects/densevoc/tools/build_vidor_tfrecord.py:97
↓ 1 callersFunctionconstruct_example
Creates a single tf.SequenceExample proto.
scenic/projects/densevoc/tools/build_smit_tfrecord.py:93
↓ 1 callersMethodconstruct_examples_per_subset
(self, splits)
scenic/projects/avatar/datasets/av_asr_tfrecord_dataset.py:206
↓ 1 callersMethodconstruct_tables
(self, splits)
scenic/projects/avatar/datasets/av_asr_tfrecord_dataset.py:200
↓ 1 callersFunctioncontrol_flow
Create a new field reference which is controlled by the fn_flow. Args: fn_flow (fct): Function of signature (default) -> resolved_value which
scenic/projects/streaming_dvc/configs/common.py:46
↓ 1 callersFunctionconv_shape_tuple
Compute the shape of a conv given input shapes in canonical order. Args: lhs_shape: Input (lhs) shapes for which the output shapes should be in
scenic/model_lib/layers/masked_layers.py:658
↓ 1 callersFunctionconvert_big_vision_to_scenic_checkpoint
Converts a big_vision checkpoint to a scenic train state. The model weights, global step and accumulated train time are extracted. Optimizer stat
scenic/projects/baselines/plainvit/trainer.py:50
↓ 1 callersFunctionconvert_coco_as_video
Augment an image into a video.
scenic/projects/densevoc/input_utils.py:591
↓ 1 callersFunctionconvert_coco_format
Augment an image into a video.
scenic/projects/densevoc/input_utils.py:560
↓ 1 callersMethodconvert_coco_to_hota_format
Convert coco format to HOTA required format. Args: gt_data: coco json format with key "annotations" and "images". pred_data: coco pre
scenic/projects/densevoc/chota.py:335
↓ 1 callersFunctionconvert_cococaption_format
Convert COCO captioning format to detection by adding zero objects.
scenic/projects/densevoc/input_utils.py:632
↓ 1 callersFunctionconvert_image_to_jpg_bytestring
(image_bytestring)
scenic/projects/pixel_llm/tools/build_llava_tfrecord.py:58
↓ 1 callersFunctionconvert_pytorch_parameters
Adapt PyTorch model parameters to Jax ones. The steps are as follows. 1. PyTorch models have query-, key- and value-projections fused, whereas
scenic/projects/objectvivit/tools/convert_videomae_checkpoint.py:204
↓ 1 callersFunctionconvert_to_coco
Converts to COCO format.
scenic/projects/pixel_llm/tools/build_uninext_ref_tfrecord.py:204
↓ 1 callersFunctionconvert_to_coco
Converts to COCO format.
scenic/projects/pixel_llm/tools/build_mdetr_ref_tfrecord.py:212
↓ 1 callersFunctionconvert_to_vidstg_grounding_format
Convert outputs to VidSTG evaluator's format.
scenic/projects/densevoc/evaluation_utils.py:245
↓ 1 callersFunctioncopy_matched_params
Copy matched parameters from a restored one.
scenic/projects/baselines/centernet/train_utils.py:27
↓ 1 callersFunctioncopy_matched_params
Copy matched parameters from a restored one.
scenic/projects/streaming_dvc/train_utils.py:78
↓ 1 callersFunctioncosine_decay_scheduler
Gives a scaling factor based on scheduling with a cosine decay. Args: step: int; Current step. steps_per_cycle: int; Number of steps to res
scenic/train_lib/lr_schedules.py:149
← previousnext →901–1,000 of 4,921, ranked by callers