本文整理匯總了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 )
示例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 )