Download modules/vision/obj_cls_encoder.py from MatchLab/backup: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/datasets/MatchLab/backup/resolve/main/modules/vision/obj_cls_encoder.py
- Command line
-
hf download hf://datasets/MatchLab/backup/modules/vision/obj_cls_encoder.py
-
curl -L -o obj_cls_encoder.py https://huggingface.co/datasets/MatchLab/backup/resolve/main/modules/vision/obj_cls_encoder.py
523 Bytes
| import torch.nn as nn | |
| from modules.build import VISION_REGISTRY | |
| from modules.utils import get_mlp_head | |
| class ObjClsEncoder(nn.Module): | |
| def __init__(self, cfg, input_feat_size=768, hidden_size=768, tgt_cls_num=607): | |
| super().__init__() | |
| self.cfg = cfg | |
| self.vis_cls_head = get_mlp_head(input_feat_size, hidden_size // 2, tgt_cls_num, dropout = 0.3) | |
| def forward(self, obj_feats, **kwargs): | |
| obj_logits = self.vis_cls_head(obj_feats) | |
| return obj_logits | |