This module contains all the code for extracting features and comparing features from SimCLR and SIFT models.


sift_frame_sim(features_i, features_j, codebook, df, vw)


simclr_frame_sim(features_i, features_j, codebook, df, vw)

class SimCLRDataset[source]

SimCLRDataset(dataset) :: Dataset

An abstract class representing a :class:Dataset.

All datasets that represent a map from keys to data samples should subclass it. All subclasses should overwrite :meth:__getitem__, supporting fetching a data sample for a given key. Subclasses could also optionally overwrite :meth:__len__, which is expected to return the size of the dataset by many implementations and the default options of

.. note:: by default constructs a index sampler that yields integral indices. To make it work with a map-style dataset with non-integral indices/keys, a custom sampler must be provided.




get_train_transforms(size=224, color_jitter_prob=0.8, grayscale_prob=0.2)



class NTXEntCriterion[source]

NTXEntCriterion(temperature=0.5) :: Module

Normalized, temperature-scaled cross-entropy criterion, as suggested in the SimCLR paper.

Parameters: temperature (float, optional): temperature to scale the confidences. Defaults to 0.5.

class SimCLRModel[source]

SimCLRModel(model_name='resnet18', pretrained=True, projection_dim=64, temperature=0.5, batch_size=128, image_size=224, save_hparams=True) :: LightningModule

SimCLR training network for a generic torchvision model (restricted to allowed_models).