Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaged application #878

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion efficientdet/aug/autoaugment.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import tensorflow.compat.v1 as tf
from tensorflow_addons import image as image_ops

import hparams_config
from .. import hparams_config

# This signifies the max integer that the controller RNN could predict for the
# augmentation scheme.
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/aug/autoaugment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@
# limitations under the License.
# ==============================================================================
"""Tests for Autoaugment."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.aug
__package__ = "efficientdet.aug"

from absl import logging
import tensorflow.compat.v1 as tf

from aug import autoaugment
from . import autoaugment


class AutoaugmentTest(tf.test.TestCase):
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/aug/gridmask_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@
# limitations under the License.
# ==============================================================================
"""GridMask Augmentation simple test."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.aug
__package__ = "efficientdet.aug"

from absl import logging
import tensorflow.compat.v1 as tf

from aug import gridmask
from . import gridmask


class GridMaskTest(tf.test.TestCase):
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/aug/mosaic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@
# limitations under the License.
# ==============================================================================
"""Mosaic Augmentation simple test."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.aug
__package__ = "efficientdet.aug"

from absl import logging
import tensorflow.compat.v1 as tf

from aug import mosaic
from . import mosaic


class MosaicTest(tf.test.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions efficientdet/backbone/backbone_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from absl import logging
import tensorflow as tf

from backbone import efficientnet_builder
from backbone import efficientnet_lite_builder
from backbone import efficientnet_model
from . import efficientnet_builder
from . import efficientnet_lite_builder
from . import efficientnet_model


def get_model_builder(model_name):
Expand Down
4 changes: 2 additions & 2 deletions efficientdet/backbone/efficientnet_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import numpy as np
import tensorflow as tf

import utils
from backbone import efficientnet_model
from .. import utils
from . import efficientnet_model


def efficientnet_params(model_name):
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/backbone/efficientnet_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@
# limitations under the License.
# ==============================================================================
"""Tests for efficientnet_builder."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.backbone
__package__ = "efficientdet.backbone"

from absl import logging
import numpy as np
import tensorflow.compat.v1 as tf

from backbone import efficientnet_builder
from . import efficientnet_builder


class EfficientnetBuilderTest(tf.test.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions efficientdet/backbone/efficientnet_lite_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from absl import logging
import tensorflow.compat.v1 as tf

import utils
from backbone import efficientnet_builder
from backbone import efficientnet_model
from .. import utils
from . import efficientnet_builder
from . import efficientnet_model

# Edge models use inception-style MEAN and STDDEV for better post-quantization.
MEAN_RGB = [127.0, 127.0, 127.0]
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/backbone/efficientnet_lite_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@
# limitations under the License.
# ==============================================================================
"""Tests for efficientnet_lite_builder."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.backbone
__package__ = "efficientdet.backbone"

from absl import logging
import numpy as np
import tensorflow.compat.v1 as tf

from backbone import efficientnet_lite_builder
from . import efficientnet_lite_builder


class EfficientnetBuilderTest(tf.test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion efficientdet/backbone/efficientnet_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from six.moves import xrange
import tensorflow as tf

import utils
from .. import utils

GlobalParams = collections.namedtuple('GlobalParams', [
'batch_norm_momentum', 'batch_norm_epsilon', 'dropout_rate', 'data_format',
Expand Down
13 changes: 11 additions & 2 deletions efficientdet/backbone/efficientnet_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@
# limitations under the License.
# ==============================================================================
"""Tests for efficientnet_model."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.backbone
__package__ = "efficientdet.backbone"

from absl import logging
import tensorflow.compat.v1 as tf

import utils
from backbone import efficientnet_model
from .. import utils
from . import efficientnet_model


class ModelTest(tf.test.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion efficientdet/coco_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from pycocotools.cocoeval import COCOeval
import tensorflow as tf

from keras import label_util
from .keras import label_util


class EvaluationMetric():
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/coco_metric_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@
# ==============================================================================
"""Tests for coco_metric."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import efficientdet
__package__ = "efficientdet"


from absl import logging
import tensorflow.compat.v1 as tf
import coco_metric
from . import coco_metric


class CocoMetricTest(tf.test.TestCase):
Expand Down
8 changes: 4 additions & 4 deletions efficientdet/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
from absl import logging
import tensorflow as tf

import utils
from keras import anchors
from object_detection import preprocessor
from object_detection import tf_example_decoder
from . import utils
from .keras import anchors
from .object_detection import preprocessor
from .object_detection import tf_example_decoder


class InputProcessor:
Expand Down
19 changes: 14 additions & 5 deletions efficientdet/dataloader_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@
# limitations under the License.
# ==============================================================================
"""Data loader and processing test cases."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import efficientdet
__package__ = "efficientdet"

import os
import tempfile
import tensorflow as tf

import dataloader
import hparams_config
from dataset import tfrecord_util
from keras import anchors
from object_detection import tf_example_decoder
from . import dataloader
from . import hparams_config
from .dataset import tfrecord_util
from .keras import anchors
from .object_detection import tf_example_decoder


class DataloaderTest(tf.test.TestCase):
Expand Down
13 changes: 11 additions & 2 deletions efficientdet/dataset/create_coco_tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.dataset
__package__ = "efficientdet.dataset"

r"""Convert raw COCO 2017 dataset to TFRecord.

Example usage:
Expand Down Expand Up @@ -39,8 +48,8 @@

from pycocotools import mask
import tensorflow as tf
from dataset import label_map_util
from dataset import tfrecord_util
from . import label_map_util
from . import tfrecord_util

flags.DEFINE_boolean(
'include_masks', False, 'Whether to include instance segmentations masks '
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/dataset/create_coco_tfrecord_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
# ==============================================================================
"""Test for create_coco_tfrecord.py."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.dataset
__package__ = "efficientdet.dataset"


import io
import json
import os
Expand All @@ -25,7 +34,7 @@
import six
import tensorflow as tf

from dataset import create_coco_tfrecord
from . import create_coco_tfrecord


class CreateCocoTFRecordTest(tf.test.TestCase):
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/dataset/create_pascal_tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.dataset
__package__ = "efficientdet.dataset"

r"""Convert PASCAL dataset to TFRecord.

Example usage:
Expand All @@ -31,7 +40,7 @@
import PIL.Image
import tensorflow as tf

from dataset import tfrecord_util
from . import tfrecord_util

flags.DEFINE_string('data_dir', '', 'Root directory to raw PASCAL VOC dataset.')
flags.DEFINE_string('set', 'train', 'Convert training set, validation set or '
Expand Down
11 changes: 10 additions & 1 deletion efficientdet/dataset/create_pascal_tfrecord_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
# ==============================================================================
"""Test for create_pascal_tfrecord.py."""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.dataset
__package__ = "efficientdet.dataset"


import os

from absl import logging
Expand All @@ -22,7 +31,7 @@
import six
import tensorflow as tf

from dataset import create_pascal_tfrecord
from . import create_pascal_tfrecord


class CreatePascalTFRecordTest(tf.test.TestCase):
Expand Down
17 changes: 13 additions & 4 deletions efficientdet/dataset/inspect_tfrecords.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
# ==============================================================================
"""Inspection of dataset"""

import os
import sys
# Allow relative imports when being executed as script.
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
import efficientdet.dataset
__package__ = "efficientdet.dataset"


import os
import sys

Expand All @@ -23,10 +32,10 @@
from PIL import Image

sys.path.append('./')
import dataloader
import hparams_config
import utils
from visualize import vis_utils
from .. import dataloader
from .. import hparams_config
from .. import utils
from ..visualize import vis_utils

flags.DEFINE_string('save_samples_dir', 'tfrecord_samples',
'Location of samples to save')
Expand Down
Loading