MCPcopy Create free account
hub / github.com/WeChatCV/WeVisionOne / build_pixel_decoder

Function build_pixel_decoder

WeVisionOne/pixel_decoder/build.py:6–15  ·  view source on GitHub ↗
(cfg, input_shape)

Source from the content-addressed store, hash-verified

4
5
6def build_pixel_decoder(cfg, input_shape):
7 name = cfg.MODEL.SEM_SEG_HEAD.PIXEL_DECODER_NAME
8 model = SEM_SEG_HEADS_REGISTRY.get(name)(cfg, input_shape)
9 forward_features = getattr(model, "forward_features", None)
10 if not callable(forward_features):
11 raise ValueError(
12 "Only SEM_SEG_HEADS with forward_features method can be used as pixel decoder. "
13 f"Please implement forward_features for {name} to only return mask features."
14 )
15 return model

Callers 1

from_configMethod · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected