### Install Project Dependencies Source: https://github.com/damo-cv/transreid/blob/main/README.md Installs the necessary Python packages for the project. Ensure you have PyTorch version 1.6 or higher for accelerated training with torch.cuda.amp. ```bash pip install -r requirements.txt (we use /torch 1.6.0 /torchvision 0.7.0 /timm 0.3.2 /cuda 10.1 / 16G or 32G V100 for training and evaluation. Note that we use torch.cuda.amp to accelerate speed of training which requires pytorch >=1.6) ``` -------------------------------- ### TransReID Configuration Example (YAML) Source: https://context7.com/damo-cv/transreid/llms.txt Example YACS configuration file for TransReID, detailing settings for model, input, datasets, dataloader, solver, and testing. Includes options for pretraining, loss type, image transformations, and optimization parameters. ```yaml # Example configuration: configs/Market/vit_transreid_stride.yml MODEL: PRETRAIN_CHOICE: 'imagenet' PRETRAIN_PATH: '/path/to/jx_vit_base_p16_224-80ecf9dd.pth' METRIC_LOSS_TYPE: 'triplet' IF_LABELSMOOTH: 'off' NAME: 'transformer' NO_MARGIN: True DEVICE_ID: ('0') TRANSFORMER_TYPE: 'vit_base_patch16_224_TransReID' STRIDE_SIZE: [12, 12] # Overlapping stride for more patches SIE_CAMERA: True # Enable camera-aware SIE SIE_COE: 3.0 # SIE coefficient JPM: True # Enable Jigsaw Patch Module RE_ARRANGE: True # Shuffle patches in JPM INPUT: SIZE_TRAIN: [256, 128] SIZE_TEST: [256, 128] PROB: 0.5 # Random horizontal flip probability RE_PROB: 0.5 # Random erasing probability PADDING: 10 PIXEL_MEAN: [0.5, 0.5, 0.5] PIXEL_STD: [0.5, 0.5, 0.5] DATASETS: NAMES: ('market1501') ROOT_DIR: ('../../data') DATALOADER: SAMPLER: 'softmax_triplet' # Use identity sampler for triplet loss NUM_INSTANCE: 4 # Instances per identity in batch NUM_WORKERS: 8 SOLVER: OPTIMIZER_NAME: 'SGD' MAX_EPOCHS: 120 BASE_LR: 0.008 IMS_PER_BATCH: 64 WARMUP_METHOD: 'linear' CHECKPOINT_PERIOD: 120 LOG_PERIOD: 50 EVAL_PERIOD: 120 WEIGHT_DECAY: 1e-4 TEST: EVAL: True IMS_PER_BATCH: 256 RE_RANKING: False NECK_FEAT: 'before' # Use feature before BN for testing FEAT_NORM: 'yes' # L2 normalize features ``` -------------------------------- ### Custom Training with Overrides Source: https://context7.com/damo-cv/transreid/llms.txt Customize training parameters via command-line overrides. This example sets specific stride sizes, enables camera awareness, disables viewpoint awareness for SIE, enables JPM, specifies the transformer type, dataset name, and output directory. ```bash python train.py --config_file configs/transformer_base.yml \ MODEL.DEVICE_ID "('0')" \ MODEL.STRIDE_SIZE "[12, 12]" \ MODEL.SIE_CAMERA True \ MODEL.SIE_VIEW False \ MODEL.JPM True \ MODEL.TRANSFORMER_TYPE "vit_base_patch16_224_TransReID" \ DATASETS.NAMES "('market1501')" \ OUTPUT_DIR "../logs/my_experiment" ``` -------------------------------- ### Evaluate TransReID on Market Dataset Source: https://github.com/damo-cv/transreid/blob/main/README.md Example command to evaluate the TransReID model on the Market dataset. Ensure the specified config file and checkpoint path are correct. ```bash python test.py --config_file configs/Market/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" TEST.WEIGHT '../logs/market_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Evaluate TransReID on VehicleID Dataset Source: https://github.com/damo-cv/transreid/blob/main/README.md Example command to evaluate the TransReID model on the VehicleID dataset. Multiple tests are recommended for stable results. ```bash python test.py --config_file configs/VehicleID/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" TEST.WEIGHT '../logs/vehicleID_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Evaluate TransReID on OCC_Duke Dataset Source: https://github.com/damo-cv/transreid/blob/main/README.md Example command to evaluate the TransReID model on the OCC_Duke dataset. Ensure the specified config file and checkpoint path are correct. ```bash python test.py --config_file configs/OCC_Duke/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" TEST.WEIGHT '../logs/occ_duke_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Evaluate TransReID on VeRi Dataset Source: https://github.com/damo-cv/transreid/blob/main/README.md Example command to evaluate the TransReID model on the VeRi dataset. Ensure the specified config file and checkpoint path are correct. ```bash python test.py --config_file configs/VeRi/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" TEST.WEIGHT '../logs/veri_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Evaluate TransReID on DukeMTMC Dataset Source: https://github.com/damo-cv/transreid/blob/main/README.md Example command to evaluate the TransReID model on the DukeMTMC dataset. Ensure the specified config file and checkpoint path are correct. ```bash python test.py --config_file configs/DukeMTMC/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" TEST.WEIGHT '../logs/duke_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Evaluate TransReID on MSMT17 Dataset Source: https://github.com/damo-cv/transreid/blob/main/README.md Example command to evaluate the TransReID model on the MSMT17 dataset. Ensure the specified config file and checkpoint path are correct. ```bash python test.py --config_file configs/MSMT17/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" TEST.WEIGHT '../logs/msmt17_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Build TransReID Model with JPM Source: https://context7.com/damo-cv/transreid/llms.txt Constructs the TransReID model using the `make_model` function. This example builds a transformer model with the Jigsaw Patch Module (JPM), enabling global and local feature extraction. Ensure PyTorch and CUDA are available. ```python from model import make_model from config import cfg # Load configuration cfg.merge_from_file('configs/Market/vit_transreid_stride.yml') cfg.freeze() # Build transformer model with JPM (Jigsaw Patch Module) # Returns model with global + local feature extraction model = make_model( cfg, num_class=751, # Number of identities in training set camera_num=6, # Number of cameras (for SIE) view_num=1 # Number of viewpoints (for SIE) ) ``` -------------------------------- ### TripletLoss with Hard Example Mining Source: https://context7.com/damo-cv/transreid/llms.txt Implements triplet loss for learning discriminative embeddings, featuring hard positive and hard negative mining. It allows for configurable margins and can compute losses on normalized or unnormalized feature embeddings. ```python from loss.triplet_loss import TripletLoss, euclidean_dist, hard_example_mining # Create triplet loss with margin triplet_loss = TripletLoss(margin=0.3) # Or soft margin triplet loss (no margin parameter) soft_triplet_loss = TripletLoss(margin=None) # Compute loss on feature embeddings features = torch.randn(64, 768).cuda() # [batch_size, feature_dim] labels = torch.randint(0, 16, (64,)).cuda() # [batch_size] identity labels # Returns loss, distance to hardest positive, distance to hardest negative loss, dist_ap, dist_an = triplet_loss(features, labels, normalize_feature=False) print(f"Triplet loss: {loss.item():.4f}") print(f"Mean dist(anchor, positive): {dist_ap.mean().item():.4f}") print(f"Mean dist(anchor, negative): {dist_an.mean().item():.4f}") ``` ```python # Direct distance computation dist_matrix = euclidean_dist(features, features) # [N, N] pairwise distances # Hard example mining dist_ap, dist_an = hard_example_mining(dist_matrix, labels) ``` -------------------------------- ### Create Data Directory Source: https://github.com/damo-cv/transreid/blob/main/README.md Creates the main directory for storing datasets. Download and organize the specified person and vehicle datasets within this directory. ```bash mkdir data ``` -------------------------------- ### Load and Modify Configuration in Python Source: https://context7.com/damo-cv/transreid/llms.txt Demonstrates how to load a configuration file using YACS and override specific settings programmatically. The configuration can be frozen to prevent further modifications. ```python # Loading and modifying configuration in Python from config import cfg # Load from file cfg.merge_from_file('configs/Market/vit_transreid_stride.yml') # Override from command-line style list cfg.merge_from_list([ 'MODEL.DEVICE_ID', "('0')", 'SOLVER.MAX_EPOCHS', '60', 'OUTPUT_DIR', './my_logs' ]) # Freeze configuration (no more modifications allowed) cfg.freeze() ``` -------------------------------- ### Distributed Training Command Source: https://github.com/damo-cv/transreid/blob/main/README.md Use this command to launch distributed training across multiple GPUs. Ensure CUDA is available and the correct number of GPUs are specified. ```bash CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node=4 --master_port 66666 train.py --config_file configs/VehicleID/vit_transreid_stride.yml MODEL.DIST_TRAIN True ``` -------------------------------- ### Create Data Loaders Source: https://context7.com/damo-cv/transreid/llms.txt Initializes training and validation data loaders using the `make_dataloader` function. This function handles transforms, samplers, and batch construction for re-identification tasks. Load the configuration first. ```python from datasets import make_dataloader from config import cfg cfg.merge_from_file('configs/Market/vit_transreid_stride.yml') cfg.freeze() ``` -------------------------------- ### Evaluate Trained Model on Market-1501 Source: https://context7.com/damo-cv/transreid/llms.txt Evaluate a trained model on the Market-1501 dataset. Specify the configuration file and the path to the trained weights. ```bash python test.py --config_file configs/Market/vit_transreid_stride.yml \ MODEL.DEVICE_ID "('0')" \ TEST.WEIGHT '../logs/market_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Distributed Training on VehicleID Source: https://context7.com/damo-cv/transreid/llms.txt Perform distributed training on the VehicleID dataset using 4 GPUs. Ensure the master port is correctly set. ```bash CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch \ --nproc_per_node=4 \ --master_port 66666 \ train.py --config_file configs/VehicleID/vit_transreid_stride.yml MODEL.DIST_TRAIN True ``` -------------------------------- ### Evaluate on DukeMTMC with Re-ranking Source: https://context7.com/damo-cv/transreid/llms.txt Evaluate a trained model on the DukeMTMC dataset and enable re-ranking for improved retrieval results. Specify the configuration file and the path to the trained weights. ```bash python test.py --config_file configs/DukeMTMC/vit_transreid_stride.yml \ MODEL.DEVICE_ID "('0')" \ TEST.WEIGHT '../logs/duke_vit_transreid_stride/transformer_120.pth' \ TEST.RE_RANKING True ``` -------------------------------- ### Build Optimizer Source: https://context7.com/damo-cv/transreid/llms.txt Constructs optimizers for the model and center loss, supporting SGD, Adam, and AdamW. It allows for per-parameter learning rates, with specific handling for bias parameters and classifier layers. Includes a separate optimizer for the center loss criterion. ```python from solver import make_optimizer from model import make_model from loss import make_loss from config import cfg cfg.merge_from_file('configs/Market/vit_transreid_stride.yml') cfg.freeze() model = make_model(cfg, num_class=751, camera_num=6, view_num=1) loss_func, center_criterion = make_loss(cfg, num_classes=751) # Create optimizer and center loss optimizer optimizer, optimizer_center = make_optimizer(cfg, model, center_criterion) ``` ```python # optimizer: SGD or Adam for model parameters # - Different lr for bias parameters (BIAS_LR_FACTOR) # - Optional 2x lr for classifier layers (LARGE_FC_LR) # optimizer_center: SGD for center loss parameters # Training step optimizer.zero_grad() optimizer_center.zero_grad() loss = ... # compute loss loss.backward() optimizer.step() # For center loss, scale gradients before stepping if 'center' in cfg.MODEL.METRIC_LOSS_TYPE: for param in center_criterion.parameters(): param.grad.data *= (1. / cfg.SOLVER.CENTER_LOSS_WEIGHT) optimizer_center.step() ``` -------------------------------- ### Train VeRi TransReID with Stride Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the VeRi dataset using the TransReID configuration with a specified stride size. ```bash python train.py --config_file configs/VeRi/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Train Market TransReID with Stride Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the Market-1501 dataset using the TransReID configuration with a specified stride size. ```bash python train.py --config_file configs/Market/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Evaluation Command Template Source: https://github.com/damo-cv/transreid/blob/main/README.md General command for evaluating the trained TransReID model. Specify the configuration file, device ID, and the path to the trained checkpoints. ```bash python test.py --config_file 'choose which config to test' MODEL.DEVICE_ID "('your device id')" TEST.WEIGHT "('your path of trained checkpoints')" ``` -------------------------------- ### Train TransReID Model Source: https://github.com/damo-cv/transreid/blob/main/README.md Initiates the training process for the TransReID model. Customize parameters such as stride size, SIE usage, JPM, transformer type, and output directory. ```bash python train.py --config_file configs/transformer_base.yml MODEL.DEVICE_ID "('your device id')" MODEL.STRIDE_SIZE ${1} MODEL.SIE_CAMERA ${2} MODEL.SIE_VIEW ${3} MODEL.JPM ${4} MODEL.TRANSFORMER_TYPE ${5} OUTPUT_DIR ${OUTPUT_DIR} DATASETS.NAMES "('your dataset name')" ``` -------------------------------- ### Create Data Loaders Source: https://context7.com/damo-cv/transreid/llms.txt Initializes data loaders for training and validation. `train_loader` uses `RandomIdentitySampler` for triplet loss with augmentations, while `train_loader_normal` provides data without augmentation for validation during training. `val_loader` is for query and gallery images. ```python train_loader, train_loader_normal, val_loader, num_query, num_classes, camera_num, view_num = make_dataloader(cfg) ``` ```python for n_iter, (imgs, pids, camids, viewids) in enumerate(train_loader): # imgs: [batch_size, 3, 256, 128] - normalized images # pids: [batch_size] - person/vehicle identity labels # camids: [batch_size] - camera ID labels # viewids: [batch_size] - viewpoint ID labels print(f"Batch {n_iter}: images={imgs.shape}, identities={pids.unique().shape[0]}") break ``` ```python for n_iter, (imgs, pids, camids, camids_batch, viewids, img_paths) in enumerate(val_loader): # Additional img_paths for result analysis print(f"Val batch {n_iter}: {len(img_paths)} images") break ``` ```python print(f"Dataset: {num_classes} identities, {camera_num} cameras, {view_num} views") print(f"Query size: {num_query}, Gallery size: {len(val_loader.dataset) - num_query}") ``` -------------------------------- ### Access Configuration Values in Python Source: https://context7.com/damo-cv/transreid/llms.txt Access configuration values using the cfg object. Ensure the configuration is loaded before accessing its attributes. ```python print(f"Model: {cfg.MODEL.TRANSFORMER_TYPE}") print(f"Dataset: {cfg.DATASETS.NAMES}") print(f"Epochs: {cfg.SOLVER.MAX_EPOCHS}") print(f"Learning rate: {cfg.SOLVER.BASE_LR}") ``` -------------------------------- ### Train DukeMTMC Baseline Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the DukeMTMC dataset using the transformer-based baseline configuration. ```bash python train.py --config_file configs/DukeMTMC/vit_base.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Train DukeMTMC with JPM Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the DukeMTMC dataset with the transformer baseline and the Joint Probability Matching (JPM) module enabled. ```bash python train.py --config_file configs/DukeMTMC/vit_jpm.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Evaluate on VehicleID with Multiple Trials Source: https://context7.com/damo-cv/transreid/llms.txt Evaluate a trained model on the VehicleID dataset. This command runs 10 trials and averages the results to provide a more robust evaluation. ```bash python test.py --config_file configs/VehicleID/vit_transreid_stride.yml \ MODEL.DEVICE_ID "('0')" \ TEST.WEIGHT '../logs/vehicleID_vit_transreid_stride/transformer_120.pth' ``` -------------------------------- ### Train DukeMTMC TransReID with Stride [12, 12] Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the DukeMTMC dataset with the TransReID configuration, specifically using a stride size of [12, 12] for the transformer. ```bash python train.py --config_file configs/DukeMTMC/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Train MSMT17 TransReID with Stride Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the MSMT17 dataset using the TransReID configuration with a specified stride size. ```bash python train.py --config_file configs/MSMT17/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Train DukeMTMC TransReID (SIE + JPM) Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the DukeMTMC dataset using the full TransReID configuration, combining the transformer baseline with SIE and JPM modules. ```bash python train.py --config_file configs/DukeMTMC/vit_transreid.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Train OCC_Duke TransReID with Stride Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the Occluded DukeMTMC dataset using the TransReID configuration with a specified stride size. ```bash python train.py --config_file configs/OCC_Duke/vit_transreid_stride.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Create TransReID Model Source: https://context7.com/damo-cv/transreid/llms.txt Instantiate the TransReID model, a Vision Transformer with Side Information Embedding (SIE). Configure image size, stride, dropout rates, and SIE parameters. Load pretrained weights. ```python from model.backbones.vit_pytorch import vit_base_patch16_224_TransReID, TransReID # Create ViT-Base model for re-ID model = vit_base_patch16_224_TransReID( img_size=(256, 128), # Height x Width stride_size=12, # Overlapping patch stride (smaller = more patches) drop_rate=0.0, # Dropout rate attn_drop_rate=0.0, # Attention dropout drop_path_rate=0.1, # Stochastic depth rate camera=6, # Number of cameras for SIE (0 to disable) view=0, # Number of viewpoints for SIE local_feature=True, # Enable for JPM module sie_xishu=3.0 # SIE coefficient ) # Load pretrained ImageNet weights model.load_param('/path/to/jx_vit_base_p16_224-80ecf9dd.pth') # Forward pass images = torch.randn(32, 3, 256, 128) cam_labels = torch.randint(0, 6, (32,)) view_labels = torch.zeros(32, dtype=torch.long) # With local_feature=True, returns intermediate features for JPM features = model(images, cam_label=cam_labels, view_label=view_labels) # features shape: [32, num_patches+1, 768] for local_feature=True # features shape: [32, 768] for local_feature=False (CLS token only) # Available transformer types: # - vit_base_patch16_224_TransReID: ViT-Base (768 dim, 12 layers, 12 heads) # - vit_small_patch16_224_TransReID: ViT-Small (768 dim, 8 layers, 8 heads) # - deit_small_patch16_224_TransReID: DeiT-Small (384 dim, 12 layers, 6 heads) ``` -------------------------------- ### Train DukeMTMC with SIE Source: https://github.com/damo-cv/transreid/blob/main/README.md Trains the DukeMTMC dataset with the transformer baseline and the Spatially-aware Embedding (SIE) module enabled. ```bash python train.py --config_file configs/DukeMTMC/vit_sie.yml MODEL.DEVICE_ID "('0')" ``` -------------------------------- ### Initialize and Use R1_mAP_eval Source: https://context7.com/damo-cv/transreid/llms.txt Initialize the R1_mAP_eval class for computing re-ID metrics. Accumulate features from validation batches and then compute CMC and mAP. Supports optional re-ranking. ```python from utils.metrics import R1_mAP_eval # Initialize evaluator num_query = 3368 # Number of query images evaluator = R1_mAP_eval(num_query, max_rank=50, feat_norm=True, reranking=False) evaluator.reset() # Accumulate features from batches model.eval() for imgs, pids, camids, camids_batch, viewids, _ in val_loader: with torch.no_grad(): features = model(imgs.cuda(), cam_label=camids_batch.cuda(), view_label=viewids.cuda()) evaluator.update((features, pids, camids)) # Compute metrics cmc, mAP, distmat, pids, camids, qf, gf = evaluator.compute() # Results print(f"mAP: {mAP:.1%}") print(f"Rank-1: {cmc[0]:.1%}") print(f"Rank-5: {cmc[4]:.1%}") print(f"Rank-10: {cmc[9]:.1%}") # With re-ranking for improved results evaluator_rerank = R1_mAP_eval(num_query, max_rank=50, feat_norm=True, reranking=True) # ... same usage, automatically applies k-reciprocal re-ranking ``` -------------------------------- ### Build Combined Loss Function Source: https://context7.com/damo-cv/transreid/llms.txt Creates a combined loss function for metric learning, integrating cross-entropy (with optional label smoothing) and triplet loss. Supports both JPM models returning lists of scores/features and standard models returning single tensors. ```python from loss import make_loss from config import cfg cfg.merge_from_file('configs/Market/vit_transreid_stride.yml') cfg.freeze() # Create loss function and center loss criterion loss_func, center_criterion = make_loss(cfg, num_classes=751) ``` ```python # During training with JPM model (returns lists) scores = [cls_score, cls_score_1, cls_score_2, cls_score_3, cls_score_4] feats = [global_feat, local_feat_1, local_feat_2, local_feat_3, local_feat_4] targets = torch.randint(0, 751, (64,)).cuda() cam_labels = torch.randint(0, 6, (64,)).cuda() # Compute combined ID loss + triplet loss loss = loss_func(scores, feats, targets, cam_labels) # ID_LOSS = 0.5 * avg(local_scores) + 0.5 * global_score # TRI_LOSS = 0.5 * avg(local_triplet) + 0.5 * global_triplet # total = ID_LOSS_WEIGHT * ID_LOSS + TRIPLET_LOSS_WEIGHT * TRI_LOSS ``` ```python # For standard model (single tensors) score = torch.randn(64, 751).cuda() feat = torch.randn(64, 768).cuda() loss = loss_func(score, feat, targets, cam_labels) ``` ```python print(f"Combined loss: {loss.item():.4f}") ``` -------------------------------- ### Model Forward Pass (Training) Source: https://context7.com/damo-cv/transreid/llms.txt Performs a forward pass of the TransReID model in training mode. This returns classification scores and features, which are used for loss computation. Ensure images, targets, and labels are on the correct device (e.g., CUDA). ```python # Model forward pass (training mode) # Returns (cls_scores, features) for loss computation images = torch.randn(64, 3, 256, 128).cuda() targets = torch.randint(0, 751, (64,)).cuda() cam_labels = torch.randint(0, 6, (64,)).cuda() view_labels = torch.zeros(64, dtype=torch.long).cuda() model.train() scores, feats = model(images, targets, cam_label=cam_labels, view_label=view_labels) # scores: list of [cls_score, cls_score_1, ..., cls_score_4] for JPM # feats: list of [global_feat, local_feat_1, ..., local_feat_4] ``` -------------------------------- ### Model Forward Pass (Inference) Source: https://context7.com/damo-cv/transreid/llms.txt Performs a forward pass of the TransReID model in inference mode. This returns concatenated features suitable for retrieval. Ensure the model is in evaluation mode and gradients are disabled. ```python # Model forward pass (inference mode) # Returns concatenated features for retrieval model.eval() with torch.no_grad(): features = model(images, cam_label=cam_labels, view_label=view_labels) # features shape: [64, 768*5] for JPM (global + 4 local features) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.