def __init__(self, settings, state, cache, loop_sleep, heartbeat_required):
     CodependentThread.__init__(self, heartbeat_required)
     self.daemon = True
     self.settings = settings
     self.state = state
     self.cache = cache
     self.loop_sleep = loop_sleep
     self.debug_level = 0
Ejemplo n.º 2
0
    def __init__(self, net, state, loop_sleep, pause_after_keys, heartbeat_required):
        CodependentThread.__init__(self, heartbeat_required)
        self.daemon = True
        self.net = net
        self.input_dims = self.net.blobs['data'].data.shape[2:4]    # e.g. (227,227)
        self.state = state
        self.frames_processed_fwd = 0
        self.frames_processed_back = 0
        self.loop_sleep = loop_sleep
        self.pause_after_keys = pause_after_keys
        self.debug_level = 0
        self.descriptor = None
        self.descriptor_layer_1 = 'conv5'
        self.descriptor_layer_2 = 'conv4'
        self.descriptor_layers = ['conv5','conv4']
        self.net_input_image = None
        self.descriptor_handler = DescriptorHandler(self.state.settings.ros_dir + '/models/memory/', self.descriptor_layers)
        self.data_handler = DataHandler(self.state.settings.ros_dir)
        self.available_layer = ['conv1', 'pool1', 'norm1', 'conv2', 'pool2', 'norm2', 'conv3', 'conv4', 'conv5', 'pool5', 'fc6', 'fc7', 'fc8', 'prob']
        #['conv1', 'conv2', 'conv3', 'conv4', 'conv5', 'fc6', 'fc7', 'fc8', 'prob']
        # print "layers ", list(self.net._layer_names)

        s = rospy.Service('get_cnn_state', GetState, self.handle_get_cnn_state)