配置FCN 8s voc数据集

按着博文http://blog.csdn.net/u012968002/article/details/78958090 的流程走的  主要是各种路径要搞清楚 参见http://blog.csdn.net/supe_king/article/details/58121993

中间出现在网上找的方法个版本不管用  后来发现 还是路径的问题。

solve.py  的路径好确定  关键是train.protxt    test.protxt 中


sbdd是存放数据集的路径  我的是/home/chenge/Documents/FCN/fcn/data/pascal  pascal下存放了训练图测试图(都放在一块 用train.txt test.txt调用即可)标签


我开始的错误就是把 训练的txt和测试的txt都放在了和voc2011文件夹平行的位置  后来放进voc2011就可以运行了

在voc_layers.py中 改6处路径1.放test.txt的位置split_f  = '{}/{}.txt'.format(self.voc_dir,
                self.split)意思就是直接读取之前test.protxt中路径split

                                               2.测试图im = Image.open('{}/JPEGImages/{}.jpg'.format(self.voc_dir, idx)) 前面的框就是test中sbdd_dir

                                                        3.测试标签  im = Image.open('{}/SegmentationClass/{}.png'.format(self.voc_dir, idx))
        label = np.array(im, dtype=np.uint8)

   之后的训练的路径同理

给的模板程序训练标签是mat格式  可以改程序变为pgn格式的。

def load_label(self, idx):  
        """
        Load label image as 1 x height x width integer array of label indices.
        The leading singleton dimension is required by the loss.
        """  
        im = Image.open('{}/SegmentationClass/{}.png'.format(self.sbdd_dir, idx))
        label = np.array(im, dtype=np.uint8)  
        label = label[np.newaxis, ...]  
        return label 





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值