• 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的运行的更多相关文章

  1. jmeter的master远程运行和停止slave

    jmeter可以部署成master-slave或者叫client-server模式,一个master(client)可以同时控制多个slave(server). 在linux系统下,master(cl ...

  2. 微软官方提供的用于监控MS SQL Server运行状况的工具及SQL语句

    Microsoft SQL Server 2005 提供了一些工具来监控数据库.方法之一是动态管理视图.动态管理视图 (DMV) 和动态管理函数 (DMF) 返回的服务器状态信息可用于监控服务器实例的 ...

  3. greenplum如何激活,同步,删除standby和恢复原始master

    在Master失效时,同步程序会停止,Standby可以被在本机被激活,激活Standby时,同步日志被用来恢复Master最后一次事务成功提交时的状态.在激活Standby时还可以指定一个新的Sta ...

  4. mysql (master/slave)复制原理及配置

    1 复制概述 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的数据复制到其它主机(slaves)上,并重 ...

  5. 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 ...

  6. MySQL的Master/Slave群集安装和配置

    本文介绍MySQL的Master/Slave群集安装和配置,版本号安装最新的稳定版GA 5.6.19. 为了支持有限HA.我们用Master/Slave读写简单孤立的集群.有限HA这是当Master不 ...

  7. MySQL master/slave 模式

    1 .复制 Mysql内建的复制功能是构建大型,高性能应用程序的基础.将Mysql的数据分布到多个系统上去,这种分布的机制,是通过将Mysql的某一台主机的 数据复制到其它主机(slaves)上,并重 ...

  8. Kubernetes集群搭建之Master配置篇

    本次系列使用的所需部署包版本都使用的目前最新的或最新稳定版,安装包地址请到公众号内回复[K8s实战]获取 今天终于到正题了~~ 生成kubernets证书与私钥 1. 制作kubernetes ca证 ...

  9. puppet(5)-master/agent模式

    master/agent模式的工作流程 agent每隔固定时长会向master端发送nodename(自己的节点名,节点名至关重要)和 facts ,并且向服务器端请求自己的catalog. mast ...

  10. 【Spark 深入学习 -09】Spark生态组件及Master节点HA

    ----本节内容------- 1.Spark背景介绍 2.Spark是什么 3.Spark有什么 4.Spark部署 4.1.Spark部署的2方面 4.2.Spark编译 4.3.Spark St ...

随机推荐

  1. 02. Go 语言基本语法

    Go语言基本语法 变量.数据类型和常量是编程中最常见,也是很好理解的概念.本章将从 Go 语言的变量开始,逐步介绍各种数据类型及常量. Go 语言在很多特性上和C语言非常相近.如果读者有C语言基础,那 ...

  2. IPFS入门

    相关链接 快速安装 深入浅出 IPFS指令集中文版 IPFS开发入门 filecoin 在线视频 go-ipfs

  3. Java流程控制之选择语句

    选择语句 选择语句也称之为判断语句,主要有2种写法,一种是if语句,一种是switch语句.下面我们就详细的介绍一下这2种语句的用法. 判断语句if if语句第一种形式: if 格式: 执行流程 首先 ...

  4. 详解 Redis 应用场景及原理

    本文转自https://blog.csdn.net/niucsd/article/details/50966733,描述了redis实现原理和应用场景,篇幅较长,有意学习redis的同学可耐心阅读. ...

  5. 基于Django的Rest Framework框架的url控制器

    本文目录 一 自定义路由(原始方式) 二 半自动路由(视图类继承ModelViewSet) 三 全自动路由(自动生成路由) 回到目录 一 自定义路由(原始方式) from django.conf.ur ...

  6. C# params 可变参数使用注意

    今天在一个 .NET Core 项目中调用一个自己实现的使用 params 可变参数的方法时触发了 null 引用异常,原以为是方法中没有对参数进行 null 值检查引起的,于是加上 check nu ...

  7. DirectShow 获取音视频输入设备列表

    开发环境:Win10 + VS2015 本文介绍一个 "获取音频视频输入设备列表" 的示例代码. 效果图 代码下载 代码下载(VC2015):Github - DShow_simp ...

  8. Batchnorm原理详解

    Batchnorm原理详解 前言:Batchnorm是深度网络中经常用到的加速神经网络训练,加速收敛速度及稳定性的算法,可以说是目前深度网络必不可少的一部分. 本文旨在用通俗易懂的语言,对深度学习的常 ...

  9. 一个Web前端工程师或程序员的发展方向,未来困境及穷途末路

    如果你刚好是一个Web前端工程师,或者你将要从事web前端工作.你应该和我有同样的感慨,web前端技术到了自己的天花板,前端工作我能做多少年?3年或5年?自己的职业规划应该怎么样?收入为什么没有增长? ...

  10. Java队列和定时器Timer

       一: Queue详解    Queue: 基本上,一个队列就是一个先入先出(FIFO)的数据结构    Queue接口与List.Set同一级别,都是继承了Collection接口.Linked ...