-
大小: 110KB文件类型: .zip金币: 2下载: 1 次发布日期: 2021-06-17
- 语言: Python
- 标签:
资源简介
a module for 3D semantic segmentation in point clouds
代码片段和文件信息
import pickle
import os
import numpy as np
class ScannetDataset():
def __init__(self root npoints=8192 split=‘train‘):
self.npoints = npoints
self.root = root
self.split = split
self.data_filename = os.path.join(self.root ‘scannet_%s.pickle‘ % split)
with open(self.data_filename ‘rb‘) as fp:
self.scene_points_list = pickle.load(fp encoding=‘bytes‘)
self.semantic_labels_list = pickle.load(fp encoding=‘bytes‘)
if split == ‘train‘:
labelweights = np.zeros(21)
for seg in self.semantic_labels_list:
tmp _ = np.histogram(seg range(22))
labelweights += tmp
labelweights = labelweights.astype(np.float32)
labelweights = labelweights/np.sum(labelweights)
self.labelweights = 1/np.log(1.2+labelweights)
elif split == ‘test‘:
self.labelweights = np.ones(21)
def __getitem__(self index):
point_set = self.scene_points_list[index]
semantic_seg = self.semantic_labels_list[index].astype(np.int32)
coordmax = np.max(point_setaxis=0)
coordmin = np.min(point_setaxis=0)
smpmin = np.maximum(coordmax-[1.5 1.5 3.0] coordmin)
smpmin[2] = coordmin[2]
smpsz = np.minimum(coordmax-smpmin [1.5 1.5 3.0])
smpsz[2] = coordmax[2]-coordmin[2]
cur_semantic_seg = None
cur_point_set = None
mask = None
for i in range(10):
curcenter = point_set[np.random.choice(len(semantic_seg)1)[0]:]
curmin = curcenter-[0.75 0.75 1.5]
curmax = curcenter+[0.75 0.75 1.5]
curmin[2] = coordmin[2]
curmax[2] = coordmax[2]
curchoice = np.sum((point_set >= (curmin-0.2))*(point_set <= (curmax+0.2))axis=1) == 3
cur_point_set = point_set[curchoice :]
cur_semantic_seg = semantic_seg[curchoice]
if len(cur_semantic_seg) == 0:
continue
mask = np.sum((cur_point_set >= (curmin-0.01))*(cur_point_set <= (curmax+0.01)) axis=1) == 3
vidx = np.ceil((cur_point_set[mask :]-curmin)/(curmax-curmin)*[31.0 31.0 62.0])
vidx = np.unique(vidx[: 0] * 31.0 * 62.0 + vidx[: 1] * 62.0 + vidx[: 2])
isvalid = np.sum(cur_semantic_seg > 0)/len(cur_semantic_seg) >= 0.7 and len(vidx)/31.0/31.0/62.0 >= 0.02
if isvalid:
break
choice = np.random.choice(len(cur_semantic_seg) self.npoints replace=True)
point_set = cur_point_set[choice:]
semantic_seg = cur_semantic_seg[choice]
mask = mask[choice]
sample_weight = self.labelweights[semantic_seg]
sample_weight *= mask
return point_set semantic_seg sample_weight
def __len__(self):
return len(self.scene_points_list)
class ScannetDatasetWholeScene(object):
def __init__(self root npoints=8192 split=‘train‘):
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-11-24 03:49 pointSIFT-master\
文件 3113 2018-11-24 03:49 pointSIFT-master\README.md
目录 0 2018-11-24 03:49 pointSIFT-master\img\
文件 47663 2018-11-24 03:49 pointSIFT-master\img\fig1.png
目录 0 2018-11-24 03:49 pointSIFT-master\models\
文件 4886 2018-11-24 03:49 pointSIFT-master\models\pointSIFT_pointnet.py
文件 6104 2018-11-24 03:49 pointSIFT-master\scannet_dataset.py
文件 1 2018-11-24 03:49 pointSIFT-master\test.py
目录 0 2018-11-24 03:49 pointSIFT-master\tf_utils\
文件 18149 2018-11-24 03:49 pointSIFT-master\tf_utils\pointSIFT_util.py
文件 11756 2018-11-24 03:49 pointSIFT-master\tf_utils\provider.py
目录 0 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\
目录 0 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\
文件 188 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\.gitignore
目录 0 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\
文件 300 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\compile.sh
文件 3824 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\query_ball_point.cpp
文件 4309 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\query_ball_point.cu
文件 4230 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\query_ball_point_block.cu
文件 4589 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\query_ball_point_grid.cu
文件 2481 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\selection_sort.cpp
文件 1920 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\selection_sort.cu
文件 2454 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\test\selection_sort_const.cu
文件 10471 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\tf_grouping.cpp
文件 2777 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\tf_grouping.py
文件 886 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\tf_grouping_compile.sh
文件 5045 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\tf_grouping_g.cu
文件 904 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\grouping\tf_grouping_op_test.py
目录 0 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\interpolation\
文件 5003 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\interpolation\interpolate.cpp
文件 10969 2018-11-24 03:49 pointSIFT-master\tf_utils\tf_ops\interpolation\tf_interpolate.cpp
............此处省略18个文件信息
相关资源
- Python-DeepMoji模型的pyTorch实现
- Python-使用DeepFakes实现YouTube视频自动换
- Python-一系列高品质的动漫人脸数据集
- Python-Insightface人脸检测识别的最小化
- Python-自然场景文本检测PSENet的一个
- Python-在特征金字塔网络FPN的Pytorch实现
- Python-PyTorch实时多人姿态估计项目的实
- Python-用PyTorch10实现FasterRCNN和MaskRCNN比
- Python-心脏核磁共振MRI图像分割
- Python-基于YOLOv3的行人检测
- Python-RLSeq2Seq用于SequencetoSequence模型的
- Python-PyTorch对卷积CRF的参考实现
- Python-高效准确的EAST文本检测器的一个
- Python-pytorch实现的人脸检测和人脸识别
- Python-UNet用于医学图像分割的嵌套UN
- Python-TensorFlow弱监督图像分割
- Python-基于tensorflow实现的用textcnn方法
- Python-Keras实现Inceptionv4InceptionResnetv1和
- Python-pytorch中文手册
- Python-FastSCNN的PyTorch实现快速语义分割
- Python-滑动窗口高分辨率显微镜图像分
- Python-使用MovieLens数据集训练的电影推
- Python-机器学习驱动的Web应用程序防火
- Python-subpixel利用Tensorflow的一个子像素
-
Python-汉字的神经风格转移Neuralst
y - Python-神经网络模型能够从音频演讲中
- Python-深度增强学习算法的PyTorch实现策
- Python-基于深度学习的语音增强使用
- Python-基于知识图谱的红楼梦人物关系
- Python-STGAN用于图像合成的空间变换生
评论
共有 条评论