# in torch env
pip install timm
pip install effdet
sc = StandaloneConfig() # creates a bifpn layout with fast attn
e = ExampleNet(sc)
o = e(torch.randn(2, 3, 512, 512))
for x in o:
print(x.shape)
>>> torch.Size([2, 88, 64, 64])
>>> torch.Size([2, 88, 32, 32])
>>> torch.Size([2, 88, 16, 16])
>>> torch.Size([2, 88, 8, 8])
>>> torch.Size([2, 88, 4, 4])
sc = StandaloneConfig(fpn_name='qufpn_fa', fpn_cell_repeats=4, fpn_channels=128, min_level=5, max_level=7)
e = ExampleNet(sc)
o = e(torch.randn(2, 3, 512, 512))
for x in o:
print(x.shape)
>>> torch.Size([2, 128, 16, 16])
>>> torch.Size([2, 128, 8, 8])
>>> torch.Size([2, 128, 4, 4])
sc = StandaloneConfig(fpn_name='pan_fa', fpn_cell_repeats=5, fpn_channels=128, min_level=4, max_level=7)
e = ExampleNet(sc)
o = e(torch.randn(2, 3, 512, 512))
for x in o:
print(x.shape)
torch.Size([2, 128, 32, 32])
torch.Size([2, 128, 16, 16])
torch.Size([2, 128, 8, 8])
torch.Size([2, 128, 4, 4])
FPN vs PAN vs BiFPN from EfficentDet Paper: https://arxiv.org/abs/1911.09070