(repo_path: str, checkpoint_path: str)
| 42 | |
| 43 | |
| 44 | def get_instance(repo_path: str, checkpoint_path: str): |
| 45 | import sys |
| 46 | |
| 47 | sys.path.insert(0, repo_path) |
| 48 | |
| 49 | from models.modules.mobileone import reparameterize_model |
| 50 | from timm.models import create_model |
| 51 | |
| 52 | checkpoint = torch.load(checkpoint_path, weights_only=True) |
| 53 | model = create_model("fastvit_s12") |
| 54 | model = reparameterize_model(model).eval() |
| 55 | model.load_state_dict(checkpoint["state_dict"]) |
| 56 | return model |
| 57 | |
| 58 | |
| 59 | def main(args): |