本文整理汇总了Python中provider.getDataFiles方法的典型用法代码示例。如果您正苦于以下问题:Python provider.getDataFiles方法的具体用法?Python provider.getDataFiles怎么用?Python provider.getDataFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类provider
的用法示例。
在下文中一共展示了provider.getDataFiles方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_config
# 需要导入模块: import provider [as 别名]
# 或者: from provider import getDataFiles [as 别名]
def load_config(filename):
global globalConfig
assert filename.endswith('.json')
name = os.path.basename(filename)[:-5]
with open(filename, 'r') as handle:
dump_to_namespace(configGlobal, json.load(handle))
configGlobal.__dict__["name"] = name
configGlobal.data.__dict__["basename"] = os.path.basename(configGlobal.data.basepath)
configGlobal.logging.__dict__["logdir"] = configGlobal.logging.basedir + f'/{name}'
if configGlobal.evaluation.has('special'):
if configGlobal.evaluation.special.mode == 'icp':
configGlobal.logging.__dict__["logdir"] = configGlobal.logging.basedir + f'/icp_{configGlobal.data.basename}/{name}'
TRAIN_INDICES = provider.getDataFiles(f'{configGlobal.data.basepath}/split/train.txt')
VAL_INDICES = provider.getDataFiles(f'{configGlobal.data.basepath}/split/val.txt')
configGlobal.data.__dict__["ntrain"] = len(TRAIN_INDICES)
configGlobal.data.__dict__["nval"] = len(VAL_INDICES)
示例2: getDataFiles
# 需要导入模块: import provider [as 别名]
# 或者: from provider import getDataFiles [as 别名]
def getDataFiles(self, list_filename):
return [line.rstrip() for line in open(list_filename)]
示例3: estimate
# 需要导入模块: import provider [as 别名]
# 或者: from provider import getDataFiles [as 别名]
def estimate(area):
LOG_DIR = 'log{}'.format(area)
num_classes = 13
file_path = "data/train_hdf5_file_list_woArea{}.txt".format(area)
train_file_list = provider.getDataFiles(file_path)
mean_ins_size = np.zeros(num_classes)
ptsnum_in_gt = [[] for itmp in range(num_classes)]
train_data = []
train_group = []
train_sem = []
for h5_filename in train_file_list:
cur_data, cur_group, _, cur_sem = provider.loadDataFile_with_groupseglabel_stanfordindoor(h5_filename)
cur_data = np.reshape(cur_data, [-1, cur_data.shape[-1]])
cur_group = np.reshape(cur_group, [-1])
cur_sem = np.reshape(cur_sem, [-1])
un = np.unique(cur_group)
for ig, g in enumerate(un):
tmp = (cur_group == g)
sem_seg_g = int(stats.mode(cur_sem[tmp])[0])
ptsnum_in_gt[sem_seg_g].append(np.sum(tmp))
for idx in range(num_classes):
mean_ins_size[idx] = np.mean(ptsnum_in_gt[idx]).astype(np.int)
print(mean_ins_size)
np.savetxt(os.path.join(LOG_DIR, 'mean_ins_size.txt'),mean_ins_size)
示例4: get_train_dataset
# 需要导入模块: import provider [as 别名]
# 或者: from provider import getDataFiles [as 别名]
def get_train_dataset(num_point=1024):
print('get train num_point ', num_point)
train_files = provider.getDataFiles(
os.path.join(BASE_DIR, 'data/modelnet40_ply_hdf5_2048/train_files.txt'))
return ConcatenatedDataset(
*(PlyDataset(filepath, num_point=num_point, augment=True) for filepath in train_files))
示例5: get_test_dataset
# 需要导入模块: import provider [as 别名]
# 或者: from provider import getDataFiles [as 别名]
def get_test_dataset(num_point=1024):
print('get test num_point ', num_point)
test_files = provider.getDataFiles(
os.path.join(BASE_DIR, 'data/modelnet40_ply_hdf5_2048/test_files.txt'))
return ConcatenatedDataset(
*(PlyDataset(filepath, num_point=num_point, augment=False) for filepath in test_files))
示例6: visualize_fv_pc_clas
# 需要导入模块: import provider [as 别名]
# 或者: from provider import getDataFiles [as 别名]
def visualize_fv_pc_clas():
num_points = 1024
n_classes = 40
clas = 'person'
#Create new gaussian
subdev = 5
variance = 0.04
export = False
display = True
exp_path = '/home/itzikbs/PycharmProjects/fisherpointnet/paper_images/'
shape_names = provider.getDataFiles( \
os.path.join(BASE_DIR, 'data/modelnet' + str(n_classes) + '_ply_hdf5_2048/shape_names.txt'))
shape_dict = {shape_names[i]: i for i in range(len(shape_names))}
gmm = utils.get_grid_gmm(subdivisions=[subdev, subdev, subdev], variance=variance)
# compute fv
w = tf.constant(gmm.weights_, dtype=tf.float32)
mu = tf.constant(gmm.means_, dtype=tf.float32)
sigma = tf.constant(gmm.covariances_, dtype=tf.float32)
for clas in shape_dict:
points = provider.load_single_model_class(clas=clas, ind=0, test_train='train', file_idxs=0, num_points=1024,
n_classes=n_classes)
points = np.expand_dims(points,0)
points_tensor = tf.constant(points, dtype=tf.float32) # convert points into a tensor
fv_tensor = tf_util.get_fv_minmax(points_tensor, w, mu, sigma, flatten=False)
sess = tf_util.get_session(2)
with sess:
fv = fv_tensor.eval()
#
# visualize_single_fv_with_pc(fv_train, points, label_title=clas,
# fig_title='fv_pc', type='paper', pos=[750, 800, 0, 0], export=export,
# filename=BASE_DIR + '/paper_images/fv_pc_' + clas)
visualize_fv(fv, gmm, label_title=[clas], max_n_images=5, normalization=True, export=export, display=display,
filename=exp_path + clas+'_fv', n_scales=1, type='none', fig_title='Figure')
visualize_pc(points, label_title=clas, fig_title='figure', export=export, filename=exp_path +clas+'_pc')
plt.close('all')
#plt.show()