stevewongv / InstanceShadowDetection

Instance Shadow Detection (CVPR 2020)
Apache License 2.0
161 stars 24 forks source link

what is the difference between LISARPNHEAD and STANDARDRPNHEAD #19

Closed I3aer closed 2 years ago

I3aer commented 2 years ago

https://github.com/stevewongv/InstanceShadowDetection/blob/1b75e94394ec0abb8cb39820d6311994efca27cf/projects/LISA/LISA/LISA_rpn.py#L34

`@RPN_HEAD_REGISTRY.register() class LISARPNHead(StandardRPNHead): def init(self, cfg, input_shape: List[ShapeSpec], shadow_object_part=False): super().init(cfg,input_shape)

    if shadow_object_part:
        in_channels = [s.channels for s in input_shape]

        assert len(set(in_channels)) == 1, "Each level must have the same channel!"

        in_channels = in_channels[0]
        self.conv = nn.Conv2d(in_channels , in_channels, kernel_size=3, stride=1, padding=1)

        for l in [self.conv]:
            nn.init.normal_(l.weight, std=0.01)
            nn.init.constant_(l.bias, 0)

def forward(self, features):
    """
    Args:
        features (list[Tensor]): list of feature maps
    """

    pred_objectness_logits = []

    pred_anchor_deltas = []

    for i,x in enumerate(features):

        t = F.relu(self.conv(x))

        pred_objectness_logits.append(self.objectness_logits(t))
        pred_anchor_deltas.append(self.anchor_deltas(t))

    return pred_objectness_logits, pred_anchor_deltas`

I think you duplicate the standard one. Did you check what you implement? The code is terrible. You delete some arguments. Probably, your network is not working. It probably remembers samples. How these papers are accepted to be published :(

stevewongv commented 2 years ago

This code was based on Detectron 0.1. We extended the standard RPN to generate two kinds of region proposals for shadow/object instances and shadow-object associations. Why do you say that we just duplicate the standard one? The standard one is here. This is the first work that proposes to detect shadow/object association. The performance is not very good, but it works on many scenes. I don't see your patient and respect to other people's work.

I3aer commented 2 years ago

You inherit the standard one, class LISARPNHead(StandardRPNHead) This makes them same. Your self.conv is same as that in the standard rpn head. I did not say the originality of your work. As I see, class StandardRPNHead(nn.Module) is same as class LISARPNHead(StandardRPNHead).