CoolFace
Modelpublic

nvidia/C-RADIOv4-1D-H

sourceHugging Faceotherupdated 2mo agoView on Hugging Face
8likes301downloads
common.py167 linesDownload Raw Back to root
1# Copyright (c) 2024, NVIDIA CORPORATION.  All rights reserved.2#3# NVIDIA CORPORATION and its licensors retain all intellectual property4# and proprietary rights in and to this software, related documentation5# and any modifications thereto.  Any use, reproduction, disclosure or6# distribution of this software and related documentation without an express7# license agreement from NVIDIA CORPORATION is strictly prohibited.8 9from dataclasses import dataclass10from typing import Optional11 12from .radio_model import Resolution13 14 15@dataclass16class RadioResource:17    url: str18    patch_size: int19    max_resolution: int20    preferred_resolution: Resolution21    supports_vitdet: bool = True22    vitdet_num_windowed: Optional[int] = None23    vitdet_num_global: Optional[int] = None24 25 26RESOURCE_MAP = {27    # RADIOv2.528    "radio_v2.5-b": RadioResource(29        "https://huggingface.co/nvidia/RADIO/resolve/main/radio-v2.5-b_half.pth.tar?download=true",30        patch_size=16,31        max_resolution=2048,32        preferred_resolution=(768, 768),33        vitdet_num_global=4,34    ),35    "radio_v2.5-l": RadioResource(36        "https://huggingface.co/nvidia/RADIO/resolve/main/radio-v2.5-l_half.pth.tar?download=true",37        patch_size=16,38        max_resolution=2048,39        preferred_resolution=(768, 768),40        vitdet_num_global=4,41    ),42    "radio_v2.5-h": RadioResource(43        "https://huggingface.co/nvidia/RADIO/resolve/main/radio_v2.5-h.pth.tar?download=true",44        patch_size=16,45        max_resolution=2048,46        preferred_resolution=(768, 768),47        vitdet_num_global=4,48    ),49    "radio_v2.5-h-norm": RadioResource(50        "https://huggingface.co/nvidia/RADIO/resolve/main/radio_v2.5-h-norm.pth.tar?download=true",51        patch_size=16,52        max_resolution=2048,53        preferred_resolution=(768, 768),54        vitdet_num_global=4,55    ),56    "radio_v2.5-g": RadioResource(57        "https://huggingface.co/nvidia/RADIO/resolve/main/radio_v2.5-g.pth.tar?download=true",58        patch_size=14,59        max_resolution=1792,60        preferred_resolution=(896, 896),61        vitdet_num_global=8,62    ),63    # RADIO64    "radio_v2.1": RadioResource(65        "https://huggingface.co/nvidia/RADIO/resolve/main/radio_v2.1_bf16.pth.tar?download=true",66        patch_size=16,67        max_resolution=2048,68        preferred_resolution=Resolution(432, 432),69        vitdet_num_windowed=5,70    ),71    "radio_v2": RadioResource(72        "https://huggingface.co/nvidia/RADIO/resolve/main/radio_v2.pth.tar?download=true",73        patch_size=16,74        max_resolution=2048,75        preferred_resolution=Resolution(432, 432),76        vitdet_num_windowed=5,77    ),78    "radio_v1": RadioResource(79        "https://huggingface.co/nvidia/RADIO/resolve/main/radio_v1.pth.tar?download=true",80        patch_size=14,81        max_resolution=1050,82        preferred_resolution=Resolution(378, 378),83    ),84    # E-RADIO85    "e-radio_v2": RadioResource(86        "https://huggingface.co/nvidia/RADIO/resolve/main/eradio_v2.pth.tar?download=true",87        patch_size=16,88        max_resolution=2048,89        preferred_resolution=Resolution(512, 512),90    ),91    # C-RADIO92    "c-radio_v2-g": RadioResource(93        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.94        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv2-g for more information.95        "https://huggingface.co/nvidia/C-RADIOv2-g/resolve/main/c-radio_v2-g_half.pth.tar",96        patch_size=16,97        max_resolution=2048,98        preferred_resolution=(768, 768),99        vitdet_num_global=8,100    ),101    "c-radio_v2-vlm-h": RadioResource(102        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.103        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv2-VLM-H for more information.104        "https://huggingface.co/nvidia/C-RADIOv2-VLM-H/resolve/main/c-radio_v2-vlm-h.pth.tar",105        patch_size=16,106        max_resolution=2048,107        preferred_resolution=(768, 768),108        vitdet_num_global=8,109    ),110    "c-radio_v3-b": RadioResource(111        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.112        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv3-B for more information.113        "https://huggingface.co/nvidia/C-RADIOv3-B/resolve/main/c-radio_v3-b_half.pth.tar?download=true",114        patch_size=16,115        max_resolution=2048,116        preferred_resolution=Resolution(512, 512),117        supports_vitdet=False,118    ),119    "c-radio_v3-l": RadioResource(120        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.121        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv3-L for more information.122        "https://huggingface.co/nvidia/C-RADIOv3-L/resolve/main/c-radio-v3_l_half.pth.tar?download=true",123        patch_size=16,124        max_resolution=2048,125        preferred_resolution=Resolution(512, 512),126        supports_vitdet=False,127    ),128    "c-radio_v3-h": RadioResource(129        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.130        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv3-H for more information.131        "https://huggingface.co/nvidia/C-RADIOv3-H/resolve/main/c-radio_v3-h_half.pth.tar?download=true",132        patch_size=16,133        max_resolution=2048,134        preferred_resolution=Resolution(512, 512),135        supports_vitdet=False,136    ),137    "c-radio_v3-g": RadioResource(138        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.139        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv3-g for more information.140        "https://huggingface.co/nvidia/C-RADIOv3-g/resolve/main/c-radio_v3-g_half.pth.tar?download=true",141        patch_size=16,142        max_resolution=2048,143        preferred_resolution=Resolution(512, 512),144        supports_vitdet=False,145    ),146    "c-radio_v4-so400m": RadioResource(147        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.148        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv4-SO400M for more information.149        "https://huggingface.co/nvidia/C-RADIOv4-SO400M/resolve/main/c-radio_v4-so400m_half.pth.tar?download=true",150        patch_size=16,151        max_resolution=2048,152        preferred_resolution=Resolution(512, 512),153        supports_vitdet=True,154    ),155    "c-radio_v4-h": RadioResource(156        # NOTE: C-RADIO models are bound by different license terms than that present in the LICENSE file.157        # Please refer to the readme, or to https://huggingface.co/nvidia/C-RADIOv4-H for more information.158        "https://huggingface.co/nvidia/C-RADIOv4-H/resolve/main/c-radio_v4-h_half.pth.tar?download=true",159        patch_size=16,160        max_resolution=2048,161        preferred_resolution=Resolution(512, 512),162        supports_vitdet=True,163    ),164}165 166DEFAULT_VERSION = "c-radio_v4-h"167