Using HourGlass Network pretrained on human pose in a similar scenario such as calling models.resnet18()

Hi,

You just need to instantiate the desired model for instance self.model = HourGlass(args). Also, you need to load weights and state dict which you can find it here. (note that do not set model in eval mode)

But as you might know, in the following line,

        self.model.fc = nn.Linear(self.model.fc.in_features, num_classes)

the author replaces last linear layer to match their desired number of output classes. In your case, you need to find model definition (you can use this thread), and the change the appropriate layer based on the model definition.

Unfortunately I don’t know any implemenation of HourGlass.

Let me know if you had any troubles.

Bests