Exemple #1
0
    def _gen_anchors(self, config, feature_map_shape):
        model = FasterRCNN(config)
        results = model._generate_anchors(feature_map_shape)

        with self.test_session() as sess:
            sess.run(tf.global_variables_initializer())
            results = sess.run(results)
            return results
Exemple #2
0
    def _gen_anchors(self, config, feature_map_shape):
        model = FasterRCNN(config)
        results = model._generate_anchors(feature_map_shape)

        with self.test_session() as sess:
            sess.run(tf.global_variables_initializer())
            results = sess.run(results)
            return results
Exemple #3
0
 def _get_losses(self, config, prediction_dict, image_size):
     image = tf.placeholder(tf.float32, shape=self.image.shape)
     gt_boxes = tf.placeholder(tf.float32, shape=self.gt_boxes.shape)
     model = FasterRCNN(config)
     model(image, gt_boxes)
     all_losses = model.loss(prediction_dict, return_all=True)
     with self.test_session() as sess:
         sess.run(tf.global_variables_initializer())
         all_losses = sess.run(all_losses)
         return all_losses
Exemple #4
0
 def _get_losses(self, config, prediction_dict, image_size):
     image = tf.placeholder(
         tf.float32, shape=self.image.shape)
     gt_boxes = tf.placeholder(
         tf.float32, shape=self.gt_boxes.shape)
     model = FasterRCNN(config)
     model(image, gt_boxes, is_training=True)
     all_losses = model.loss(prediction_dict, return_all=True)
     with self.test_session() as sess:
         sess.run(tf.global_variables_initializer())
         all_losses = sess.run(all_losses)
         return all_losses
Exemple #5
0
    def _run_network(self):
        image = tf.placeholder(tf.float32, shape=self.image.shape)
        gt_boxes = tf.placeholder(tf.float32, shape=self.gt_boxes.shape)
        model = FasterRCNN(self.config)

        results = model(image, gt_boxes)

        with self.test_session() as sess:
            sess.run(tf.global_variables_initializer())
            results = sess.run(results,
                               feed_dict={
                                   gt_boxes: self.gt_boxes,
                                   image: self.image,
                               })
            return results