Unverified Commit 04af8d35 authored by Dan Anghel's avatar Dan Anghel Committed by GitHub
Browse files

README update for DELF training with autoencoder (#9607)



* Merged commit includes the following changes:
326369548  by Andre Araujo:

    Fix import issues.

--
326159826  by Andre Araujo:

    Changed the implementation of the cosine weights from Keras layer to tf.Variable to manually control for L2 normalization.

--
326139082  by Andre Araujo:

    Support local feature matching using ratio test.

    To allow for easily choosing which matching type to use, we rename a flag/argument and modify all related files to avoid breakages.

    Also include a small change when computing nearest neighbors for geometric matching, to parallelize computation, which saves a little bit of time during execution (argument "n_jobs=-1").

--
326119848  by Andre Araujo:

    Option to measure DELG latency taking binarization into account.

--
324316608  by Andre Araujo:

    DELG global features training.

--
323693131  by Andre Araujo:

    PY3 conversion for delf public lib.

--
321046157  by Andre Araujo:

    Purely Google refactor

--

PiperOrigin-RevId: 326369548

* Added export of delg_model module.

* README update to explain training DELG global features head

* Added guidelines for DELF hyperparameter values

* Fixed typo

* Added mention about remaining training flags.

* Merged commit includes the following changes:
334723489  by Andre Araujo:

    Backpropagate global and attention layers together.

--
334228310  by Andre Araujo:

    Enable scaling of local feature locations to the resized resolution.

--

PiperOrigin-RevId: 334723489

* Merged commit includes the following changes:
347032253  by Andre Araujo:

    Updated local and global_and_local model export scripts for exporting models trained with the autoencoder layer.

--
344312455  by Andre Araujo:

    Implement autoencoder in training pipeline.

--
341116593  by Andre Araujo:

    Reduce the default save_interval, to get more frequent checkpoints.

--
341111808  by Andre Araujo:

    Allow checkpoint restoration in DELF training, to enable resuming of training jobs.

--
340138315  by Andre Araujo:

    DELF training script: make it always save the last checkpoint.

--
338731551  by Andre Araujo:

    Add image_size flag in DELF/G OSS training script.

--
338684879  by Andre Araujo:

    Clean up summaries in DELF/G training script.

    - Previously, the call to tf.summary.record_if() was not working, which led to summaries being recorded at every step, leading to too large events files. This is fixed.
    - Previously, some summaries were computed at iteration k, while others at iteration k+1. Now, we standardize summary computations to always run after backpropagation (which means that summaries are reported for step k+1, referring to the batch k).
    - Added a new summary: number of global steps per second; useful to see how fast training is making progress.

    Also a few other small modifications are included:
    - Improved description of the train.py script.
    - Some small automatic reformattings.

--

PiperOrigin-RevId: 347032253

* Updated README for training with autoencoder

* DELF README update after first review.
Co-authored-by: default avatarAndre Araujo <andrearaujo@google.com>
parent 184fcf84
...@@ -158,6 +158,9 @@ python3 train.py \ ...@@ -158,6 +158,9 @@ python3 train.py \
--logdir=gldv2_training/ --logdir=gldv2_training/
``` ```
*NOTE: The `--use_autoencoder` parameter is set by default to `True`, therefore
the model will be by default trained with the autoencoder.*
### Training with Local and Global Features ### Training with Local and Global Features
It is also possible to train the model with an improved global features head as It is also possible to train the model with an improved global features head as
...@@ -175,6 +178,9 @@ python3 train.py \ ...@@ -175,6 +178,9 @@ python3 train.py \
--delg_global_features --delg_global_features
``` ```
*NOTE: The `--use_autoencoder` parameter is set by default to `True`, therefore
the model will be by default trained with the autoencoder.*
### Hyperparameter Guidelines ### Hyperparameter Guidelines
In order to improve the convergence of the training, the following In order to improve the convergence of the training, the following
...@@ -184,9 +190,6 @@ values**: ...@@ -184,9 +190,6 @@ values**:
* 8 Tesla P100 GPUs: `--batch_size=256`, `--initial_lr=0.01` * 8 Tesla P100 GPUs: `--batch_size=256`, `--initial_lr=0.01`
* 4 Tesla P100 GPUs: `--batch_size=128`, `--initial_lr=0.005` * 4 Tesla P100 GPUs: `--batch_size=128`, `--initial_lr=0.005`
*NOTE*: We are currently working on adding the autoencoder described in the DELG
paper to this codebase. Currently, it is not yet implemented here. Stay tuned!
## Exporting the Trained Model ## Exporting the Trained Model
Assuming the training output, the TensorFlow checkpoint, is in the Assuming the training output, the TensorFlow checkpoint, is in the
...@@ -200,8 +203,7 @@ model. ...@@ -200,8 +203,7 @@ model.
``` ```
python3 model/export_local_model.py \ python3 model/export_local_model.py \
--ckpt_path=gldv2_training/delf_weights \ --ckpt_path=gldv2_training/delf_weights \
--export_path=gldv2_model_local \ --export_path=gldv2_model_local
--block3_strides
``` ```
### DELG global feature-only model ### DELG global feature-only model
...@@ -225,8 +227,7 @@ global features. ...@@ -225,8 +227,7 @@ global features.
python3 model/export_local_and_global_model.py \ python3 model/export_local_and_global_model.py \
--ckpt_path=gldv2_training/delf_weights \ --ckpt_path=gldv2_training/delf_weights \
--export_path=gldv2_model_local_and_global \ --export_path=gldv2_model_local_and_global \
--delg_global_features \ --delg_global_features
--block3_strides
``` ```
### Kaggle-compatible global feature model ### Kaggle-compatible global feature model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment