• 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. 异常类的构建——顶层父类Exception的实现

    异常类构建异常的类型可以是自定义类类型对于类类型异常的匹配依旧是从上到下严格的匹配赋值兼容性原则在异常匹配中依然适用一般而言-匹配子类异常的catch放在上部-匹配父类异常的catch放在下部 现代C ...

  2. 怎么解决 hash 冲突

    开放定址法: 线性探测再散列 二次探测再散列 伪随机 再hash: 同时构造,多个不同的hash函数 链地址: 链表, 建立公共溢出区: 分为基本表和溢出表两个部分 开放散列(open hashing ...

  3. python之大作业

    一.题目要求 获得网页中A-Z所有名字并且爬取名字详情页中的信息,如姓名,性别,,说明等,并存放到csv中(网址:http://www.thinkbabynames.com/start/0/A) 现在 ...

  4. 用nodejs快速实现websocket服务端(带SSL证书生成)

    有不少公司将nodejs的socket.io作为websocket的解决方案,很遗憾的是socket.io是对websocket的封装,并不支持html5原始的websocket协议,微信小程序使用的 ...

  5. 在 ASP.NET Core 项目中使用 npm 管理你的前端组件包

    一.前言 在项目的前端开发中,对于绝大多数的小伙伴来说,当然,也包括我,不可避免的需要在项目中使用到一些第三方的组件包.这时,团队中的小伙伴是选择直接去组件的官网上下载,还是图省事直接在网上搜索,然后 ...

  6. python服务不能在docker容器里运行的问题

    在开发过程中,我们将mysql.redis.celery等服务在docker容器里跑,项目在本地运行,便于debug调试 docker-compose -f docker-compose-dev.ym ...

  7. kvm与xen虚拟化的比较(转)

    Linux虚拟化技术的用户目前有两种免费的开源管理程序可以选择:Xen和KVM. 作为较早出现的虚拟化技术,Xen是“第一类”运行在裸机上的虚拟化管理程序(Hypervisor),也是当前相当一部分商 ...

  8. Unity TextMeshPro 一键生成工具

    本文参考了这片博客文章,在此基础上进行优化和改进: https://blog.csdn.net/akof1314/article/details/80868869 先截张效果图: TextMeshPr ...

  9. Linux 安装 MySQL 出现 Could NOT find Curses

    通过源码安装 MySQL 数据库,下载了 mysql-5.5.24 的版本,在使用 cmake 时产生了报错,如下: CMake Error at cmake/readline.cmake: (MES ...

  10. Protractor-引入Cucumber

    上一篇博文中我们已经在package.json中写入了cucumber依赖库,在执行 npm install 之后,cucumber就已经下载好了.接下来要做的是修改conf.js,请参考下图: 去年 ...