Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nlq fixes and fp16 support #53

Open
wants to merge 91 commits into
base: nlq_fixes_and_fp16_support
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
a13e169
adding camera pose results for the val set
vincentcartillier Apr 6, 2022
2c34f07
Update README.md
ebyrne Aug 30, 2022
46efdc0
Update README.md
ebyrne Aug 30, 2022
3d22ec0
updated VQ2D challenge link in README
srama2512 Aug 30, 2022
a4067d6
Add VQ2D Quickstart Colab Notebook
devanshk Aug 30, 2022
a3a7034
use 5fps clips / update readme / add mapper VQ2D to VQ3D queries
vincentcartillier Sep 5, 2022
2118006
typo
vincentcartillier Sep 8, 2022
9f6a3c6
add info about challenge
vincentcartillier Sep 10, 2022
bbe31ee
Merge pull request #12 from vincentcartillier/main
vincentcartillier Sep 13, 2022
0737e4a
added intermediate results (on val) to help reproducibility
vincentcartillier Sep 13, 2022
cb7f6ed
Merge branch 'main' of github.com:EGO4D/episodic-memory into main
vincentcartillier Sep 13, 2022
4cbebfe
Update conversion from videos to clips
srama2512 Sep 15, 2022
5ed2aa2
Update conversion from videos to clips
srama2512 Sep 15, 2022
b828ba5
Updated coversion from videos to images
srama2512 Sep 15, 2022
f2be820
Create pretrained SiamRCNN detections cache
srama2512 Sep 15, 2022
1dae74e
Update VQ2D inference script
srama2512 Sep 15, 2022
d1567e6
Tool for measuring VQ2D flops
srama2512 Sep 15, 2022
624fafa
Merge pull request #35 from EGO4D/devanshk-vq2d-quickstart
satwikkottur Sep 16, 2022
6c92cd0
Merge pull request #34 from EGO4D/nlq_fixes_and_fp16_support
satwikkottur Sep 16, 2022
ee39732
changed image-format to jpg for speed+storage
srama2512 Feb 22, 2023
6cd6d1b
reduce repeated H, W computation
srama2512 Feb 22, 2023
6703f50
minor nits
srama2512 Feb 22, 2023
61638db
use response-track for vis only when available
srama2512 Feb 22, 2023
be02119
reduce memory usage during evaluation
srama2512 Feb 22, 2023
e132503
add missing config option from prev commit
srama2512 Feb 22, 2023
45759a4
update metrics to return pair_metrics
srama2512 Feb 22, 2023
3968c35
refactor evaluation
srama2512 Feb 22, 2023
b0a685e
minor nits for visualizations
srama2512 Feb 23, 2023
5310142
fix minor bug in metrics.py
srama2512 Feb 23, 2023
019b9b4
improve video-to-clip generation
srama2512 Feb 23, 2023
5f2c793
add tool to validate consistency of clips
srama2512 Feb 23, 2023
0fb740f
update README to include clip validation
srama2512 Feb 23, 2023
7d9de57
minor nits for validate_extract_clips
srama2512 Feb 23, 2023
9b00d80
adding 90deg rotation to GT centroids to match the get transformation…
vincentcartillier Feb 23, 2023
819da1f
adding 90deg rotation to GT centroids to match the get transformation
vincentcartillier Feb 23, 2023
44e85b5
add updated VQ2D inference code [in progress]
srama2512 Feb 26, 2023
a335334
fixed bugs in VQ2D evaluation
srama2512 Feb 26, 2023
239c3e9
deleted code to perform VQ inference w/o cache
srama2512 Feb 26, 2023
0beade8
removed perform_vq_inference_v2
srama2512 Feb 26, 2023
3edfb4d
minor nits
srama2512 Feb 26, 2023
db64ea0
refactored image resize using a util
srama2512 Feb 26, 2023
4cc0503
clipwise amortization of detector score extraction
srama2512 Feb 26, 2023
c8c56b7
args for downscale height for clip conversion
srama2512 Feb 26, 2023
2464c90
update README and minor code nits
srama2512 Feb 26, 2023
d6137d1
Merge branch 'main' into vq2d-updates
srama2512 Feb 26, 2023
bea7ebe
Merge pull request #38 from EGO4D/vq2d-updates
srama2512 Feb 27, 2023
3a495e8
add negative frames matter model
srama2512 Feb 27, 2023
7fd934a
update acknowledgements and citations
srama2512 Feb 27, 2023
a38645d
updated results and commands for VQ2D inference
srama2512 Feb 28, 2023
8212e05
Merge pull request #39 from EGO4D/vq2d-update-baselines
srama2512 Feb 28, 2023
497ba92
Egotracks (#40)
tanghaotommy Mar 1, 2023
5275b95
Update README.md (#50)
tanghaotommy Aug 9, 2023
1ee7ef9
Add files via upload
mitchchessnoob May 9, 2024
71ebed6
Rename vslbase.py to VSLBase.py
mitchchessnoob May 9, 2024
e30a31b
Update main.py
mitchchessnoob May 9, 2024
364c073
Create VSLBase
mitchchessnoob May 9, 2024
5ca5fd0
Delete NLQ/VSLBase
mitchchessnoob May 9, 2024
dd6a7a5
Update and rename main.py to mainBase.py
mitchchessnoob May 9, 2024
3954f2a
Create mainNet.py
mitchchessnoob May 9, 2024
26b0ff7
Add files via upload
mitchchessnoob May 9, 2024
3a254ee
Rename VSLBase.py to VSLBase(3).py
mitchchessnoob May 9, 2024
92bdfbf
Rename VSLBase (2).py to VSLBase.py
mitchchessnoob May 9, 2024
abee7ac
Rename mainBase.py to mainBase(1).py
mitchchessnoob May 9, 2024
08f44c2
Add files via upload
mitchchessnoob May 9, 2024
ab17676
Rename runner_utils.py to runner_utilsNet.py
mitchchessnoob May 9, 2024
1de413c
Update mainNet.py
mitchchessnoob May 9, 2024
33e8a60
Add files via upload
mitchchessnoob May 9, 2024
174b2e4
Update mainBase.py
mitchchessnoob May 9, 2024
0454c3f
Rename mainBase(1).py to BaseVecchia.py
mitchchessnoob May 9, 2024
d0da1db
Rename VSLBase(3).py to retonabasona.py
mitchchessnoob May 9, 2024
3dbad3c
Update mainBase.py
mitchchessnoob May 9, 2024
a43c49e
Update mainBase.py
mitchchessnoob May 9, 2024
e72973e
Update mainBase.py
mitchchessnoob May 9, 2024
2a62c42
Update mainBase.py
mitchchessnoob May 9, 2024
0d5f48c
Update mainBase.py
mitchchessnoob May 9, 2024
700ff10
Update VSLBase.py
mitchchessnoob May 9, 2024
6356f84
Update mainBase.py
mitchchessnoob May 9, 2024
54bc3df
Update prepare_ego4d_dataset.py
mitchchessnoob May 20, 2024
cac68fc
Update prepare_ego4d_dataset.py
mitchchessnoob May 20, 2024
fb4f71b
Update prepare_ego4d_dataset.py
mitchchessnoob May 22, 2024
0a80878
Update prepare_ego4d_dataset.py
mitchchessnoob May 22, 2024
34e0aa1
Update prepare_ego4d_dataset.py
mitchchessnoob May 22, 2024
bc20c19
Update prepare_ego4d_dataset.py
mitchchessnoob May 22, 2024
58b85d0
Update prepare_ego4d_dataset.py
mitchchessnoob May 22, 2024
4f04de0
Create mainNetEgo.py
mitchchessnoob May 24, 2024
c233283
Create mainBaseEgo.py
mitchchessnoob May 24, 2024
2e7ed25
Update prepare_ego4d_dataset.py
mitchchessnoob May 24, 2024
35b90f0
Update data_gen.py
mitchchessnoob May 24, 2024
bda976f
Update prepare_ego4d_dataset.py
mitchchessnoob May 24, 2024
791ffd7
Update prepare_ego4d_dataset.py
mitchchessnoob May 24, 2024
4af9282
Update data_gen.py
mitchchessnoob May 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/MQ/runs/
EgoTracks/run.sh
59 changes: 59 additions & 0 deletions EgoTracks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# EgoTracks

## Install packages
```sh
pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html

pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
```

Then install EgoTracks as package:
```
python setup.py install
```

## Download clips
Please follow [Start here](https://github.com/EGO4D/docs/blob/main/docs/start-here.md) for instructions on how to access the dataset by accepting the terms of our license agreement.
And then use the following command to download clips and annotations for EgoTracks:
```
ego4d --output_directory ./ --datasets egotracks clips --benchmark EM --version v2
```

## Preprocess - extract frames from exported clips
Replace the following paths for reading and outputing to the correct place in ExtractFramesWorkflowParams in tools/preprocess/extract_ego4d_clip_frames.py:
* clip_dir: path to the downloaded clip directory
* annotation_path: path to the annotation file we would like to extract frames. If you want the test set only, only extract frames for the test set. If you also would like training part, then need to extract for training set as well.
* output_dir: path to the directory where to the save the extracted frame images.

And then extract frames from video clips:
```sh
python tools/preprocess/extract_ego4d_clip_frames.py
```

## Finetuning on EgoTracks
We used STARK (Res50) as pre-trained models, so download the model weights from https://drive.google.com/drive/folders/1fSgll53ZnVKeUn22W37Nijk-b9LGhMdN
Or you can use our trained checkpoint at https://drive.google.com/file/d/14vZmWxYSGJXZGxD5U1LthvvTR_eRzWCw/view?usp=share_link

Change the following paths in the tracking/config/stark_defaults.py:
* cfg.DATA.EGO4DLTT_ANNOTATION_PATH = "your_path/train_v1.json"
* cfg.DATA.EGO4DLTT_DATA_DIR = "your_path_to_extract_frames" - This is the same as the output_dir in preprocess

And change the model weights path and output directory in train.sh, and then run:
```sh
bash train.sh
```


## Infer challenge set and submit challenge result
We use "{clip_uid}\_{query_set_id}\_{object_title}" as unique name for each sequence (object). One could use the EGO4DLTTrackingDataset from tracking/dataset/eval_datasets/ego4d_lt_tracking_dataset.py for loading images and sequence name.
An example of how to run test and generate submission file is in tools/eval_datasets/eval_ego4d_lt_tracking.py and tools/train_net.py result2submission.

Change the following paths in the tracking/config/stark_defaults.py:
* cfg.EVAL.EGO4DLT.ANNOTATION_PATH = "your_path/challenge_test_v1_unannotated.json"
* cfg.EVAL.EGO4DLT.DATA_DIR = "your_path_to_extract_frames"

And change the model weights path and output directory in test.sh, and then run:
```sh
bash test.sh
```

103 changes: 103 additions & 0 deletions EgoTracks/configs/STARK/stark_st_R101.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
_BASE_: "./stark_st_base.yaml"
MODEL_TYPE: STARK
DATA:
SAMPLER_MODE: trident_pro
MAX_SAMPLE_INTERVAL:
- 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 320
NUMBER: 1
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 128
NUMBER: 2
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- COCO17
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 600000
VAL:
DATASETS_NAME:
- GOT10K_votval
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 100000
MODEL:
HEAD_TYPE: CORNER
NLAYER_HEAD: 3
BACKBONE:
DILATION: false
OUTPUT_LAYERS:
- layer3
STRIDE: 16
TYPE: resnet101
HIDDEN_DIM: 256
NUM_OBJECT_QUERIES: 1
POSITION_EMBEDDING: sine
PREDICT_MASK: false
TRANSFORMER:
DEC_LAYERS: 6
DIM_FEEDFORWARD: 2048
DIVIDE_NORM: false
DROPOUT: 0.1
ENC_LAYERS: 6
NHEADS: 8
PRE_NORM: false
TRAIN_STAGE_1:
BACKBONE_MULTIPLIER: 0.1
BATCH_SIZE: 16
DEEP_SUPERVISION: false
EPOCH: 50
FREEZE_BACKBONE_BN: true
FREEZE_LAYERS:
- conv1
- layer1
GRAD_CLIP_NORM: 0.1
LR: 0.0001
LR_DROP_EPOCH: 40
NUM_WORKER: 4
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.0001
LOSS_FUNCTIONS: ["giou", "l1"]
LOSS_WEIGHTS: [2.0, 5.0]
TRAIN_STAGE_2:
BACKBONE_MULTIPLIER: 0.1
BATCH_SIZE: 16
DEEP_SUPERVISION: false
EPOCH: 5
FREEZE_BACKBONE_BN: true
FREEZE_LAYERS:
- conv1
- layer1
GRAD_CLIP_NORM: 0.1
LR: 0.0001
LR_DROP_EPOCH: 40
NUM_WORKER: 4
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
VAL_EPOCH_INTERVAL: 1
WEIGHT_DECAY: 0.0001
LOSS_FUNCTIONS: ["cls"]
LOSS_WEIGHTS: [1.0]
116 changes: 116 additions & 0 deletions EgoTracks/configs/STARK/stark_st_base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
MODEL_TYPE: STARK
DATA:
SAMPLER_MODE: trident_pro
MAX_SAMPLE_INTERVAL:
- 200
MEAN:
- 0.485
- 0.456
- 0.406
SEARCH:
CENTER_JITTER: 4.5
FACTOR: 5.0
SCALE_JITTER: 0.5
SIZE: 320
NUMBER: 1
STD:
- 0.229
- 0.224
- 0.225
TEMPLATE:
CENTER_JITTER: 0
FACTOR: 2.0
SCALE_JITTER: 0
SIZE: 128
NUMBER: 2
TRAIN:
DATASETS_NAME:
- LASOT
- GOT10K_vottrain
- COCO17
- TRACKINGNET
DATASETS_RATIO:
- 1
- 1
- 1
- 1
SAMPLE_PER_EPOCH: 600000
VAL:
DATASETS_NAME:
- GOT10K_votval
DATASETS_RATIO:
- 1
SAMPLE_PER_EPOCH: 100000
MODEL:
HEAD_TYPE: CORNER
NLAYER_HEAD: 3
BACKBONE:
DILATION: false
OUTPUT_LAYERS:
- layer3
STRIDE: 16
TYPE: resnet50
HIDDEN_DIM: 256
NUM_OBJECT_QUERIES: 1
POSITION_EMBEDDING: sine
PREDICT_MASK: false
TRANSFORMER:
DEC_LAYERS: 6
DIM_FEEDFORWARD: 2048
DIVIDE_NORM: false
DROPOUT: 0.1
ENC_LAYERS: 6
NHEADS: 8
PRE_NORM: false
TRAIN_STAGE_1:
BACKBONE_MULTIPLIER: 0.1
BATCH_SIZE: 16
DEEP_SUPERVISION: false
EPOCH: 50
FREEZE_BACKBONE_BN: true
FREEZE_LAYERS:
- conv1
- layer1
GRAD_CLIP_NORM: 0.1
LR: 0.0001
LR_DROP_EPOCH: 40
NUM_WORKER: 4
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
VAL_EPOCH_INTERVAL: 10
WEIGHT_DECAY: 0.0001
LOSS_FUNCTIONS: ["giou", "l1"]
LOSS_WEIGHTS: [2.0, 5.0]
TRAIN_STAGE_2:
BACKBONE_MULTIPLIER: 0.1
BATCH_SIZE: 16
DEEP_SUPERVISION: false
EPOCH: 5
FREEZE_BACKBONE_BN: true
FREEZE_LAYERS:
- conv1
- layer1
GRAD_CLIP_NORM: 0.1
LR: 0.0001
LR_DROP_EPOCH: 4
NUM_WORKER: 4
OPTIMIZER: ADAMW
PRINT_INTERVAL: 50
VAL_EPOCH_INTERVAL: 1
WEIGHT_DECAY: 0.0001
LOSS_FUNCTIONS: ["cls"]
LOSS_WEIGHTS: [1.0]
TEST:
SEARCH_FACTOR: 5.0
SEARCH_SIZE: 320
TEMPLATE_FACTOR: 2.0
TEMPLATE_SIZE: 128
TEST_BATCHSIZE: 8
IS_SEARCH_LOCAL: True
UPDATE_INTERVALS:
LASOT: [200]
GOT10K_TEST: [200]
TRACKINGNET: [25]
VOT20: [10]
VOT20LT: [200]
EGO4DVQTracking: [1]
28 changes: 28 additions & 0 deletions EgoTracks/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3

from setuptools import find_packages, setup

PROJECTS = {
"tracking.tools": "tools",
}

setup(
name="egotracks",
version="1.0",
# author="",
# url="unknown",
# description="EgoTracks",
# python_requires=">=3.7",
# install_requires=[
# "matplotlib",
# "detectron2",
# "opencv-python",
# "pandas",
# "torchvision>=0.4.2",
# "scikit-learn",
# "iopath",
# ],
packages=find_packages(exclude=("tests", "tools")) + list(PROJECTS.keys()),
package_dir=PROJECTS,
package_data={"tracking.tools": ["**"]},
)
4 changes: 4 additions & 0 deletions EgoTracks/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
python tools/train_net.py \
--num-gpus 8 --eval-only \
MODEL.WEIGHTS /checkpoint/haotang/experiments/EgoTracks/STARKST_ep0001.pth.tar \
OUTPUT_DIR /checkpoint/haotang/experiments/EgoTracks/res/test_challenge_set_small_v1_5FPS_multi_gpu_test
Empty file added EgoTracks/tools/__init__.py
Empty file.
Empty file.
18 changes: 18 additions & 0 deletions EgoTracks/tools/eval_datasets/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from .eval_ego4d_lt_tracking import (
eval_ego4d_lt_tracking,
)

EVAL_FUNCTIONS = {
"EGO4DLTTracking": eval_ego4d_lt_tracking,
}
CALCULATE_METRICS_FUNCTIONS = {
"EGO4DLTTracking": None,
}


def build_eval_function(dataset_name):
return EVAL_FUNCTIONS[dataset_name]


def build_calculate_metrics_function(dataset_name):
return CALCULATE_METRICS_FUNCTIONS[dataset_name]
Loading