Release evaluated research models, portable configurations and parameter verification
a6303b7 verified |
Download USAGE.md from PeterPonyu/rotcert-models: direct link, hf CLI and curl.
- Browser
- Download file 5.64 kB
-
https://huggingface.co/PeterPonyu/rotcert-models/resolve/main/USAGE.md
- Command line
-
hf download hf://PeterPonyu/rotcert-models/USAGE.md
-
curl -L -o USAGE.md https://huggingface.co/PeterPonyu/rotcert-models/resolve/main/USAGE.md
5.64 kB
| # Loading the evaluated parameters | |
| Use the model-specific configuration and source revision listed in `MANIFEST.json`. | |
| Keep the dataset's original category order, image pipeline, angle convention, | |
| matching protocol and score threshold; changing them changes the experiment. | |
| The files are not a Transformers `from_pretrained` package or a hosted inference | |
| service. | |
| ## Download one fixed repository revision | |
| The following example obtains the current public revision once and uses it for | |
| both files. For a cited experiment, retain that revision and the manifest hashes. | |
| The code downloads parameters but does not run inference. | |
| ```python | |
| from huggingface_hub import HfApi, hf_hub_download | |
| import torch | |
| repo = "PeterPonyu/rotcert-models" | |
| revision = HfApi(token=False).model_info(repo).sha | |
| folder = "dior/train-only-validation-check/oriented-rcnn/seed-0" | |
| weights = hf_hub_download(repo, folder + "/inference.pth", revision=revision, token=False) | |
| config = hf_hub_download(repo, folder + "/config.py", revision=revision, token=False) | |
| checkpoint = torch.load(weights, map_location="cpu", weights_only=True) | |
| state_dict = checkpoint["state_dict"] | |
| ``` | |
| All public weights contain only tensors. Use a PyTorch version supporting | |
| `weights_only=True`. The export was checked in the original framework runtime and | |
| again in a separate CPU runtime; this is not a compatibility test of every | |
| PyTorch or CUDA version. Do not disable restricted loading for an unrelated | |
| downloaded file. | |
| ## MMRotate detector families | |
| The evaluated source revision is | |
| `open-mmlab/mmrotate@3ff004eb21ea040455b5585db229edba4037f1bf`. | |
| The original evaluation environment used MMRotate 1.0.0rc1, MMDetection 3.3.0, | |
| MMEngine 0.10.5, MMCV 2.1.0 and PyTorch 2.1.0 with CUDA 12.1. These are recorded | |
| versions, not a promise that installation works on every current platform. | |
| Each resolved `config.py` includes the actual model, image | |
| normalization, test transforms, box coding, angle representation and evaluation | |
| settings. The exact category order from the original checkpoints is in | |
| `MODEL-METADATA.json`; do not infer it from a different dataset implementation. | |
| Replace only the dataset and output locations for an authorized local | |
| copy. The public derivatives use the top-level `state_dict` accepted by the | |
| standard MMEngine checkpoint loader. Evaluation uses an explicit checkpoint, | |
| not resume mode; do not substitute `ema_state_dict` from a training checkpoint. | |
| Within the identified MMRotate source and compatible environment, use | |
| `tools/test.py` with the matching `config.py` and `inference.pth`. Read the | |
| configuration before setting local data locations: a command-line `data_root` | |
| override alone does not rewrite all already-resolved nested paths. Standard | |
| detector evaluation does not reproduce the later RotCert calibration analyses | |
| without their separate source-level records. The saved configuration's default | |
| test-loader list is `ImageSets/Main/trainval.txt`; that is not itself the official | |
| held-out validation role used by the later export driver. Evaluation on the | |
| reported validation/test populations also requires the correct official lists, | |
| role IDs and documented driver overrides. Do not interpret a default test-loader | |
| run as reproduction of the validation-check results. | |
| ## EAV-DETR on CODrone | |
| Obtain the identified upstream source separately: | |
| `zzzhak/EAV-DETR@fb99da7b0f49edffcd1fa9e45a4424e9ae86e1eb`. | |
| It is not redistributed here. The public file is a top-level `model` mapping made | |
| from the final evaluated `model` branch. The preserved original and export | |
| receipts identify that branch; no EMA branch is present or substituted. | |
| The model construction and strict parameter load can be checked as follows in | |
| that source and its compatible environment. `config_path` and `weights_path` | |
| below refer to the downloaded model's own files, not upstream example weights. | |
| This snippet constructs and loads the model; it does not rerun the full dataset. | |
| ```python | |
| from huggingface_hub import HfApi, hf_hub_download | |
| import torch | |
| from src.core import YAMLConfig | |
| repo = "PeterPonyu/rotcert-models" | |
| revision = HfApi(token=False).model_info(repo).sha | |
| folder = "codrone/final-epoch-evaluation/eav-detr/seed-42" | |
| config_path = hf_hub_download(repo, folder + "/config.yml", revision=revision, token=False) | |
| weights_path = hf_hub_download(repo, folder + "/inference.pth", revision=revision, token=False) | |
| cfg = YAMLConfig(config_path) | |
| model = cfg.model.cpu() | |
| state = torch.load(weights_path, map_location="cpu", weights_only=True)["model"] | |
| model.load_state_dict(state, strict=True) | |
| model.eval() | |
| ``` | |
| The original export used PyTorch 2.4.0 with CUDA 12.1. Use the category order | |
| in `MODEL-METADATA.json` (checked against all ten export receipts), the supplied | |
| configuration and the pinned CODrone loader. Model construction may obtain the | |
| configured pretrained backbone before loading the final model; this dependency | |
| is not bundled or newly licensed here. The reported full exports used all | |
| 56,000 validation tiles and 84,056 test tiles, retaining queries with maximum | |
| class probability at least 0.05. A monitoring loader may limit samples; running | |
| it unchanged is not the full exported experiment. Box outputs are normalized | |
| center-x, center-y, width, height and angle in radians. AP from those retained | |
| outputs remains score-truncated. Native EAV and common-HCP analysis also require | |
| their distinct matching and calibration protocols. | |
| The reproduction driver for the complete exports and statistical analyses is a | |
| separate software/input requirement. The illustrative loading snippets are not | |
| an assertion that full inference was newly rerun for this release. | |