CasiaFan / SSD_EfficientNet

SSD using TensorFlow object detection API with EfficientNet backbone
63 stars 10 forks source link

SSD EfficientNet in tensorflow keras version

Unofficial implementation of SSD with EfficientNet backbone using tf keras.

UPDATE

Here is the link for official EfficientNet implementation for TPU training.

Install Requirement

Usage Steps

  1. Put efficientnet.py and efficient_feature_extractor.py under object_detection/models directory
  2. Modify model_builder.py and add SSDEfficientNetFeatureExtractor and SSDEfficientNetFPNFeatureExtractor
    
    from object_detection.models.efficientnet_feature_extractor import SSDEfficientNetFeatureExtractor, SSDEfficientNetFPNFeatureExtractor

SSD_KERAS_FEATURE_EXTRACTOR_CLASS_MAP = { ... 'ssd_efficientnet': SSDEfficientNetFeatureExtractor, 'ssd_efficientnet_fpn': SSDEfficientNetFPNFeatureExtractor, }


3. Replace `ssd.proto` file under `protos` with this one. **Then make sure to rerun `protoc object_detection/protos/ssd.proto --python_out=.`**
4. Install TensorFlow object detection api: see [here](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md)
5. Train model following [official steps](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_locally.md)
6. Refer to `ssd_efficientnet.config` and `ssd_efficientnet_fpn.config` as example config (If use `ssd_efficientnet_fpn` backbone, make sure `use_explicit_padding` is `true` to prevent potential mismatch error during top down addition operation).