INNER CODE UNIT · Python
arguments_image_projection_head
apple/ml-cvnets · cvnets/image_projection_layers/__init__.py:21
def arguments_image_projection_head(
parser: argparse.ArgumentParser,
) -> argparse.ArgumentParser:
"""Register arguments of all image projection heads."""
# add arguments for base image projection layer
parser = BaseImageProjectionHead.add_arguments(parser)
# add class specific arguments
parser = IMAGE_PROJECTION_HEAD_REGISTRY.all_arguments(parser)
return parser
def build_image_projection_head(
opts: argparse.Namespace, in_dim: int, out_dim: int, *args, **kwargs
) -> BaseImageProjectionHead:
"""Helper function to build an image projection head from command-line arguments.
Args: