Could you please guide me how to use an HourGlass Network here that is pretrained on human pose instead of this ResNet18?
num_classes = 4 * 2 #4 coordinates X and Y flattened --> 4 of 2D keypoints or landmarks
class Network(nn.Module):
def __init__(self,num_classes=8):
super().__init__()
self.model_name = 'resnet18'
self.model = models.resnet18()
self.model.fc = nn.Linear(self.model.fc.in_features, num_classes)
def forward(self, x):
x = x.float()
out = self.model(x)
return out
For example, I found this Stacked Hourglass code for facial landmark detection which is a similar problem. How can I use it in my own PyTorch code such as I am calling models.resnet18()? Also, are there more standard implementations of Stacked hourglass network since it is a pretty much famous network (or any other baseline for human pose estimation with pretraining enabled)?
Here’s another Hourglass code I found in PyTorch https://github.com/bearpaw/pytorch-pose/blob/master/pose/models/hourglass.py