Skip to content

Commit

Permalink
fix: Fix lint and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyYang0714 committed Sep 7, 2023
1 parent 2735976 commit 786102b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 30 deletions.
37 changes: 9 additions & 28 deletions tests/docs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# exec_timeout=50, diff_ignore=ignores, diff_replace=replace
# )
# fixture.diff_color_words = False
# file = "docs/source/tutorials/3D_visualization.ipynb"
# file = "docs/source/user_guide/3D_visualization.ipynb"
# fixture.check(file)


Expand All @@ -52,48 +52,29 @@ def test_vis() -> None:
exec_timeout=50, diff_ignore=ignores, diff_replace=replace
)
fixture.diff_color_words = False
file = "docs/source/tutorials/visualization.ipynb"
file = "docs/source/user_guide/visualization.ipynb"
fixture.check(file)


def test_get_started() -> None:
"""Test get started notebooks."""
ignores = (
"/cells/*/metadata",
"/cells/1/outputs/", # Suppress downloading checkpoint output
"/cells/3/outputs/", # Suppress downloading checkpoint output
"/metadata/widgets",
"/cells/5/outputs/", # Suppress downloading checkpoint output
"/cells/9/outputs/", # Suppress downloading checkpoint output
"/cells/11/outputs/", # Suppress downloading checkpoint output
"/cells/*/execution_count",
"/cells/*/outputs/*/data/image",
"/metadata/language_info/version",
)
replace = (("/cells/*/outputs", "\\[Open3D INFO\\] [^\\n]+ *\\n?", ""),)

fixture = (
NBRegressionFixture( # Higher timeout for downloading checkpoints
exec_timeout=300, diff_ignore=ignores, diff_replace=replace
)
)
fixture.diff_color_words = False
file = "docs/source/tutorials/getting_started.ipynb"
fixture.check(file)


def test_cli() -> None:
"""Test the cli notebook."""
# Lets for now ignore the output of the training cells. Cuda/Python version
# on the server are different and the training is slightly non-det.
ignores = (
"/cells/2/outputs/",
"/cells/4/outputs/",
"/cells/*/metadata",
"/metadata/language_info/version",
)
fixture = (
NBRegressionFixture( # Higher timeout for downloading checkpoints
exec_timeout=300, diff_ignore=ignores
)
# Higher timeout for downloading checkpoints
fixture = NBRegressionFixture(
exec_timeout=300, diff_ignore=ignores, diff_replace=replace
)
fixture.diff_color_words = False
file = "docs/source/tutorials/cli_interface.ipynb"
file = "docs/source/user_guide/getting_started.ipynb"
fixture.check(file)
4 changes: 3 additions & 1 deletion tests/model/detect/mask_rcnn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def test_train(self):
rcnn_box_encoder, _ = get_default_rcnn_box_codec()
rcnn_loss = RCNNLoss(rcnn_box_encoder)

mask_loss = SampledMaskLoss(positive_mask_sampler, MaskRCNNHeadLoss())
mask_loss = SampledMaskLoss(
positive_mask_sampler, MaskRCNNHeadLoss(num_classes=80)
)

mask_rcnn_loss = LossModule(
[
Expand Down
2 changes: 1 addition & 1 deletion tests/vis4d-test-data
Submodule vis4d-test-data updated 37 files
+10 −6 config_test/bdd100k/faster_rcnn/faster_rcnn_r50_1x_bdd100k.yaml
+10 −6 config_test/bdd100k/faster_rcnn/faster_rcnn_r50_3x_bdd100k.yaml
+14 −10 config_test/bdd100k/mask_rcnn/mask_rcnn_r50_1x_bdd100k.yaml
+14 −10 config_test/bdd100k/mask_rcnn/mask_rcnn_r50_3x_bdd100k.yaml
+14 −10 config_test/bdd100k/mask_rcnn/mask_rcnn_r50_5x_bdd100k.yaml
+12 −7 config_test/bdd100k/qdtrack/qdtrack_frcnn_r50_fpn_1x_bdd100k.yaml
+518 −167 config_test/bdd100k/qdtrack/qdtrack_yolox_x_50e_bdd100k.yaml
+10 −6 config_test/bdd100k/semantic_fpn/semantic_fpn_r101_80k_bdd100k.yaml
+10 −6 config_test/bdd100k/semantic_fpn/semantic_fpn_r50_40k_bdd100k.yaml
+10 −6 config_test/bdd100k/semantic_fpn/semantic_fpn_r50_80k_bdd100k.yaml
+10 −6 config_test/bevformer/bevformer_base.yaml
+10 −6 config_test/bevformer/bevformer_tiny.yaml
+10 −6 config_test/bevformer/bevformer_vis.yaml
+4 −0 config_test/cc_3dt/cc_3dt_frcnn_r101_fpn_kf3d_24e_nusc.yaml
+10 −6 config_test/cc_3dt/cc_3dt_frcnn_r101_fpn_pure_det_nusc.yaml
+4 −0 config_test/cc_3dt/cc_3dt_frcnn_r101_fpn_velo_lstm_24e_nusc.yaml
+4 −0 config_test/cc_3dt/cc_3dt_frcnn_r50_fpn_kf3d_12e_nusc.yaml
+4 −0 config_test/cc_3dt/cc_3dt_nusc_vis.yaml
+7 −5 config_test/cc_3dt/velo_lstm_frcnn_r101_fpn_100e_nusc.yaml
+10 −6 config_test/faster_rcnn/faster_rcnn_coco.yaml
+9 −5 config_test/fcn_resnet/fcn_resnet_coco.yaml
+14 −10 config_test/mask_rcnn/mask_rcnn_coco.yaml
+10 −6 config_test/retinanet/retinanet_coco.yaml
+10 −6 config_test/shift/faster_rcnn/faster_rcnn_r50_12e_shift.yaml
+10 −6 config_test/shift/faster_rcnn/faster_rcnn_r50_36e_shift.yaml
+10 −6 config_test/shift/faster_rcnn/faster_rcnn_r50_6e_shift_all_domains.yaml
+14 −10 config_test/shift/mask_rcnn/mask_rcnn_r50_12e_shift.yaml
+14 −10 config_test/shift/mask_rcnn/mask_rcnn_r50_36e_shift.yaml
+14 −10 config_test/shift/mask_rcnn/mask_rcnn_r50_6e_shift_all_domains.yaml
+10 −6 config_test/shift/semantic_fpn/semantic_fpn_r50_160k_shift.yaml
+10 −6 config_test/shift/semantic_fpn/semantic_fpn_r50_160k_shift_all_domains.yaml
+10 −6 config_test/shift/semantic_fpn/semantic_fpn_r50_40k_shift.yaml
+10 −6 config_test/shift/semantic_fpn/semantic_fpn_r50_40k_shift_all_domains.yaml
+9 −5 config_test/vit/vit_small_imagenet.yaml
+9 −5 config_test/vit/vit_tiny_imagenet.yaml
+20 −13 config_test/yolox/yolox_s_300e_coco.yaml
+20 −13 config_test/yolox/yolox_tiny_300e_coco.yaml
2 changes: 2 additions & 0 deletions vis4d/op/detect/rcnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def __init__(
max_per_img: int = 100,
) -> None:
"""Creates an instance of the class.
Args:
box_decoder (DeltaXYWHBBoxDecoder, optional): Decodes regression
parameters to detected boxes. Defaults to None. If None, it
Expand Down Expand Up @@ -310,6 +311,7 @@ def __init__(
loss_bbox: TorchLossFunc = l1_loss,
) -> None:
"""Creates an instance of the class.
Args:
box_encoder (DeltaXYWHBBoxEncoder): Decodes box regression
parameters into detected boxes.
Expand Down

0 comments on commit 786102b

Please sign in to comment.