EfficientDet.Pytorch icon indicating copy to clipboard operation
EfficientDet.Pytorch copied to clipboard

The official Tensorflow implementation is now available.

Open rmcavoy opened this issue 4 years ago • 9 comments

https://github.com/google/automl/blob/master/efficientdet/efficientdet_arch.py

rmcavoy avatar Mar 18 '20 12:03 rmcavoy

But in tensorflow

qtw1998 avatar Mar 23 '20 06:03 qtw1998

Yes unfortunately but it can be used to correct the numerous problems with all the public PyTorch implementations. Like for example, the original tensorflow code has three convolution layers per feature level in the bifpn, two 1x1 layers that are used to bring them into the same feature space on the upwards and downwards passes respectively and one Depthwise separable one that is applied after a BiFPN step (the one made explicit in the BiFPN math in the paper)

rmcavoy avatar Mar 23 '20 11:03 rmcavoy

The tensorflow code also confirmed my assumption that every convolution in the fpn+box network is either 1x1 or depthwise separable

rmcavoy avatar Mar 23 '20 11:03 rmcavoy

Yes unfortunately but it can be used to correct the numerous problems with all the public PyTorch implementations. Like for example, the original tensorflow code has three convolution layers per feature level in the bifpn, two 1x1 layers that are used to bring them into the same feature space on the upwards and downwards passes respectively and one Depthwise separable one that is applied after a BiFPN step (the one made explicit in the BiFPN math in the paper)

Nice, can you make a PR to this repo to fix the issue ?

Cyril9227 avatar Mar 24 '20 07:03 Cyril9227

@rmcavoy I would suggest you fork this repo and create a modified version. Author of this repo seems to have disappeared. Link that repo here

bluesky314 avatar Mar 24 '20 08:03 bluesky314

Unfortunately my ability to directly contribute code to open source repos is limited by my work (pretty sure I would need to do various kinds of paperwork for approval of such contributions)

rmcavoy avatar Mar 24 '20 12:03 rmcavoy

FYI, I decided to get a version of EfficientDet running now that an official reference is available. I saw this issue searching through the pre-existing PyTorch impls out there for a starting point. None of them fit with my approach so I started from scratch earlier this week. Model is 80% done, then I'll hack together a weight port and a basic validation script. Might have something to release later next week...

EDIT: This is where it will live when it's done (nothing there yet but the plan) - https://github.com/rwightman/efficientdet-pytorch

rwightman avatar Mar 26 '20 21:03 rwightman

FYI, I decided to get a version of EfficientDet running now that an official reference is available. I saw this issue searching through the pre-existing PyTorch impls out there for a starting point. None of them fit with my approach so I started from scratch earlier this week. Model is 80% done, then I'll hack together a weight port and a basic validation script. Might have something to release later next week...

That would be wonderful ! The google's repo is awful to use in a research-oriented env, even only extracting the model itself is tedious and the other Pytorch implementation out there are not convincing. Thank you very much

Cyril9227 avatar Mar 27 '20 06:03 Cyril9227

@rwightman Could you please make the segmentation model as well, it is really simple, the paper just says

Following [16], we modify our EfficientDet model to keep feature level {P2,P3,...,P7} in BiFPN, but only use P2 for the final per-pixel classification. For simplicity, here we only evaluate a EfficientDet-D4 based model, which uses a Ima- geNet pretrained EfficientNet-B4 backbone (similar size to ResNet-50). We set the channel size to 128 for BiFPN and 256 for classification head. Both BiFPN and classification head are repeated by 3 times.

It would be super helpful as even google has not released it

bluesky314 avatar Mar 27 '20 15:03 bluesky314