Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Refactor instance retrieval optional normalization #381

Closed
wants to merge 4 commits into from

Conversation

iseessel
Copy link
Contributor

Differential Revision: D30002757

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Jul 30, 2021
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D30002757

iseessel added a commit to iseessel/vissl that referenced this pull request Aug 2, 2021
)

Summary:
Pull Request resolved: facebookresearch#381

1. Rename SHOULD_TRAIN_PCA_OR_WHITENING to TRAIN_PCA_WHITENING

2. Make l2 normalization optional.

3. Fix cfg access bugs

4. Add some more experiments.

Differential Revision: D30002757

fbshipit-source-id: 2e76f31836150df40e9d7b7983cc6bf7808162b8
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D30002757

Summary:
Pull Request resolved: facebookresearch#380

Various Instance Retrieval improvements:
1. Add support for Manifold

2. Cleanup noisy logs and add helpful logging.

3. Add DEBUG_MODE support for the Revisited Datasets.

4. Add ability to save results/logs/features.

5. Fix ROI crop bug.

6. Fix typo in benchmark_workflow.py causing benchmarks to fail.
7. Add a bunch of json configs to track and group multiple experiments.

Differential Revision: D29995282

fbshipit-source-id: 88f243632544f110235371dc410bcb5aef691fd1
…ch#379)

Summary:
Pull Request resolved: facebookresearch#379

1. Fix the gem post processing logic.

Before this change, the code assumes that each non-preprocessed feature tensor has the same tensor shape:

```
    if cfg.IMG_RETRIEVAL.FEATS_PROCESSING_TYPE == "gem":
        gem_out_fname = f"{out_dir}/{train_dataset_name}_GeM.npy"
        train_features = torch.tensor(np.concatenate(train_features))
```

This is not the case, since ROxford/RParis images do not have a standard size, hence the resx layers have different height and widths (but same number of channels). GeM pooling will transform an image of any shape to a shape of `(num_channels)`

The change performs gem_pooling on each individual images, as opposed to all the images at once. This should be fine because both gem and l2 normalization are to be performed per-image.

2. Transform before cropping to the bounding box (as opposed to after cropping).

The experiments show that this yields much better results. This is also what the deepcluster implentation uses: https://github.com/facebookresearch/deepcluster/blob/master/eval_retrieval.py#L44

```
Oxford: 61.57 / 41.74 / 14.33 vs. 69.65 / 48.51 / 16.41
Paris: 83.7 / 66.87 / 44.81 vs. 87.9 / 70.57 / 47.39
```
f288434289
f288438150

Differential Revision: D29993204

fbshipit-source-id: d6d02b6b96d59b43a00a1d1e99f34c03ee8a85b2
Summary:
Pull Request resolved: facebookresearch#378

Revisited oxford and paris provide bounding boxes for the queries of the landmarks, that they suggest to use in the evaluation. Weirdly enough, the bounding boxes actually degrade performance for my experiments. Hence, putitng an option to make the bounding boxes optional.

Differential Revision: D29993208

fbshipit-source-id: 3a7a0d91b0521035d71bdd057d7c54a80582cbec
)

Summary:
Pull Request resolved: facebookresearch#381

1. Rename SHOULD_TRAIN_PCA_OR_WHITENING to TRAIN_PCA_WHITENING

2. Make l2 normalization optional.

3. Fix cfg access bugs

4. Add some more experiments.

Reviewed By: prigoyal

Differential Revision: D30002757

fbshipit-source-id: a0aaf8ac17fc9044ec427ee14a4b39ee4ca92a7b
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D30002757

iseessel added a commit to iseessel/vissl that referenced this pull request Aug 9, 2021
)

Summary:
Pull Request resolved: facebookresearch#381

1. Rename SHOULD_TRAIN_PCA_OR_WHITENING to TRAIN_PCA_WHITENING

2. Make l2 normalization optional.

3. Fix cfg access bugs

4. Add some more experiments.

Differential Revision: D30002757

fbshipit-source-id: dd6e33aa5da0a95812ae3e0e21b11c2102e88957
iseessel added a commit to iseessel/vissl that referenced this pull request Aug 9, 2021
)

Summary:
Pull Request resolved: facebookresearch#381

1. Rename SHOULD_TRAIN_PCA_OR_WHITENING to TRAIN_PCA_WHITENING

2. Make l2 normalization optional.

3. Fix cfg access bugs

4. Add some more experiments.

Differential Revision: D30002757

fbshipit-source-id: 6025a6ec97a0ca317b3a07eb61e251b701b1945a
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in db63a8f.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants