state_indexer.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:harpreif 作者: harpribot 项目源码 文件源码
def __init__(self, image_dir, checkpoint_dir, checkpoint_iter, num_actions, num_gradients, state_type):
        """

        :param image_dir: The test directory for images
        :param checkpoint_dir: The checkpoint containing the best learnt model weights and biases
        :param num_actions: Number of actions that the agent can take
        :param num_gradients: Number of gradients to be used for each window
        :param state_type: 'hog' for using windowed HOG gradient as state, 'image' for using raw images itself
        """
        self.state_type = state_type
        self.image_dir = image_dir
        self.bins = np.array([x / float(NUM_BINS) for x in range(0, NUM_BINS, 1)])
        self.sess = None
        self.checkpoint_dir = checkpoint_dir
        self.checkpoint_iter = checkpoint_iter
        self.num_actions = num_actions
        self.num_gradients = num_gradients
        if self.state_type == 'hog':
            self.input_channels = self.num_gradients
        elif self.state_type == 'image':
            self.input_channels = 1
        else:
            raise ValueError('State type not recognized, enter hog or image')

        self.input_height = len(range(0, IMAGE_HEIGHT - SLIDING_STRIDE, SLIDING_STRIDE))
        self.input_width = self.input_height
        self.imagenet = None
        # self.feature_dict = dict()
        self.state_height = self.input_height
        self.state_width = self.state_height
        self.save_transform = True
        self.im2f_loc = None
        self.feature_size = None
        Creator.__init__(self, self.input_channels, self.num_actions, self.input_height, self.input_width)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号