I  was asking the last time, if we can use neural network to predict if each pixel in an image is a corner of a box. I want to know
1-  if this code is  correct or not:
2- whene i got the probabilities, how can i distinct the probability of the top left corner from the probability of bottom right corner or the auther
image input_size = 512
import torch
import torch.nn as nn
import torch.nn.functional as F
class corner_predict(nn.Module):
declarations…
dim_out = 512*3 (3 if the pixel is Top left corner, bottom right corner, auther)
self.base_conv = nn.conv2D(512, 512, 3, 1, 1, bias=True)
self.class_pred = nn.conv2D( 512, dim_out, 1, 1, 0)
self.class_loss = 0
def forward (image, bbox):
conv1 =   F.relu(self.base_conv(image), inplace=True)
conv2 = self.class_pred(conv1)
prob_corner = F.sigmoid(conv2)
------- loss calculations