當前位置: 首頁>>代碼示例>>Python>>正文


Python IMDB.merge_roidbs方法代碼示例

本文整理匯總了Python中imdb.IMDB.merge_roidbs方法的典型用法代碼示例。如果您正苦於以下問題:Python IMDB.merge_roidbs方法的具體用法?Python IMDB.merge_roidbs怎麽用?Python IMDB.merge_roidbs使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在imdb.IMDB的用法示例。


在下文中一共展示了IMDB.merge_roidbs方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: selective_search_roidb

# 需要導入模塊: from imdb import IMDB [as 別名]
# 或者: from imdb.IMDB import merge_roidbs [as 別名]
def selective_search_roidb(self, gt_roidb, append_gt=False):
        """
        get selective search roidb and ground truth roidb
        :param gt_roidb: ground truth roidb
        :param append_gt: append ground truth
        :return: roidb of selective search
        """
        cache_file = os.path.join(self.cache_path, self.name + '_ss_roidb.pkl')
        if os.path.exists(cache_file):
            with open(cache_file, 'rb') as fid:
                roidb = cPickle.load(fid)
            print '{} ss roidb loaded from {}'.format(self.name, cache_file)
            return roidb

        if append_gt:
            print 'appending ground truth annotations'
            ss_roidb = self.load_selective_search_roidb(gt_roidb)
            roidb = IMDB.merge_roidbs(gt_roidb, ss_roidb)
        else:
            roidb = self.load_selective_search_roidb(gt_roidb)
        with open(cache_file, 'wb') as fid:
            cPickle.dump(roidb, fid, cPickle.HIGHEST_PROTOCOL)
        print 'wrote ss roidb to {}'.format(cache_file)

        return roidb 
開發者ID:tonysy,項目名稱:Deep-Feature-Flow-Segmentation,代碼行數:27,代碼來源:pascal_voc.py

示例2: selective_search_roidb

# 需要導入模塊: from imdb import IMDB [as 別名]
# 或者: from imdb.IMDB import merge_roidbs [as 別名]
def selective_search_roidb(self, gt_roidb, append_gt=False):
        """
        get selective search roidb and ground truth roidb
        :param gt_roidb: ground truth roidb
        :param append_gt: append ground truth
        :return: roidb of selective search
        """
        cache_file = os.path.join(self.cache_path, self.name + '_ss_roidb.pkl')
        if os.path.exists(cache_file):
            with open(cache_file, 'rb') as fid:
                roidb = cPickle.load(fid)
            logger.info('%s ss roidb loaded from %s' % (self.name, cache_file))
            return roidb

        if append_gt:
            logger.info('%s appending ground truth annotations' % self.name)
            ss_roidb = self.load_selective_search_roidb(gt_roidb)
            roidb = IMDB.merge_roidbs(gt_roidb, ss_roidb)
        else:
            roidb = self.load_selective_search_roidb(gt_roidb)
        with open(cache_file, 'wb') as fid:
            cPickle.dump(roidb, fid, cPickle.HIGHEST_PROTOCOL)
        logger.info('%s wrote ss roidb to %s' % (self.name, cache_file))

        return roidb 
開發者ID:tech-quantum,項目名稱:sia-cog,代碼行數:27,代碼來源:pascal_voc.py

示例3: rpn_roidb

# 需要導入模塊: from imdb import IMDB [as 別名]
# 或者: from imdb.IMDB import merge_roidbs [as 別名]
def rpn_roidb(self, gt_roidb, append_gt=False):
        """
        get rpn roidb and ground truth roidb
        :param gt_roidb: ground truth roidb
        :param append_gt: append ground truth
        :return: roidb of rpn
        """
        if append_gt:
            print 'appending ground truth annotations'
            rpn_roidb = self.load_rpn_roidb(gt_roidb)
            roidb = IMDB.merge_roidbs(gt_roidb, rpn_roidb)
        else:
            roidb = self.load_rpn_roidb(gt_roidb)
        return roidb 
開發者ID:TuSimple,項目名稱:mx-maskrcnn,代碼行數:16,代碼來源:cityscape.py


注:本文中的imdb.IMDB.merge_roidbs方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。