ensemble_loader.py 文件源码

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

项目:carvana-challenge 作者: chplushsieh 项目源码 文件源码
def __getitem__(self, idx):

        img_name = self.img_names[idx]
        ensembled = np.zeros(const.img_size)

        for i, pred_dir in enumerate(self.pred_dirs):
            pred_path = os.path.join(const.OUTPUT_DIR, pred_dir, const.PROBS_DIR_NAME, img_name + '.npy')
            img_prob = np.load(pred_path)

            weighted_img_prob = np.multiply(img_prob, self.weights[i])
            ensembled = np.add(ensembled, weighted_img_prob)

        # save into new output/ folder
        submit.save_ensembled_prob_map(self.ensemble_dir, img_name, ensembled)
        #plt.imshow(ensembled)
        #plt.show()

        return img_name, ensembled
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号