Skip to content

Commit 2d9d794

Browse files
dreamdragonTaylor Robie
authored andcommitted
Fix dependency issues (#5815)
* Add a second expected_loss_weights function using an alternative expectation calculation compared to previous. Integrate this op into ssd_meta_arch and losses builder. Affects files that use losses_builder.build to handle the returning of an additional element. PiperOrigin-RevId: 219190083 * Fix dependency issues. PiperOrigin-RevId: 222888231 * Update CODEOWNERS Add @masonliuw and @Yinxiaoli to /research/lstm_object_detection/
1 parent 23376e6 commit 2d9d794

22 files changed

+146
-80
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/research/lfads/ @jazcollins @susillo
3131
/research/lm_1b/ @oriolvinyals @panyx0718
3232
/research/lm_commonsense/ @thtrieu
33-
/research/lstm_object_detection/ @dreamdragon
33+
/research/lstm_object_detection/ @dreamdragon @masonliuw @yinxiaoli
3434
/research/marco/ @vincentvanhoucke
3535
/research/maskgan/ @a-dai
3636
/research/morph_net/ @gariel-google

research/lstm_object_detection/README

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ http://openaccess.thecvf.com/content_cvpr_2018/papers/Liu_Mobile_Video_Object_CV
1010
year={2018}
1111
}
1212

13-
If you have any questions regarding this codebase, please contact [email protected]
13+
If you have any questions regarding this codebase, please contact us:
14+
15+
16+

research/lstm_object_detection/eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from lstm_object_detection import model_builder
3434
from lstm_object_detection import seq_dataset_builder
3535
from lstm_object_detection.utils import config_util
36-
from google3.third_party.tensorflow_models.object_detection.utils import label_map_util
36+
from object_detection.utils import label_map_util
3737

3838
tf.logging.set_verbosity(tf.logging.INFO)
3939
flags = tf.app.flags

research/lstm_object_detection/evaluator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
import logging
2424
import tensorflow as tf
2525
from lstm_object_detection.metrics import coco_evaluation_all_frames
26-
from google3.third_party.tensorflow_models.object_detection import eval_util
27-
from google3.third_party.tensorflow_models.object_detection.core import prefetcher
28-
from google3.third_party.tensorflow_models.object_detection.core import standard_fields as fields
29-
from google3.third_party.tensorflow_models.object_detection.metrics import coco_evaluation
30-
from google3.third_party.tensorflow_models.object_detection.utils import object_detection_evaluation
26+
from object_detection import eval_util
27+
from object_detection.core import prefetcher
28+
from object_detection.core import standard_fields as fields
29+
from object_detection.metrics import coco_evaluation
30+
from object_detection.utils import object_detection_evaluation
3131

3232

3333
# A dictionary of metric names to classes that implement the metric. The classes

research/lstm_object_detection/lstm/lstm_cells.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
"""BottleneckConvLSTMCell implementation."""
1717

18-
import google3
19-
import tensorflow.google as tf
20-
import google3.learning.brain.contrib.slim as slim
18+
import tensorflow as tf
2119
from tensorflow.contrib.framework.python.ops import variables
2220

21+
slim = tf.contrib.slim
22+
2323
_batch_norm = tf.contrib.layers.batch_norm
2424

2525

@@ -195,4 +195,5 @@ def init_state(self, state_name, batch_size, dtype, learned_state=False):
195195
]
196196
for s, r in zip(state_size, ret_flat):
197197
r.set_shape([None] + s)
198-
return tf.nest.pack_sequence_as(structure=[1, 1], flat_sequence=ret_flat)
198+
return tf.contrib.framework.nest.pack_sequence_as(
199+
structure=[1, 1], flat_sequence=ret_flat)

research/lstm_object_detection/lstm/lstm_meta_arch.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
import re
2424
import tensorflow as tf
2525

26-
from google3.third_party.tensorflow_models.object_detection.core import box_list_ops
27-
from google3.third_party.tensorflow_models.object_detection.core import standard_fields as fields
28-
from google3.third_party.tensorflow_models.object_detection.meta_architectures import ssd_meta_arch
29-
from google3.third_party.tensorflow_models.object_detection.utils import ops
30-
from google3.third_party.tensorflow_models.object_detection.utils import shape_utils
26+
from object_detection.core import box_list_ops
27+
from object_detection.core import standard_fields as fields
28+
from object_detection.meta_architectures import ssd_meta_arch
29+
from object_detection.utils import ops
30+
from object_detection.utils import shape_utils
3131

3232
slim = tf.contrib.slim
3333

research/lstm_object_detection/metrics/coco_evaluation_all_frames.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
import tensorflow as tf
1919

20-
from google3.third_party.tensorflow_models.object_detection.core import standard_fields
21-
from google3.third_party.tensorflow_models.object_detection.metrics import coco_evaluation
22-
from google3.third_party.tensorflow_models.object_detection.metrics import coco_tools
20+
from object_detection.core import standard_fields
21+
from object_detection.metrics import coco_evaluation
22+
from object_detection.metrics import coco_tools
2323

2424

2525
class CocoEvaluationAllFrames(coco_evaluation.CocoDetectionEvaluator):

research/lstm_object_detection/metrics/coco_evaluation_all_frames_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import numpy as np
1919
import tensorflow as tf
2020
from lstm_object_detection.metrics import coco_evaluation_all_frames
21-
from google3.third_party.tensorflow_models.object_detection.core import standard_fields
21+
from object_detection.core import standard_fields
2222

2323

2424
class CocoEvaluationAllFramesTest(tf.test.TestCase):

research/lstm_object_detection/model_builder.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
"""A function to build a DetectionModel from configuration."""
1717
from lstm_object_detection.lstm import lstm_meta_arch
1818
from lstm_object_detection.models.lstm_ssd_mobilenet_v1_feature_extractor import LSTMMobileNetV1FeatureExtractor
19-
from google3.third_party.tensorflow_models.object_detection.builders import anchor_generator_builder
20-
from google3.third_party.tensorflow_models.object_detection.builders import box_coder_builder
21-
from google3.third_party.tensorflow_models.object_detection.builders import box_predictor_builder
22-
from google3.third_party.tensorflow_models.object_detection.builders import hyperparams_builder
23-
from google3.third_party.tensorflow_models.object_detection.builders import image_resizer_builder
24-
from google3.third_party.tensorflow_models.object_detection.builders import losses_builder
25-
from google3.third_party.tensorflow_models.object_detection.builders import matcher_builder
26-
from google3.third_party.tensorflow_models.object_detection.builders import model_builder
27-
from google3.third_party.tensorflow_models.object_detection.builders import post_processing_builder
28-
from google3.third_party.tensorflow_models.object_detection.builders import region_similarity_calculator_builder as sim_calc
29-
from google3.third_party.tensorflow_models.object_detection.core import target_assigner
19+
from object_detection.builders import anchor_generator_builder
20+
from object_detection.builders import box_coder_builder
21+
from object_detection.builders import box_predictor_builder
22+
from object_detection.builders import hyperparams_builder
23+
from object_detection.builders import image_resizer_builder
24+
from object_detection.builders import losses_builder
25+
from object_detection.builders import matcher_builder
26+
from object_detection.builders import model_builder
27+
from object_detection.builders import post_processing_builder
28+
from object_detection.builders import region_similarity_calculator_builder as sim_calc
29+
from object_detection.core import target_assigner
3030

3131
model_builder.SSD_FEATURE_EXTRACTOR_CLASS_MAP.update({
3232
'lstm_mobilenet_v1': LSTMMobileNetV1FeatureExtractor,
@@ -125,7 +125,7 @@ def _build_lstm_model(ssd_config, lstm_config, is_training):
125125
non_max_suppression_fn, score_conversion_fn = post_processing_builder.build(
126126
ssd_config.post_processing)
127127
(classification_loss, localization_loss, classification_weight,
128-
localization_weight, miner, _) = losses_builder.build(ssd_config.loss)
128+
localization_weight, miner, _, _) = losses_builder.build(ssd_config.loss)
129129

130130
normalize_loss_by_num_matches = ssd_config.normalize_loss_by_num_matches
131131
encode_background_as_zeros = ssd_config.encode_background_as_zeros

research/lstm_object_detection/model_builder_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from lstm_object_detection import model_builder
2121
from lstm_object_detection.lstm import lstm_meta_arch
2222
from lstm_object_detection.protos import pipeline_pb2 as internal_pipeline_pb2
23-
from google3.third_party.tensorflow_models.object_detection.protos import pipeline_pb2
23+
from object_detection.protos import pipeline_pb2
2424

2525

2626
class ModelBuilderTest(tf.test.TestCase):

0 commit comments

Comments
 (0)