Spaces:
Build error
Build error
Download src/dinov2/eval/segmentation_m2f/models/builder.py from CHSTR/DocExplore_DEMO: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/spaces/CHSTR/DocExplore_DEMO/resolve/main/src/dinov2/eval/segmentation_m2f/models/builder.py
- Command line
-
hf download hf://spaces/CHSTR/DocExplore_DEMO/src/dinov2/eval/segmentation_m2f/models/builder.py
-
curl -L -o builder.py https://huggingface.co/spaces/CHSTR/DocExplore_DEMO/resolve/main/src/dinov2/eval/segmentation_m2f/models/builder.py
619 Bytes
| # Copyright (c) Meta Platforms, Inc. and affiliates. | |
| # | |
| # This source code is licensed under the Apache License, Version 2.0 | |
| # found in the LICENSE file in the root directory of this source tree. | |
| from mmcv.utils import Registry | |
| TRANSFORMER = Registry("Transformer") | |
| MASK_ASSIGNERS = Registry("mask_assigner") | |
| MATCH_COST = Registry("match_cost") | |
| def build_match_cost(cfg): | |
| """Build Match Cost.""" | |
| return MATCH_COST.build(cfg) | |
| def build_assigner(cfg): | |
| """Build Assigner.""" | |
| return MASK_ASSIGNERS.build(cfg) | |
| def build_transformer(cfg): | |
| """Build Transformer.""" | |
| return TRANSFORMER.build(cfg) | |