| 22 | from ...utils import configurable |
| 23 | |
| 24 | class IMaskDINODecoder(nn.Module): |
| 25 | @configurable |
| 26 | def __init__( |
| 27 | self, |
| 28 | lang_encoder: nn.Module, |
| 29 | in_channels, |
| 30 | mask_classification=True, |
| 31 | *, |
| 32 | num_classes: int, |
| 33 | hidden_dim: int, |
| 34 | dim_proj: int, |
| 35 | num_queries: int, |
| 36 | nheads: int, |
| 37 | dim_feedforward: int, |
| 38 | dec_layers: int, |
| 39 | mask_dim: int, |
| 40 | enforce_input_project: bool, |
| 41 | two_stage: bool, |
| 42 | dn: str, |
| 43 | noise_scale:float, |
| 44 | dn_num:int, |
| 45 | initialize_box_type:bool, |
| 46 | initial_pred:bool, |
| 47 | learn_tgt: bool, |
| 48 | total_num_feature_levels: int = 4, |
| 49 | dropout: float = 0.0, |
| 50 | activation: str = 'relu', |
| 51 | nhead: int = 8, |
| 52 | dec_n_points: int = 4, |
| 53 | return_intermediate_dec: bool = True, |
| 54 | query_dim: int = 4, |
| 55 | dec_layer_share: bool = False, |
| 56 | semantic_ce_loss: bool = False, |
| 57 | num_mask_tokens: int = 3, |
| 58 | ): |
| 59 | """ |
| 60 | NOTE: this interface is experimental. |
| 61 | Args: |
| 62 | in_channels: channels of the input features |
| 63 | mask_classification: whether to add mask classifier or not |
| 64 | num_classes: number of classes |
| 65 | hidden_dim: Transformer feature dimension |
| 66 | num_queries: number of queries |
| 67 | nheads: number of heads |
| 68 | dim_feedforward: feature dimension in feedforward network |
| 69 | enc_layers: number of Transformer encoder layers |
| 70 | dec_layers: number of Transformer decoder layers |
| 71 | pre_norm: whether to use pre-LayerNorm or not |
| 72 | mask_dim: mask feature dimension |
| 73 | enforce_input_project: add input project 1x1 conv even if input |
| 74 | channels and hidden dim is identical |
| 75 | d_model: transformer dimension |
| 76 | dropout: dropout rate |
| 77 | activation: activation function |
| 78 | nhead: num heads in multi-head attention |
| 79 | dec_n_points: number of sampling points in decoder |
| 80 | return_intermediate_dec: return the intermediate results of decoder |
| 81 | query_dim: 4 -> (x, y, w, h) |
no outgoing calls
no test coverage detected