Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 1 deletion d2/detr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def add_detr_config(cfg):
cfg.MODEL.DETR.ENC_LAYERS = 6
cfg.MODEL.DETR.DEC_LAYERS = 6
cfg.MODEL.DETR.PRE_NORM = False
cfg.MODEL.DETR.PASS_POS_AND_QUERY = True

cfg.MODEL.DETR.HIDDEN_DIM = 256
cfg.MODEL.DETR.NUM_OBJECT_QUERIES = 100
Expand Down
2 changes: 0 additions & 2 deletions d2/detr/detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def __init__(self, cfg):
enc_layers = cfg.MODEL.DETR.ENC_LAYERS
dec_layers = cfg.MODEL.DETR.DEC_LAYERS
pre_norm = cfg.MODEL.DETR.PRE_NORM
pass_pos_and_query = cfg.MODEL.DETR.PASS_POS_AND_QUERY

# Loss parameters:
giou_weight = cfg.MODEL.DETR.GIOU_WEIGHT
Expand All @@ -107,7 +106,6 @@ def __init__(self, cfg):
num_decoder_layers=dec_layers,
normalize_before=pre_norm,
return_intermediate_dec=deep_supervision,
pass_pos_and_query=pass_pos_and_query,
)

self.detr = DETR(
Expand Down
2 changes: 1 addition & 1 deletion models/detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def forward(self, samples: NestedTensor):
- "aux_outputs": Optional, only returned when auxilary losses are activated. It is a list of
dictionnaries containing the two above keys for each decoder layer.
"""
if not isinstance(samples, NestedTensor):
if isinstance(samples, list):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes :)

samples = nested_tensor_from_tensor_list(samples)
features, pos = self.backbone(samples)

Expand Down