Descriptor Vector Exchange

Related tags

Testing DVE
Overview

Descriptor Vector Exchange

This repo provides code for learning dense landmarks without supervision. Our approach is described in the ICCV 2019 paper "Unsupervised learning of landmarks by exchanging descriptor vectors".

DVE diagram

High level Overview: The goal of this work is to learn a dense embedding Φu(x) ∈ RC of image pixels without annotation. Our starting point was the Dense Equivariant Labelling approach of [3] (references follow at the end of the README), which similarly tackles the same problem, but is restricted to learning low-dimensional embeddings to achieve the key objective of generalisation across different identities. The key focus of Descriptor Vector Exchange (DVE) is to address this dimensionality issue to enable the learning of more powerful, higher dimensional embeddings while still preserving their generalisation ability. To do so, we take inspiration from methods which enforce transitive/cyclic consistency constraints [4, 5, 6].

The embedding is learned from pairs of images (x,x′) related by a known warp v = g(u). In the image above, on the left we show the approach used by [3], which directly matches embedding Φu(x) from the left image to embeddings Φv(x′) in the right image to generate a loss. On the right, DVE replaces Φu(x) with its reconstruction Φˆu(x|xα) obtained from the embeddings in a third auxiliary image xα (the correspondence with xα does not need to be known). This mechanism encourages the embeddings to act consistently across different instances, even when the dimensionality is increased (see the paper for more details).

Requirements: The code assumes PyTorch 1.1 and Python 3.6/3.7 (other versions may work, but have not been tested). See the section on dependencies towards the end of this file for specific package requirements.

Learned Embeddings

We provide pretrained models for each dataset to reproduce the results reported in the paper [1]. The training is performed with CelebA, a dataset of over 200k faces of celebrities that was originally described in this paper. We use this dataset to train our embedding function without annotations.

Each model is accompanied by training and evaluation logs and its mean pixel error performance on the task of matching annotated landmarks across the MAFL test set (described in more detail below). We use two architectures: the smallnet model of [3] and the more powerful hourglass model, inspired by its effectiveness in [7].

The goal of these initial experiments is to demonstrate that DVE allows models to generalise across identities even when using higher dimensional embeddings (e.g. 64d rather than 3d). By contrast, this does not occur when DVE is removed (see the ablation section below).

Embed. Dim Model Same Identity Different Identity Params Links
3 smallnet 1.36 3.03 334.9k config, model, log
16 smallnet 1.28 2.79 338.2k config, model, log
32 smallnet 1.29 2.79 342.3k config, model, log
64 smallnet 1.28 2.77 350.6k config, model, log
64 hourglass 0.93 2.37 12.6M config, model, log

Notes: The error metrics for the hourglass model, which are included for completeness, are approximately (but are not exactly) comparable to the metrics for the smallnet due to very slight differences in the cropping ratios used by the two architectures (0.3 for smallnet, 0.294 for Hourglass).

Landmark Regression

Protocol Description: To transform the learned dense embeddings into landmark predictions, we use the same approach as [3]. For each target dataset, we freeze the dense embeddings and learn to peg onto them a collection of 50 "virtual" keypoints via a spatial softmax. These virtual keypoints are then used to regress the target keypoints of the dataset. We report the error as a percentage of inter-ocular distance (a metric defined by the landmarks of each dataset).

MAFL landmark regression

MAFL is a dataset of 20k faces which includes landmark annotations. The dataset is partitioned into 19k training images and 1k testing images.

Embed. Dim Model Error (%IOD) Links
3 smallnet 4.17 config, model, log
16 smallnet 3.97 config, model, log
32 smallnet 3.82 config, model, log
64 smallnet 3.42 config, model, log
64 hourglass 2.86 config, model, log

300-W landmark regression

The 300-W This dataset contains 3,148 training images and 689 testing images with 68 facial landmark annotations for each face (with the split introduced this this CVPR 2014 paper). The dataset is described in this 2013 ICCV workshop paper.

Embed. Dim Model Error (%IOD) Links
3 smallnet 7.66 config, model, log
16 smallnet 6.29 config, model, log
32 smallnet 6.13 config, model, log
64 smallnet 5.75 config, model, log
64 hourglass 4.65 config, model, log

AFLW landmark regression

The original AFLW contains around 25k images with up to 21 landmarks. For the purposes of evaluating five-landmark detectors, the authors of TCDCN introduced a test subset of almost 3K faces (for convenience, we include a mirror version of these images, but you can obtain the originals here)

There are two slightly different partitions of AFLW that have been used in prior work (we report numbers on both to allow for comparison). One is a set of recropped faces released by [7] (2991 test faces with 132 duplicates, 10122 train faces) (here we call this AFLWR). The second is the train/test partition of AFLW used in the works of [2,3] which used the existing crops from MTFL (2995 faces) for testing and 10122 AFLW faces for training (we call this dataset split AFLWM).

Additionally, in the tables immediately below, each embedding is further fine-tuned on the AFLWR/AFLWM training sets (without annotations), as was done in [2], [3], [7], [8]. The rationale for this is that (i) it does not require any additional superviserion; (ii) it allows the model to adjust for the differences in the face crops provided by the detector. To give an idea of how sensitive the method is to this step, we also report performance without finetuning in the ablation studies below.

AFLWR landmark regression

Embed. Dim Model Error (%IOD) Links
3 smallnet 10.13 config, model, log
16 smallnet 8.40 config, model, log
32 smallnet 8.18 config, model, log
64 smallnet 7.79 config, model, log
64 hourglass 6.54 config, model, log

AFLWM landmark regression

AFLWMis a dataset of faces which also includes landmark annotations. We use the P = 5 landmark test split (10,122 training images and 2,991 test images). The dataset can be obtained here and is described in this 2011 ICCV workshop paper.

Embed. Dim Model Error (%IOD) Links
3 smallnet 11.12 config, model, log
16 smallnet 9.15 config, model, log
32 smallnet 9.17 config, model, log
64 smallnet 8.60 config, model, log
64 hourglass 7.53 config, model, log

Ablation Studies

We can study the effect of the DVE method by removing it during training and assessing the resulting embeddings for landmark regression. The ablations are performed on the lighter SmallNet model.

Embed. Dim Model DVE Same Identity Different Identity Links
3 smallnet ✖️ / ✔️ 1.33 / 1.36 2.89 / 3.03 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 1.25 / 1.28 5.65 / 2.79 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 1.26 / 1.29 5.81 / 2.79 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 1.25 / 1.28 5.68 / 2.77 (config, model, log) / (config, model, log)

We see that without DVE, the learned embedding performs reasonably when the dimensionality is restricted to 3d. However, when we seek to learn higher dimensionality embeddings without DVE, they lose their ability to match across different identities. This inability to generalise at higher dimensions is similarly reflected when the embeddings are used to regress landmarks:

DVE Ablation: MAFL landmark regression

Embed. Dim Model DVE Error (%IOD) Links
3 smallnet ✖️ / ✔️ 4.02/4.17 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 5.31/3.97 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 5.36/3.82 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 4.99/3.42 (config, model, log) / (config, model, log)

DVE Ablation: 300w landmark regression

Embed. Dim Model DVE Error (%IOD) Links
3 smallnet ✖️ / ✔️ 8.23/7.66 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 10.66/6.29 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 10.33/6.13 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 9.33/5.75 (config, model, log) / (config, model, log)

DVE Ablation: AFLWM landmark regression

Embed. Dim Model DVE Error (%IOD) Links
3 smallnet ✖️ / ✔️ 10.99/11.12 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 12.22/9.15 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 12.60/9.17 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 12.92/8.60 (config, model, log) / (config, model, log)

DVE Ablation: AFLWR landmark regression

Embed. Dim Model DVE Error (%IOD) Links
3 smallnet ✖️ / ✔️ 10.14/10.13 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 10.73/8.40 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 11.05/8.18 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 11.43/7.79 (config, model, log) / (config, model, log)

Next we investigate how sensitive our approach is to finetuning on the target dataset (this is done for the AFLWR and AFLWM landmark regressions). We do two sets of experiments. First we, remove the finetuning for both the AFLW dataset variants and re-evaluate on the landmark regression tasks. Second, we add in a finetuning step for a different dataset, 300w, to see how the method is affected on a different benchmark. Note that all models for these experiments use DVE, and the finetuning consists of training the embeddings for an additional 50 epochs without annotations. We see that for the AFLW datasets, it makes a reasonable difference to performance. However, for 300w, particularly for stronger models, it adds little benefit (for this reason we do not use finetuning on 300w for the results reported in the paper).

Finetuning Ablation: AFLWM landmark regression

Embed. Dim Model Finetune Error (%IOD) Links
3 smallnet ✖️ / ✔️ 11.82/11.12 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 10.22/9.15 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 9.80/9.17 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 9.28/8.60 (config, model, log) / (config, model, log)
64 hourglass ✖️ / ✔️ 8.15/7.53 (config, model, log) / (config, model, log)

Finetuning Ablation: AFLWR landmark regression

Embed. Dim Model Finetune Error (%IOD) Links
3 smallnet ✖️ / ✔️ 9.65/10.13 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 8.91/8.40 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 8.73/8.18 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 8.14/7.79 (config, model, log) / (config, model, log)
64 hourglass ✖️ / ✔️ 6.88/6.54 (config, model, log) / (config, model, log)

Finetuning Ablation: 300w landmark regression

Embed. Dim Model Finetune Error (%IOD) Links
3 smallnet ✖️ / ✔️ 7.66/7.20 (config, model, log) / (config, model, log)
16 smallnet ✖️ / ✔️ 6.29/5.90 (config, model, log) / (config, model, log)
32 smallnet ✖️ / ✔️ 6.13/5.75 (config, model, log) / (config, model, log)
64 smallnet ✖️ / ✔️ 5.75/5.58 (config, model, log) / (config, model, log)
64 hourglass ✖️ / ✔️ 4.65/4.65 (config, model, log) / (config, model, log)

To enable the finetuning experiments to be reproduced, the training logs for each of the three datasets are provided below, together with their performance on the matching task.

Finetuning on AFLWM

Embed. Dim Model Same Identity Different Identity Links
3 smallnet 5.99 7.16 config, model, log
16 smallnet 4.72 7.11 config, model, log
32 smallnet 6.42 8.71 config, model, log
64 smallnet 8.07 10.09 config, model, log
64 hourglass 1.53 3.65 config, model, log

Finetuning on AFLWR

Embed. Dim Model Same Identity Different Identity Links
3 smallnet 6.36 7.69 config, model, log
16 smallnet 6.34 8.62 config, model, log
32 smallnet 8.10 10.11 config, model, log
64 smallnet 4.08 5.21 config, model, log
64 hourglass 1.17 4.04 config, model, log

Finetuning on 300w

Embed. Dim Model Same Identity Different Identity Links
3 smallnet 5.21 6.51 config, model, log
16 smallnet 5.55 7.30 config, model, log
32 smallnet 5.85 7.47 config, model, log
64 smallnet 6.58 8.19 config, model, log
64 hourglass 1.63 3.82 config, model, log

Annotation Ablation: AFLWM landmark regression with limited labels

We perform a final ablation to investigate how well the regressors are able to perform when their access to annotation is further reduced, and they are simply provided with a few images. The results, shown below, are reported as mean/std over three runs (because when there is only a single annotation, the performance is quite sensitive to which particular annotation is selected). Particularly for the stronger models, reasonable performance can be obtained with a small number of annotated images.

Embed. Dim Model DVE Num annos. Error (%IOD) Links
3 smallnet 1 ✖️ 19.87 (+/- 3.10) config, model, log
3 smallnet 5 ✖️ 16.90 (+/- 1.04) config, model, log
3 smallnet 10 ✖️ 16.12 (+/- 1.07) config, model, log
3 smallnet 20 ✖️ 15.30 (+/- 0.59) config, model, log
64 smallnet 1 ✔️ 17.13 (+/- 1.78) config, model, log
64 smallnet 5 ✔️ 13.57 (+/- 2.08) config, model, log
64 smallnet 10 ✔️ 12.97 (+/- 2.36) config, model, log
64 smallnet 20 ✔️ 11.26 (+/- 0.93) config, model, log
64 hourglass 1 ✔️ 14.23 (+/- 1.54) config, model, log
64 hourglass 5 ✔️ 12.04 (+/- 2.03) config, model, log
64 hourglass 10 ✔️ 12.25 (+/- 2.42) config, model, log
64 hourglass 20 ✔️ 11.46 (+/- 0.83) config, model, log

Dataset mirrors

For each dataset used in the paper, we provide a preprocessed copy to allow the results described above to be reproduced directly. These can be downloaded and unpacked with a utility script, which will store them in the locations expected by the training code. Each dataset has a brief README, which also provides the citations for use with each dataset, together with a link from which it can be downloaded directly.

Dataset Details and links Archive size sha1sum
CelebA (+ MAFL) README 9.0 GiB f6872ab0f2df8e5843abe99dc6d6100dd4fea29f
300w README 3.0 GiB 885b09159c61fa29998437747d589c65cfc4ccd3
AFLWM README 252 MiB 1ff31c07cef4f2777b416d896a65f6c17d8ae2ee
AFLWR README 1.1 GiB 939fdce0e6262a14159832c71d4f84a9d516de5e

Additional Notes

In the codebase AFLW<sub>R</sub> is simply referred to as AFLW, while AFLW<sub>M</sub> is referred to as AFLW-MTFL. For 300w, we compute the inter-ocular distance according to the definition given by the dataset organizers here. Some of the logs are generated from existing logfiles that were created with a slightly older version of the codebase (these differences only affect the log format, rather than the training code itself - the log generator can be found here.)

Evaluating a pretrained embedding

Evaluting a pretrained model for a given dataset requires:

  1. The target dataset, which should be located in <root>/data/<dataset-name> (this will be done automatically by the data fetching script, or can be done manually).
  2. A config.json file.
  3. A checkpoint.pth file.

Evaluation is then performed with the following command:

python3 test_matching.py --config <path-to-config.json> --resume <path-to-trained_model.pth> --device <gpu-id>

where <gpu-id> is the index of the GPU to evaluate on. This option can be ommitted to run the evaluation on the CPU.

For example, to reproduce the smallnet-32d-dve results described above, run the following sequence of commands:

# fetch the mafl dataset (contained with celeba) 
python misc/sync_datasets.py --dataset celeba

# find the name of a pretrained model using the links in the tables above 
export MODEL=data/models/celeba-smallnet-32d-dve/2019-08-02_06-19-59/checkpoint-epoch100.pth

# create a local directory and download the model into it 
mkdir -p $(dirname "${MODEL}")
wget --output-document="${MODEL}" "http://www.robots.ox.ac.uk/~vgg/research/DVE/${MODEL}"

# Evaluate the model
python3 test_matching.py --config configs/celeba/smallnet-32d-dve.json --resume ${MODEL} --device 0

Regressing landmarks

Learning a landmark regressor for a given pretrained embedding requires:

  1. The target dataset, which should be located in <root>/data/<dataset-name> (this will be done automatically by the data fetching script, or can be done manually).
  2. A config.json file.
  3. A checkpoint.pth file.

See the regressor code for details of how the regressor is implemented (it consists of a conv, then a spatial softmax, then a group conv).

Landmark learning is then performed with the following command:

python3 train.py --config <path-to-config.json> --resume <path-to-trained_model.pth> --device <gpu-id>

where <gpu-id> is the index of the GPU to evaluate on. This option can be ommitted to run the evaluation on the CPU.

For example, to reproduce the smallnet-32d-dve landmark regression results described above, run the following sequence of commands:

# fetch the mafl dataset (contained with celeba) 
python misc/sync_datasets.py --dataset celeba

# find the name of a pretrained model using the links in the tables above 
export MODEL=data/models/celeba-smallnet-32d-dve/2019-08-08_17-56-24/checkpoint-epoch100.pth

# create a local directory and download the model into it 
mkdir -p $(dirname "${MODEL}")
wget --output-document="${MODEL}" "http://www.robots.ox.ac.uk/~vgg/research/DVE/${MODEL}"

# Evaluate the features by training a keypoint regressor 
python3 train.py --config configs/aflw-keypoints/celeba-smallnet-32d-dve.json --device 0

Learning new embeddings

Learning a new embedding requires:

  1. The dataset used for training, which should be located in <root>/data/<dataset-name> (this will be done automatically by the data fetching script, or can be done manually).
  2. A config.json file. You can define your own, or use one of the provided configs in the configs directory.

Training is then performed with the following command:

python3 train.py --config <path-to-config.json> --device <gpu-id>

where <gpu-id> is the index of the GPU to train on. This option can be ommitted to run the training on the CPU.

For example, to train a 16d-dve embedding on celeba, run the following sequence of commands:

# fetch the celeba dataset 
python misc/sync_datasets.py --dataset celeba

# Train the model
python3 train.py --config configs/celeba/smallnet-16d-dve.json --device 0

Dependencies

If you have enough disk space, the recommended approach to installing the dependencies for this project is to create a conda enviroment via the requirements/conda-freeze.txt:

conda env create -f requirements/conda-freeze.yml

Otherwise, if you'd prefer to take a leaner approach, you can either:

  1. pip/conda install each missing package each time you hit an ImportError
  2. manually inspect the slightly more readable requirements/pip-requirements.txt

Citation

If you find this code useful, please consider citing:

@inproceedings{Thewlis2019a,
  author    = {Thewlis, J. and Albanie, S. and Bilen, H. and Vedaldi, A.},
  booktitle = {International Conference on Computer Vision},
  title     = {Unsupervised learning of landmarks by exchanging descriptor vectors},
  date      = {2019},
}

Related useful codebases

Some other codebases you might like to check out if you are interested in self-supervised learning of object structure.

Acknowledgements

We would like to thank Almut Sophia Koepke for helpful discussions. The project structure uses the pytorch-template by @victoresque.

References

[1] James Thewlis, Samuel Albanie, Hakan Bilen, and Andrea Vedaldi. "Unsupervised learning of landmarks by exchanging descriptor vectors" ICCV 2019.

[2] James Thewlis, Hakan Bilen and Andrea Vedaldi, "Unsupervised learning of object landmarks by factorized spatial embeddings." ICCV 2017.

[3] James Thewlis, Hakan Bilen and Andrea Vedaldi, "Unsupervised learning of object frames by dense equivariant image labelling." NeurIPS 2017

[4] Sundaram, N., Brox, T., & Keutzer, K. "Dense point trajectories by GPU-accelerated large displacement optical flow", ECCV 2010

[5] C. Zach, M. Klopschitz, and M. Pollefeys. "Disambiguating visual relations using loop constraints", CVPR, 2010

[6] Zhou, T., Jae Lee, Y., Yu, S. X., & Efros, A. A. "Flowweb: Joint image set alignment by weaving consistent, pixel-wise correspondences". CVPR 2015.

[7] Zhang, Yuting, Yijie Guo, Yixin Jin, Yijun Luo, Zhiyuan He, and Honglak Lee. "Unsupervised discovery of object landmarks as structural representations.", CVPR 2018

[8] Jakab, T., Gupta, A., Bilen, H., & Vedaldi, A. Unsupervised learning of object landmarks through conditional image generation, NeurIPS 2018

[9] Olivia Wiles, A. Sophia Koepke and Andrew Zisserman. "Self-supervised learning of a facial attribute embedding from video" , BMVC 2018

Comments
  • Smaller image is used during landmark regression on MAFL?

    Smaller image is used during landmark regression on MAFL?

    https://github.com/jamt9000/DVE/blob/208514419dd1eb0d27ce60876ca836d1ab8c4f4a/data_loader/data_loaders.py#L178

    It seems that during unsupervised learning, the images are not cropped, while during landmark regression on MAFL (or other datasets), they are cropped by self.crop. Is that right? If yes, any reasons behind this?

    Thanks for sharing the codes! It is really useful!

    opened by ZezhouCheng 4
  • Question on keypoint computation

    Question on keypoint computation

    Sharing a question received by email:

    Thanks for sharing your DVE codes. I found the new keypoints computed in your code is somehow counter-intuitive. Could you kindly explain: Why you construct a KD tree with the warped grid instead of the regular one?

    This is a link to the questioned line in your code https://github.com/jamt9000/DVE/blob/208514419dd1eb0d27ce60876ca836d1ab8c4f4a/utils/tps.py#L164

    opened by jamt9000 3
  • Error 404 when trying to download pretrained model files

    Error 404 when trying to download pretrained model files

    http://www.robots.ox.ac.uk/~vgg/research/DVE/data/models/celeba-smallnet-3d-dve/2019-08-08_17-54-21/model_best.pth

    "The requested URL /~vgg/research/DVE/data/models/celeba-smallnet-3d-dve/2019-08-08_17-54-21/model_best.pth was not found on this server."

    opened by schuhschuh 3
  • Evaluation fails when training terminates before max epoch set in config

    Evaluation fails when training terminates before max epoch set in config

    I've trained the SmallNet with 3D descriptors using the config file linked from the README.

    For me, the training terminated already after 70 epochs instead of 100:

    Running validation for epoch 71
    validation epoch took 00h00m13s
        epoch          : 71
        loss           : 1.8158737950681234
        val_loss       : 1.765822774887085
    Val performance didn't improve for 10 epochs. Training stops.
    

    This resulted in the following error when the train.py script attempted to load the checkpoint for epoch 100 (value from config file) for the mini-evaluation:

    Loading checkpoint: saved/models/celeba-smallnet-3d-dve-2019-08-08_17-54-21/2019-09-18_17-09-50/checkpoint-epoch100.pth ...
    Traceback (most recent call last):
      File "train.py", line 241, in <module>
        main(config, args.resume)
      File "train.py", line 176, in main
        evaluation(config, logger=logger)
      File "/data/aschuh/source/dve/test_matching.py", line 171, in evaluation
        checkpoint = torch.load(ckpt_path)
      File "/data/aschuh/tools/pyenv/versions/dve/lib/python3.6/site-packages/torch/serialization.py", line 384, in load
        f = f.open('rb')
      File "/data/aschuh/tools/pyenv/versions/3.6.9/lib/python3.6/pathlib.py", line 1183, in open
        opener=self._opener)
      File "/data/aschuh/tools/pyenv/versions/3.6.9/lib/python3.6/pathlib.py", line 1037, in _opener
        return self._accessor.open(self, flags, mode)
      File "/data/aschuh/tools/pyenv/versions/3.6.9/lib/python3.6/pathlib.py", line 387, in wrapped
        return strfunc(str(pathobj), *args)
    FileNotFoundError: [Errno 2] No such file or directory: 'saved/models/celeba-smallnet-3d-dve-2019-08-08_17-54-21/2019-09-18_17-09-50/check
    point-epoch100.pth'
    

    The BaseTrainer should probably store the last epoch (or change self.epochs) in this case (cf. https://github.com/jamt9000/DVE/blob/e6e0cdba29d7ce43c151028d8016cc92cb7660a3/base/base_trainer.py#L139) and that value be used in train.py at https://github.com/jamt9000/DVE/blob/e6e0cdba29d7ce43c151028d8016cc92cb7660a3/train.py#L173 instead of the value from the config file.

    opened by schuhschuh 2
  • AttributeError: 'CelebAPrunedAligned_MAFLVal' object has no attribute 'use_ims'

    AttributeError: 'CelebAPrunedAligned_MAFLVal' object has no attribute 'use_ims'

    When trying to train a SmallNet on the celeba dataset using the configuration file http://www.robots.ox.ac.uk/~vgg/research/DVE/data/models/celeba-smallnet-3d-dve/2019-08-08_17-54-21/config.json, I get the following error.

    Loss args OrderedDict([('normalize_vectors', False)])
    Traceback (most recent call last):
      File "train.py", line 241, in <module>
        main(config, args.resume)
      File "train.py", line 169, in main
        trainer.train()
      File "/data/aschuh/source/dve/base/base_trainer.py", line 86, in train
        result = self._train_epoch(epoch)
      File "/data/aschuh/source/dve/trainer/trainer.py", line 191, in _train_epoch
        for batch_idx, batch in enumerate(self.data_loader):
      File "/data/aschuh/tools/pyenv/versions/dve/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in __next__
        return self._process_data(data)
      File "/data/aschuh/tools/pyenv/versions/dve/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
        data.reraise()
      File "/data/aschuh/tools/pyenv/versions/dve/lib/python3.6/site-packages/torch/_utils.py", line 369, in reraise
        raise self.exc_type(msg)
    AttributeError: Caught AttributeError in DataLoader worker process 0.
    Original Traceback (most recent call last):
      File "/data/aschuh/tools/pyenv/versions/dve/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
        data = fetcher.fetch(index)
      File "/data/aschuh/tools/pyenv/versions/dve/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
        data = [self.dataset[idx] for idx in possibly_batched_index]
      File "/data/aschuh/tools/pyenv/versions/dve/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
        data = [self.dataset[idx] for idx in possibly_batched_index]
      File "/data/aschuh/source/dve/data_loader/data_loaders.py", line 105, in __getitem__
        if (not self.use_ims and not self.use_keypoints):
    AttributeError: 'CelebAPrunedAligned_MAFLVal' object has no attribute 'use_ims'
    
    opened by schuhschuh 2
  • May I know how to sample the pixels which are used in the loss function?

    May I know how to sample the pixels which are used in the loss function?

    Hi @jamt9000, Thanks for the great work. I have one question about the implementation for pixel sampling. How to sample pixels from the original images, which will be used in the loss function? I am not quite understand these two lines of code in the implementation: image Could you please give some explanation about the function random_tps_weights()? What does 'weights1' represent and also the multiplication between 'self.F' and 'weights1'

    opened by chaneyddtt 0
  • Animal Datasets

    Animal Datasets

    Hello. I'm very impressed with this work.

    I found the experiment with human and animal face datasets on the paper. I wonder if you have any plan to release preprocessed dataset like other human face dataset. Thank you :)

    image

    opened by kingsj0405 0
Owner
James Thewlis
CTO @ Unitary
James Thewlis
This is an differentiable pytorch implementation of SIFT patch descriptor.

This is an differentiable pytorch implementation of SIFT patch descriptor. It is very slow for describing one patch, but quite fast for batch. It can

Dmytro Mishkin 150 Dec 24, 2022
Line as a Visual Sentence: Context-aware Line Descriptor for Visual Localization

Line as a Visual Sentence with LineTR This repository contains the inference code, pretrained model, and demo scripts of the following paper. It suppo

SungHo Yoon 158 Dec 27, 2022
PyTorch implementation of SIFT descriptor

This is an differentiable pytorch implementation of SIFT patch descriptor. It is very slow for describing one patch, but quite fast for batch. It can

Dmytro Mishkin 150 Dec 24, 2022
Implementation of the method proposed in the paper "Neural Descriptor Fields: SE(3)-Equivariant Object Representations for Manipulation"

Neural Descriptor Fields (NDF) PyTorch implementation for training continuous 3D neural fields to represent dense correspondence across objects, and u

null 167 Jan 6, 2023
Open source implementation of "A Self-Supervised Descriptor for Image Copy Detection" (SSCD).

A Self-Supervised Descriptor for Image Copy Detection (SSCD) This is the open-source codebase for "A Self-Supervised Descriptor for Image Copy Detecti

Meta Research 68 Jan 4, 2023
Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io

forex-python Forex Python is a Free Foreign exchange rates and currency conversion. Note: Install latest forex-python==1.1 to avoid RatesNotAvailableE

MicroPyramid 540 Jan 5, 2023
Python money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution.

Python Money Money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution. This is version 1.4.0-dev. De

Carlos Palol 214 Dec 22, 2022
FLEX (Federated Learning EXchange,FLEX) protocol is a set of standardized federal learning agreements designed by Tongdun AI Research Group。

Click to view Chinese version FLEX (Federated Learning Exchange) protocol is a set of standardized federal learning agreements designed by Tongdun AI

同盾科技 50 Nov 29, 2022
Upbit(업비트) Cryptocurrency Exchange OPEN API Client for Python

Base Repository Python Upbit Client Repository Upbit OPEN API Client @Author: uJhin @GitHub: https://github.com/uJhin/upbit-client/ @Officia

Yu Jhin 37 Nov 6, 2022
CVE-2021-26855 SSRF Exchange Server

CVE-2021-26855 Brute Force EMail Exchange Server Timeline: Monday, March 8, 2021: Update Dumping content...(I'm not done, can u guy help me done this

lulz 117 Nov 28, 2022
Microsoft Exchange Server SSRF漏洞(CVE-2021-26855)

Microsoft_Exchange_Server_SSRF_CVE-2021-26855 zoomeye dork:app:"Microsoft Exchange Server" 使用Seebug工具箱及pocsuite3编写的脚本Microsoft_Exchange_Server_SSRF_CV

conjojo 37 Nov 12, 2022
exchange-ssrf-rce

Usage python3 .\exchange-exp.py -------------------------------------------------------------------------------- |

Jen 76 Nov 9, 2022
ProxyLogon(CVE-2021-26855+CVE-2021-27065) Exchange Server RCE(SSRF->GetWebShell)

ProxyLogon For Python3 ProxyLogon(CVE-2021-26855+CVE-2021-27065) Exchange Server RCE(SSRF->GetWebShell) usage: python ProxyLogon.py --host=exchang

null 112 Dec 1, 2022
Text-to-SQL in the Wild: A Naturally-Occurring Dataset Based on Stack Exchange Data

SEDE SEDE (Stack Exchange Data Explorer) is new dataset for Text-to-SQL tasks with more than 12,000 SQL queries and their natural language description

Rupert. 83 Nov 11, 2022
Nasdaq Cloud Data Service (NCDS) provides a modern and efficient method of delivery for realtime exchange data and other financial information. This repository provides an SDK for developing applications to access the NCDS.

Nasdaq Cloud Data Service (NCDS) Nasdaq Cloud Data Service (NCDS) provides a modern and efficient method of delivery for realtime exchange data and ot

Nasdaq 8 Dec 1, 2022
Andrei 1.4k Dec 24, 2022
ProxyShell POC Exploit : Exchange Server RCE (ACL Bypass + EoP + Arbitrary File Write)

ProxyShell Install git clone https://github.com/ktecv2000/ProxyShell cd ProxyShell virtualenv -p $(which python3) venv source venv/bin/activate pip3 i

Poming huang 312 Dec 9, 2022
Some Attacks of Exchange SSRF ProxyLogon&ProxyShell

Some Attacks of Exchange SSRF This project is heavily replicated in ProxyShell, NtlmRelayToEWS https://mp.weixin.qq.com/s/GFcEKA48bPWsezNdVcrWag Get 1

Jumbo 129 Dec 30, 2022
Leveraged grid-trading bot using CCXT/CCXT Pro library in FTX exchange.

Leveraged-grid-trading-bot The code is designed to perform infinity grid trading strategy in FTX exchange. The basic trader named Gridtrader.py contro

Hao-Liang Wen 25 Oct 7, 2021