Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasehuang committed Jan 16, 2024
1 parent e7fdcff commit b1ecb0c
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 31 deletions.
23 changes: 0 additions & 23 deletions tests/zoo/bdd100k/qdtrack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,3 @@ def test_frcnn_r50_fpn_1x_bdd100k(self) -> None:
f"{self.gt_config_path}/qdtrack_frcnn_r50_fpn_1x_bdd100k.yaml",
self.varying_keys,
)

def test_frcnn_r50_fpn_augs_1x_bdd100k(self) -> None:
"""Test the config for QDTrack Faster-RCNN.
This instantiates the config and compares it to a ground truth.
"""
compare_configs(
f"{self.config_prefix}.qdtrack_frcnn_r50_fpn_augs_1x_bdd100k",
f"{self.gt_config_path}/"
+ "qdtrack_frcnn_r50_fpn_augs_1x_bdd100k.yaml",
self.varying_keys,
)

def test_yolox_x_50e_bdd100k(self) -> None:
"""Test the config for QDTrack YOLOX.
This instantiates the config and compares it to a ground truth.
"""
compare_configs(
f"{self.config_prefix}.qdtrack_yolox_x_50e_bdd100k",
f"{self.gt_config_path}/qdtrack_yolox_x_50e_bdd100k.yaml",
self.varying_keys,
)
35 changes: 35 additions & 0 deletions tests/zoo/qdtrack_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""QDTrack configs tests."""
import unittest

from .util import compare_configs


class TestQDTrackConfig(unittest.TestCase):
"""Tests the content of the provided configs for QDTrack."""

config_prefix = "qdtrack"
gt_config_path = "tests/vis4d-test-data/config_test/qdtrack"
varying_keys = ["save_prefix", "output_dir", "version", "timestamp"]

def test_frcnn_r50_fpn_augs_1x_bdd100k(self) -> None:
"""Test the config for QDTrack Faster-RCNN.
This instantiates the config and compares it to a ground truth.
"""
compare_configs(
f"{self.config_prefix}.qdtrack_frcnn_r50_fpn_augs_1x_bdd100k",
f"{self.gt_config_path}/"
+ "qdtrack_frcnn_r50_fpn_augs_1x_bdd100k.yaml",
self.varying_keys,
)

def test_yolox_x_50e_bdd100k(self) -> None:
"""Test the config for QDTrack YOLOX.
This instantiates the config and compares it to a ground truth.
"""
compare_configs(
f"{self.config_prefix}.qdtrack_yolox_x_50e_bdd100k",
f"{self.gt_config_path}/qdtrack_yolox_x_50e_bdd100k.yaml",
self.varying_keys,
)
2 changes: 2 additions & 0 deletions vis4d/zoo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .faster_rcnn import AVAILABLE_MODELS as FASTER_RCNN_MODELS
from .fcn_resnet import AVAILABLE_MODELS as FCN_RESNET_MODELS
from .mask_rcnn import AVAILABLE_MODELS as MASK_RCNN_MODELS
from .qdtrack import AVAILABLE_MODELS as QDTRACK_MODELS
from .retinanet import AVAILABLE_MODELS as RETINANET_MODELS
from .shift import AVAILABLE_MODELS as SHIFT_MODELS
from .vit import AVAILABLE_MODELS as VIT_MODELS
Expand All @@ -21,6 +22,7 @@
"faster_rcnn": FASTER_RCNN_MODELS,
"fcn_resnet": FCN_RESNET_MODELS,
"mask_rcnn": MASK_RCNN_MODELS,
"qdtrack": QDTRACK_MODELS,
"retinanet": RETINANET_MODELS,
"shift": SHIFT_MODELS,
"vit": VIT_MODELS,
Expand Down
6 changes: 1 addition & 5 deletions vis4d/zoo/bdd100k/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
mask_rcnn_r50_3x_bdd100k,
mask_rcnn_r50_5x_bdd100k,
)
from .qdtrack import (
qdtrack_frcnn_r50_fpn_1x_bdd100k,
qdtrack_yolox_x_50e_bdd100k,
)
from .qdtrack import qdtrack_frcnn_r50_fpn_1x_bdd100k
from .semantic_fpn import (
semantic_fpn_r50_40k_bdd100k,
semantic_fpn_r50_80k_bdd100k,
Expand All @@ -26,5 +23,4 @@
"semantic_fpn_r50_80k_bdd100k": semantic_fpn_r50_80k_bdd100k,
"semantic_fpn_r101_80k_bdd100k": semantic_fpn_r101_80k_bdd100k,
"qdtrack_frcnn_r50_fpn_1x_bdd100k": qdtrack_frcnn_r50_fpn_1x_bdd100k,
"qdtrack_yolox_x_50e_bdd100k": qdtrack_yolox_x_50e_bdd100k,
}
12 changes: 12 additions & 0 deletions vis4d/zoo/qdtrack/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
"""QDTrack."""
from . import (
qdtrack_frcnn_r50_fpn_augs_1x_bdd100k,
qdtrack_yolox_x_50e_bdd100k,
)

# Lists of available models in BDD100K Model Zoo.
AVAILABLE_MODELS = {
"qdtrack_frcnn_r50_fpn_augs_1x_bdd100k": (
qdtrack_frcnn_r50_fpn_augs_1x_bdd100k
),
"qdtrack_yolox_x_50e_bdd100k": qdtrack_yolox_x_50e_bdd100k,
}
2 changes: 1 addition & 1 deletion vis4d/zoo/qdtrack/qdtrack_frcnn_r50_fpn_augs_1x_bdd100k.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from vis4d.eval.bdd100k import BDD100KTrackEvaluator
from vis4d.op.base import ResNet
from vis4d.vis.image import BoundingBoxVisualizer
from vis4d.zoo.bdd100k.qdtrack.data_yolox import get_bdd100k_track_cfg
from vis4d.zoo.qdtrack.data_yolox import get_bdd100k_track_cfg


def get_config() -> ExperimentConfig:
Expand Down
2 changes: 1 addition & 1 deletion vis4d/zoo/qdtrack/qdtrack_yolox_x_50e_bdd100k.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from vis4d.engine.connectors import CallbackConnector, DataConnector
from vis4d.eval.bdd100k import BDD100KTrackEvaluator
from vis4d.vis.image import BoundingBoxVisualizer
from vis4d.zoo.bdd100k.qdtrack.data_yolox import get_bdd100k_track_cfg
from vis4d.zoo.qdtrack.data_yolox import get_bdd100k_track_cfg


def get_config() -> ExperimentConfig:
Expand Down

0 comments on commit b1ecb0c

Please sign in to comment.