Skip to content

Add from_checkpoint method that directly infers the model class#664

Open
omkar-334 wants to merge 1 commit intoroboflow:developfrom
omkar-334:infer-model
Open

Add from_checkpoint method that directly infers the model class#664
omkar-334 wants to merge 1 commit intoroboflow:developfrom
omkar-334:infer-model

Conversation

@omkar-334
Copy link
Contributor

@omkar-334 omkar-334 commented Feb 11, 2026

Tries to solve #651.
Now, we can load models using

import rfdetr

model_path = "rfdetr_model.pth"
model = rfdetr.from_checkpoint(model_path)

@ashwin3005
Copy link

hi @omkar-334 ,

are we trying to infer the model class from the "file name" of the saved weights?

@omkar-334
Copy link
Contributor Author

hi @ashwin3005 , we are trying to extract the model size from pretrained_weights argument

@ashwin3005
Copy link

yeah, but you are comparing predefined names against weights_name. which is a string.

weights_name = str(args.pretrain_weights).lower()

what if the model weights are saved using a different name?

@Borda Borda force-pushed the develop branch 3 times, most recently from 60b16c1 to 523f9df Compare February 14, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments