Open3D-PointNet2-Semantic3D-master的运行
- 1.修改download_semantic3d.sh文件
#!/bin/bash ans=`dpkg-query -W p7zip-full`
if [ -z "$ans" ]; then
echo "Please, install p7zip-full by running: sudo apt-get install p7zip-full"
exit -
fi for i in `cat semantic3D_files.csv`
do
output_file=`basename $i`
echo Downloading ${output_file} ...
#把wget $i改成:wget -c -N $i
wget -c -N $i
7z x ${output_file} -y
done mv station1_xyz_intensity_rgb.txt neugasse_station1_xyz_intensity_rgb.txt exit
- 2.修改preprocess.py文件
import os
import subprocess
import shutil
import open3d from dataset.semantic_dataset import all_file_prefixes def wc(file_name):
out = subprocess.Popen(
["wc", "-l", file_name], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
).communicate()[0]
return int(out.partition(b" ")[0]) def prepend_line(file_name, line):
with open(file_name, "r+") as f:
content = f.read()
f.seek(0, 0)
f.write(line.rstrip("\r\n") + "\n" + content) def point_cloud_txt_to_pcd(raw_dir, file_prefix):
# File names
txt_file = os.path.join(raw_dir, file_prefix + ".txt")
pts_file = os.path.join(raw_dir, file_prefix + ".pts")
pcd_file = os.path.join(raw_dir, file_prefix + ".pcd") # Skip if already done
if os.path.isfile(pcd_file):
print("pcd {} exists, skipped".format(pcd_file))
return # .txt to .pts
# We could just prepend the line count, however, there are some intensity value
# which are non-integers.
print("[txt->pts]")
print("txt: {}".format(txt_file))
print("pts: {}".format(pts_file))
with open(txt_file, "r") as txt_f, open(pts_file, "w") as pts_f:
for line in txt_f:
# x, y, z, i, r, g, b
tokens = line.split()
tokens[3] = str(int(float(tokens[3])))
line = " ".join(tokens)
pts_f.write(line + "\n")
prepend_line(pts_file, str(wc(txt_file))) # .pts -> .pcd
print("[pts->pcd]")
print("pts: {}".format(pts_file))
print("pcd: {}".format(pcd_file))
"""
point_cloud = open3d.read_point_cloud(pts_file)
open3d.write_point_cloud(pcd_file, point_cloud)
改成:
point_cloud = open3d.io.read_point_cloud(pts_file)
open3d.io.write_point_cloud(pcd_file, point_cloud)
"""
point_cloud = open3d.io.read_point_cloud(pts_file)
open3d.io.write_point_cloud(pcd_file, point_cloud)
os.remove(pts_file) if __name__ == "__main__":
# By default
# raw data: "dataset/semantic_raw"
current_dir = os.path.dirname(os.path.realpath(__file__))
dataset_dir = os.path.join(current_dir, "dataset")
raw_dir = os.path.join(dataset_dir, "semantic_raw") for file_prefix in all_file_prefixes:
point_cloud_txt_to_pcd(raw_dir, file_prefix)
Run
python preprocess.py
Open3D is able to read .pcd files much more efficiently.
- 4. Downsample
The downsampled dataset will be written to dataset/semantic_downsampled. Points with label 0 (unlabled) are excluded during downsampling.
downsample.py文件中的open3d.Vector3dVector()改为:
open3d.utility.Vector3dVector()
5.open3d.voxel_down_sample_and_trace(
dense_pcd, voxel_size, min_bound, max_bound, False
)改成:
open3d.geometry.PointCloud.voxel_down_sample_and_trace(
dense_pcd, voxel_size, min_bound, max_bound, False
)
- 5. Compile TF Ops
cmake ..这一步遇到的错误:CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
CMake 3.8 or higher is required. You are running version 3.5.1
解决办法:
升级cmake
参考:https://blog.csdn.net/weixin_43046653/article/details/86511157
问题还是没有得到解决。
直接复制pointnet++中编译好的.so文件到build directory.
(After compilation the following .so files shall be in the build directory.)
6. Train
Run
python train.py
7. Predict
Pick a checkpoint and run the predict.py script. The prediction dataset is configured by --set. Since PointNet2 only takes a few thousand points per forward pass, we need to sample from the prediction dataset multiple times to get a good coverage of the points. Each sample contains the few thousand points required by PointNet2. To specify the number of such samples per scene, use the --num_samples flag.
python predict.py --ckpt log/semantic/best_model_epoch_040.ckpt \
--set=validation \
--num_samples=500
The prediction results will be written to result/sparse.
Open3D-PointNet2-Semantic3D-master的运行的更多相关文章
- jmeter的master远程运行和停止slave
jmeter可以部署成master-slave或者叫client-server模式,一个master(client)可以同时控制多个slave(server). 在linux系统下,master(cl ...
- 微软官方提供的用于监控MS SQL Server运行状况的工具及SQL语句
Microsoft SQL Server 2005 提供了一些工具来监控数据库.方法之一是动态管理视图.动态管理视图 (DMV) 和动态管理函数 (DMF) 返回的服务器状态信息可用于监控服务器实例的 ...
- greenplum如何激活,同步,删除standby和恢复原始master
在Master失效时,同步程序会停止,Standby可以被在本机被激活,激活Standby时,同步日志被用来恢复Master最后一次事务成功提交时的状态.在激活Standby时还可以指定一个新的Sta ...
- mysql (master/slave)复制原理及配置
1 复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重 ...
- 17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 得到复制master binary log 位置:
17.1.1.4 Obtaining the Replication Master Binary Log Coordinates 得到复制master binary log 位置: 你需要master ...
- MySQL的Master/Slave群集安装和配置
本文介绍MySQL的Master/Slave群集安装和配置,版本号安装最新的稳定版GA 5.6.19. 为了支持有限HA.我们用Master/Slave读写简单孤立的集群.有限HA这是当Master不 ...
- MySQL master/slave 模式
1 .复制 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的 数据复制到其它主机(slaves)上,并重 ...
- Kubernetes集群搭建之Master配置篇
本次系列使用的所需部署包版本都使用的目前最新的或最新稳定版,安装包地址请到公众号内回复[K8s实战]获取 今天终于到正题了~~ 生成kubernets证书与私钥 1. 制作kubernetes ca证 ...
- puppet(5)-master/agent模式
master/agent模式的工作流程 agent每隔固定时长会向master端发送nodename(自己的节点名,节点名至关重要)和 facts ,并且向服务器端请求自己的catalog. mast ...
- 【Spark 深入学习 -09】Spark生态组件及Master节点HA
----本节内容------- 1.Spark背景介绍 2.Spark是什么 3.Spark有什么 4.Spark部署 4.1.Spark部署的2方面 4.2.Spark编译 4.3.Spark St ...
随机推荐
- 201871010123-吴丽丽 《面向对象程序设计(Java)》第十六周学习总结
201871010123-吴丽丽 <面向对象程序设计(Java)>第十六周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ ...
- Java读写Excel文件,利用POI
直接看工具类代码吧, package com.example.demo.util; import com.example.demo.entity.ExcelDataVO; import org.apa ...
- 80道最新java基础部分面试题(七)
自己整理的面试题,希望可以帮到大家,需要更多资料的可以私信我哦,大家一起学习进步! 70.TreeSet里面放对象,如果同时放入了父类和子类的实例对象,那比较时使用的是父类的compareTo方法,还 ...
- promise 和 setTimeout 在任务队列的执行顺序
setTimeout(() => { console.log() }); const a = new Promise((resolve,reject)=>{ console.log(); ...
- thinkphp5.1单模块设置
thinkphp5.1单模块 1. // 是否支持多模块'app_multi_module' => false, // 自动搜索控制器'controller_auto_search' => ...
- celery生产者-消费者
Celery是一个简单,灵活,可靠的分布式系统,用于处理大量消息,同时为操作提供维护此类系统所需的工具. 它是一个任务队列,专注于实时处理,同时还支持任务调度. celery解决了什么问题: 示例一: ...
- python做中学(九)定时器函数的用法
程序中,经常用到这种,就是需要固定时间执行的,或者需要每隔一段时间执行的.这里经常用的就是Timer定时器.Thread 类有一个 Timer子类,该子类可用于控制指定函数在特定时间内执行一次. 可以 ...
- Saiku默认给数据类型的数据添加小数点问题处理(三十一)
Saiku默认给数据类型的数据添加小数点问题处理 不知道大家有没有遇到过saiku定义的维度信息,数据类型时 展示出来的数据会自动加上 .0的后缀. 比如我定义了一个维度为 年, 在数据库中为 int ...
- 3、Hibernate的多表关联
一.数据库中的表关系: 一对一关系 一个人对应一张身份证,一张身份证对应一个人,一对一关系是最好理解的一种关系,在数据库建表的时候可以将人表的主键放置与身份证表里面,也可以将身份证表的主键放置于人表里 ...
- 用 Python 自动监测 GitHub 项目更新
前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者: GitPython PS:如有需要Python学习资料的小伙伴可以加 ...