Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/google-research/scenic
/ functions
Functions
4,921 in github.com/google-research/scenic
⨍
Functions
4,921
◇
Types & classes
859
↳
Endpoints
16
↓ 2,017 callers
Method
get
Return the value for key if it exists otherwise the default.
scenic/projects/loca/utils.py:55
↓ 285 callers
Method
get
Return the value for key if it exists otherwise the default.
scenic/projects/verbs_in_action/utils.py:219
↓ 208 callers
Method
apply
(self, image: tf.Tensor)
scenic/projects/owl_vit/preprocessing/image_ops.py:419
↓ 196 callers
Method
get
Return the value for key if it exists otherwise the default.
scenic/projects/pixel_llm/partition_utils.py:69
↓ 187 callers
Method
update
Update with the given per-step metrics.
scenic/projects/vid2seq/trainer.py:595
↓ 174 callers
Method
get
Return the value for key if it exists otherwise the default.
scenic/projects/streaming_dvc/partition_utils.py:69
↓ 116 callers
Method
pause
(self, wait_for=())
scenic/train_lib/train_utils.py:1244
↓ 115 callers
Method
resume
(self)
scenic/train_lib/train_utils.py:1249
↓ 96 callers
Method
get
Return the value for key if it exists otherwise the default.
scenic/train_lib/train_utils.py:78
↓ 91 callers
Method
param
(self, name: str, *args, **kwargs)
scenic/projects/loca/vit.py:245
↓ 75 callers
Function
metrics_fn
(train_state, batch, predictions)
scenic/projects/owl_vit/trainer.py:163
↓ 68 callers
Method
get
Get a dataset from the registry by its name. Args: name: Dataset name. Returns: Dataset builder function that accepts dataset-sp
scenic/dataset_lib/datasets.py:91
↓ 67 callers
Method
run
(self)
setup.py:58
↓ 60 callers
Method
save
(self)
scenic/train_lib/train_utils.py:1254
↓ 50 callers
Method
param
(self, name: str, *args, **kwargs)
scenic/projects/baselines/bit_resnet.py:46
↓ 47 callers
Method
load
Loads backbone parameters for this model from a checkpoint.
scenic/projects/owl_vit/layers.py:590
↓ 46 callers
Method
get_num_examples
Returns the number of examples in the TFRecord files.
scenic/projects/av_mae/datasets/audiovisual_tfrecord_dataset.py:360
↓ 41 callers
Method
tick
A chronometer tick.
scenic/train_lib/train_utils.py:1157
↓ 38 callers
Method
add
Add a dataset to the registry, i.e. register a dataset. Args: name: Dataset name (must be unique). builder_fn: Function to be called
scenic/dataset_lib/datasets.py:75
↓ 35 callers
Method
log
(self, inputs)
scenic/projects/baselines/detr/train_utils.py:358
↓ 34 callers
Function
lr_fn
Step to learning rate function.
scenic/train_lib/lr_schedules.py:203
↓ 33 callers
Method
inform
Provide some extra info that's only known later in the program.
scenic/train_lib/train_utils.py:1139
↓ 31 callers
Method
load
(self, ckpt={})
scenic/train_lib/train_utils.py:1262
↓ 29 callers
Method
write
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/vid2seq/trainer.py:600
↓ 28 callers
Function
clip_grads
Clip gradients stored as a pytree of arrays to maximum norm `max_norm`.
scenic/projects/baselines/detr/train_utils.py:383
↓ 28 callers
Function
loss_fn
(params)
scenic/projects/owl_vit/trainer.py:95
↓ 22 callers
Method
string_tensor_to_indices
(self, string_tensor: Union[tf.Tensor, Sequence[str]],
scenic/projects/t5/tokenizer.py:68
↓ 19 callers
Method
initialize
(self)
scenic/projects/t5/tokenizer.py:60
↓ 19 callers
Function
task
Vision task with val and test splits.
scenic/projects/baselines/plainvit/configs/vtab_plainvit_config.py:167
↓ 18 callers
Function
dense
(inputs, output_dim, dtype, kernel_init=None)
scenic/projects/layout_denoise/layers/common.py:33
↓ 15 callers
Method
update
Update with the given per-step metrics.
scenic/projects/avatar/generation_trainer.py:580
↓ 14 callers
Function
apply_weights
Applies given weights of the inputs in the minibatch to outputs. Note that weights can be per example (i.e. of shape `[batch,]`) or per pixel/tok
scenic/model_lib/base_models/model_utils.py:51
↓ 13 callers
Method
get_metrics_fn
(self, split: Optional[str] = None)
scenic/projects/loca/vit.py:328
↓ 13 callers
Method
tokenize
(self, text: str, max_token_len: int = 16)
scenic/projects/owl_vit/models.py:109
↓ 12 callers
Function
tf_float
(t)
scenic/projects/baselines/centernet/transforms.py:128
↓ 12 callers
Function
unpatch_to_images
(tensor: jnp.ndarray)
scenic/projects/av_mae/train_utils.py:114
↓ 12 callers
Method
update
Update with the given per-step metrics.
scenic/projects/knowledge_visual_language/trainer_utils.py:194
↓ 11 callers
Method
decode
( self, encoded: jnp.ndarray, encoder_input_tokens: jnp.ndarray, # Only needed for masks.
scenic/projects/t5/layers.py:90
↓ 11 callers
Function
metrics_fn
(train_state, batch, predictions)
scenic/projects/baselines/detr/trainer.py:161
↓ 11 callers
Method
update
Update per-frame localization predictions. Args: predictions: dict of image_id ('{video_id}_{frame_id}') to dict {'boxes': [[l, t,
scenic/projects/densevoc/vidstg_evaluator.py:263
↓ 10 callers
Method
evaluate
Evaluate on given predictions.
scenic/projects/densevoc/vidstg_evaluator.py:98
↓ 10 callers
Function
fix1
(hyper, key, val)
scenic/projects/baselines/plainvit/configs/vtab_plainvit_config.py:163
↓ 10 callers
Method
get_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/av_mae/mbt.py:728
↓ 10 callers
Function
tf_float
(t)
scenic/projects/baselines/detr/transforms.py:23
↓ 10 callers
Function
tf_float
(t)
scenic/projects/densevoc/transforms.py:26
↓ 10 callers
Function
tf_float
(t)
scenic/projects/densevoc/input_utils.py:467
↓ 9 callers
Function
_int64_feature
(value)
scenic/projects/pixel_llm/tools/build_mdetr_ref_tfrecord.py:81
↓ 9 callers
Method
fold
Fold patches of an image using function fn. Args: unfolded: Array of shape [N, C, R, R, H', W'] containing all unfolded patches.
scenic/projects/boundary_attention/helpers/junction_functions.py:103
↓ 9 callers
Method
indices_to_string
(self, idx: int)
scenic/projects/gerald/input_pipeline.py:520
↓ 9 callers
Method
preprocess
Proprocess images. Normalize pixels for non-padded pixels.
scenic/projects/gerald/models/ger_model.py:273
↓ 8 callers
Method
compute_score
Compute METEOR scores.
scenic/projects/streaming_dvc/cococap_eval.py:32
↓ 8 callers
Method
encode
(self, encoder_input_tokens: jnp.ndarray, encoder_segment_ids: Optional[jnp.ndarray]
scenic/projects/t5/layers.py:82
↓ 8 callers
Function
fake_decoded_features
Create a fake features dictionary. Args: n: int; number of boxes/objects. h: int; height of fake image. w: int; width of fake image.
scenic/projects/baselines/detr/tests/test_transforms.py:49
↓ 8 callers
Function
get_coco_ref_eval_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ eval source.
scenic/projects/pixel_llm/configs/bert/pixel_llm_bert_refseg.py:128
↓ 8 callers
Function
get_coco_ref_eval_source
Returns the RefCOCO/RefCOCOg/RefCOCO+/ eval source.
scenic/projects/pixel_llm/configs/t5/pixel_llm_t5_refseg.py:128
↓ 8 callers
Method
get_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/mbt/model.py:717
↓ 8 callers
Method
get_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/avatar/models.py:647
↓ 8 callers
Function
init_posemb
Initialize the positional embeddings.
scenic/projects/mbt/model_utils.py:228
↓ 8 callers
Function
replace_dict
Replaces values in model dictionary with restored ones from checkpoint.
scenic/projects/knowledge_visual_language/trainer_utils.py:229
↓ 8 callers
Method
submit
(self, fn: Callable[..., Any], *args, **kwargs)
scenic/common_lib/debug_utils.py:280
↓ 7 callers
Function
_canonicalize_string_tf
Brings text labels into a standard form.
scenic/projects/owl_vit/preprocessing/label_ops.py:312
↓ 7 callers
Function
_int64_feature
(value)
scenic/projects/baselines/centernet/tools/build_coco_tfrecord.py:69
↓ 7 callers
Function
_int64_feature
(value)
scenic/projects/pixel_llm/tools/build_uninext_ref_tfrecord.py:94
↓ 7 callers
Method
decode
Applies Transformer decoder-branch on encoded-input and target.
scenic/projects/pixel_llm/modeling/t5_text_head.py:672
↓ 7 callers
Method
encode
Applies Transformer encoder-branch on the inputs.
scenic/projects/pixel_llm/modeling/t5_text_head.py:646
↓ 7 callers
Method
get_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/token_learner/model.py:751
↓ 7 callers
Function
pad_to
(image, size)
scenic/projects/densevoc/input_utils.py:515
↓ 7 callers
Function
zero_pad
(array, batch_pad=batch_pad)
scenic/projects/verbs_in_action/tfrecord_dataset.py:55
↓ 6 callers
Method
_assert_features_equal
Assert whether two feature dicts are equal.
scenic/projects/baselines/detr/tests/test_transforms.py:100
↓ 6 callers
Function
add_loss_mask
(data, losses)
scenic/projects/densevoc/input_utils.py:651
↓ 6 callers
Function
apply_spatial_mask
Construct and apply spatial mask to the inputs. Args: inputs: Input tensor with dimensions [batch, spatial_dim, dim] to which the mask sh
scenic/model_lib/layers/masked_layers.py:489
↓ 6 callers
Method
assertDictEqualRecursive
(self, actual, expected)
scenic/projects/mtv/model_utils_test.py:201
↓ 6 callers
Function
bert_truncated_normal_initializer
TruncatedNormal(0.02) initializer.
scenic/projects/baselines/bert/layers.py:29
↓ 6 callers
Method
clear_annotations
Clears the annotations collected in this object. It is important to call this method either at the end or at the beginning of a new evaluatio
scenic/dataset_lib/coco_dataset/coco_eval.py:210
↓ 6 callers
Function
get_hw
Return the height, width of image as float32 tf.Tensors.
scenic/projects/baselines/detr/transforms.py:31
↓ 6 callers
Method
get_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/baselines/plainvit/plainvit.py:310
↓ 6 callers
Function
global_l2_norm
(x: jnp.ndarray)
scenic/projects/pixel_llm/partition_utils.py:152
↓ 6 callers
Function
image_to_uint8
Converts a float image to uint8. Also un-whitens the image, if needed.
scenic/projects/boundary_attention/helpers/viz_utils.py:147
↓ 6 callers
Function
init_embedding
Initialize input embedding.
scenic/projects/mbt/model_utils.py:312
↓ 6 callers
Method
log_fewshot_summary
Call `writer` with a descriptive string and the results.
scenic/train_lib/transfer/fewshot_utils.py:331
↓ 6 callers
Method
reset_access_record
Resets the record of config field accesses.
scenic/common_lib/debug_utils.py:239
↓ 6 callers
Method
run_all
Compute summary over all `datasets` that comes from config.
scenic/train_lib/transfer/fewshot_utils.py:310
↓ 6 callers
Function
scale_channel
Scale the 2D image using the autocontrast rule.
scenic/dataset_lib/big_transfer/preprocessing/autoaugment.py:302
↓ 6 callers
Function
to_cpu
Transfers array (replicated on multiple hosts) to a single host. Args: array: Replicated array of shape [num_hosts, num_devices, local_ba
scenic/projects/loca/utils.py:127
↓ 6 callers
Method
unfold
Extract patches from an image. Args: im: Array of shape [N, C, H, W] to be unfolded into patches patchsize: Size of extracted patches
scenic/projects/boundary_attention/helpers/junction_functions.py:59
↓ 6 callers
Function
uniform_initializer
(minval, maxval, dtype=jnp.float32)
scenic/projects/baselines/deformable_detr/deformable_transformer.py:46
↓ 5 callers
Function
_bytes_feature
(value)
scenic/projects/pixel_llm/tools/build_ln_tfrecord.py:189
↓ 5 callers
Function
_merge_instances
Combine a batch of padded instance labels into a single-example label.
scenic/projects/owl_vit/preprocessing/mosaic.py:160
↓ 5 callers
Method
accumulate
(self)
scenic/projects/densevoc/vidstg_evaluator.py:260
↓ 5 callers
Function
apply_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/projects/pixel_llm/io/flexio.py:80
↓ 5 callers
Function
dataset_builder
Returns generators for pretraining dataset or OVEN sets. Args: batch_size: int; Determines the train batch size. eval_batch_size: int; Dete
scenic/projects/gerald/input_pipeline.py:254
↓ 5 callers
Method
decode
Forward decoder. Args: text_tokens: (batch_size, max_caption_length) encoded: (batch_size, num_tot_tokens, dim) encoder_mask: (
scenic/projects/streaming_dvc/modeling/vid2seq_model.py:274
↓ 5 callers
Function
det
(a, b)
scenic/projects/boundary_attention/kaleidoshapes/make_kaleido_image.py:665
↓ 5 callers
Method
dot_product_attention
Computes dot-product attention given query, key, and value. This is the core function for applying fast approximate dot-product attention. It
scenic/projects/fast_vit/model_utils.py:1088
↓ 5 callers
Method
embed_image
Embeds image and returns image embeddings and boxes. Args: image: Single uint8 Numpy image of any size. Will be converted to float
scenic/projects/owl_vit/notebooks/inference.py:87
↓ 5 callers
Function
gather_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/avatar/decode.py:80
↓ 5 callers
Method
get_2d_array
(self)
scenic/projects/performer/performer.py:60
↓ 5 callers
Function
get_aug_param
(aug_ratio, h, w, size)
scenic/projects/densevoc/input_utils.py:475
↓ 5 callers
Method
get_dists_and_patches
Compute distance functions and piecewise-constant patches. Args: params: Array of shape [N, 5, H', W'] holding N field of junctions
scenic/projects/boundary_attention/field_of_junctions_jax/field_of_junctions.py:429
↓ 5 callers
Method
get_label_map
Test get_label_map.
scenic/dataset_lib/coco_dataset/tests/test_coco_utils.py:31
next →
1–100 of 4,921, ranked by callers