本文整理汇总了Python中feature.Feature.getFeaturesVectors方法的典型用法代码示例。如果您正苦于以下问题:Python Feature.getFeaturesVectors方法的具体用法?Python Feature.getFeaturesVectors怎么用?Python Feature.getFeaturesVectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类feature.Feature
的用法示例。
在下文中一共展示了Feature.getFeaturesVectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: xrange
# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import getFeaturesVectors [as 别名]
test_files = []
valid_files_count = 0
test_files_count = 0
test_superpixels = []
train_superpixels = []
validation_original_image = []
test_original_image = []
test_pixels_labels = []
valid_pixels_labels = []
valid_superpixels = []
for i in xrange(0,num_images):
feature = Feature()
feature.create(image_filenames[i],label_image_filenames[i])
labels = feature.getSuperpixelLabels()
feature_vectors = feature.getFeaturesVectors()
h, img_filename = os.path.split(image_filenames[i])
h, label_img_filename = os.path.split(label_image_filenames[i])
folder = "extracted/" + img_filename + "-" + label_img_filename + "/"
if not os.path.exists(folder):
os.makedirs(folder)
scipy.io.savemat(folder+"superpixel", {'features':feature.getSuperpixelImage()}, oned_as='column')
scipy.io.savemat(folder+"superpixel_labels", {'features':feature.getSuperpixelLabels()}, oned_as='column')
scipy.io.savemat(folder+"location", {'features':feature.getSuperpixelsLocation()}, oned_as='column')
scipy.io.savemat(folder+"color", {'features':feature.getSuperpixelsColor()}, oned_as='column')
scipy.io.savemat(folder+"hog", {'features':feature.getSuperpixelsHog()}, oned_as='column')
scipy.io.savemat(folder+"size", {'features':feature.getSuperpixelsSize()}, oned_as='column')
scipy.io.savemat(folder+"texture", {'features':feature.getSuperpixelsTexture()}, oned_as='column')
scipy.io.savemat(folder+"features_combined", {'features':feature.getFeaturesVectors()}, oned_as='column')