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


Python DB.removeImage方法代碼示例

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


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

示例1: remove_project

# 需要導入模塊: from db import DB [as 別名]
# 或者: from db.DB import removeImage [as 別名]
    def remove_project(self, projectId):
        print 'removing project....', projectId
        images = DB.getImages( projectId )
        for image in images:
            DB.removeImage(projectId, image.id)

        DB.removeProject( projectId )

        # remove learning model
        types = ['mlp', 'cnn']
        for t in types:
            #best_cnn_model.cnn.0.pklA
            path = '%s/best_%s.%s.*.pkl'%(Paths.Models,projectId,t)
            paths = glob.glob(path)
            for path in paths:
                print 'deleting model...', path
                os.remove( path )

        # remove labels
        path = '%s/*.%s.json'%(Paths.Labels, projectId)
        labels = glob.glob(path)
        for p in labels:
            print 'trying to delete:', p
            os.remove( p )

        # remove segmentations
        path = '%s/*.%s.seg'%(Paths.Segmentation, projectId)
        segs = glob.glob(path)
        for p in segs:
            print 'trying to delete:', p
            os.remove( p )
開發者ID:Rhoana,項目名稱:icon,代碼行數:33,代碼來源:projecthandler.py

示例2: store_images

# 需要導入模塊: from db import DB [as 別名]
# 或者: from db.DB import removeImage [as 別名]
    def store_images(self, project, images, purpose=0):
        # store images added by the user
        image_names = DB.getImageNames( project['id'], purpose )
        for image in images:
            #self.copy_annotations( image, project )
            image = Image( id=image['image_id'], purpose=purpose)
            DB.storeImage(project['id'], project['model_type'], image )
            if image.id in image_names:
                image_names.remove(image.id)

        # discard images removed by the user
        for image_name in image_names:
            DB.removeImage(project['id'], image_name )
開發者ID:Rhoana,項目名稱:icon,代碼行數:15,代碼來源:projecthandler.py


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