Пример #1
0
 def _setup_net(self, saved_vars_dict):
     model_output = basic_net(self.cnn_net, self.data_batches,
                              self.config.num_classes, False)
     self.output = tf.reshape(model_output, (-1, ), self.OUTPUT_NODE_NAME)
     assign_ops = assign_vars(self._vars(), saved_vars_dict)
     self.initializer = tf.group(*assign_ops,
                                 name=self.INITIALIZER_NODE_NAME)
Пример #2
0
    def _setup_net(self, saved_vars_dict):
        self.length_output, self.numbers_output = nsr_net(
            self.cnn_net, self.data_batches, self.config.max_number_length,
            self.is_training)

        self.output = stack_output(self.max_number_length,
                                   self.length_output,
                                   self.numbers_output,
                                   name='output')
        assign_ops = assign_vars(self._vars(), saved_vars_dict)
        self.initializer = tf.group(*assign_ops, name='initializer')
Пример #3
0
    def _setup_net(self, saved_vars_dict):
        with self.cnn_net.variable_scope([self.data_batches]) as vs:
            collection_name = self.cnn_net.end_points_collection_name(vs)
            net_out, _ = self.cnn_net.cnn_layers(self.data_batches,
                                                 vs,
                                                 collection_name,
                                                 is_training=self.is_training)

        self.output = tf.reshape(
            net_out,
            [H * W * (self.config.num_classes + 5) * self.max_number_length],
            name=YOLOToExportModel.OUTPUT_NODE_NAME)

        _, self.output_boxes, self.output_classes, self.output_classes_probs = \
            build_export_output(net_out, H, W, self.max_number_length, self.config.num_classes, self.config.threshold)
        self.output_boxes = tf.identity(self.output_boxes, name='output_boxes')
        self.output_classes = tf.identity(self.output_classes,
                                          'output_classes')
        self.output_classes_probs = tf.identity(self.output_classes_probs,
                                                'output_classes_probs')

        assign_ops = assign_vars(self._vars(), saved_vars_dict)
        self.initializer = tf.group(*assign_ops, name='initializer')