• 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. txt换行追加写入

    with open(negative_txt, 'a') as f: patch_name1 = patch_name + '\n' f.write(patch_name1)

  2. SpringBoot(二十一)_使用xml

    springboot使用xml 虽然springboot不提倡用xml,但是我们有可能也是会用到的 代码示例 1.创建一个配置文件在resources下,如下图所示 2.设置配置类 @Configur ...

  3. WinCC的画面使用技巧

    以下内容以VB脚本为主,仅在VB脚本无法实现的功能中使用C脚本. 画面导航 画面导航的作用是打开起始画面.前一张画面和后一张画面等,只能用C脚本实现. 打开起始画面:    OpenHomePictu ...

  4. Mysql 免安装教程 百度云网盘有文件和word说明

    一 把文件解压到一个目录下 这是解压后的目录 将my.ini文件考进去 双击打开my.ini 找到这两行更改成自己的解压路径保存 右键此电脑属性 找到高级系统设置配置环境变量 新建—>变量值是解 ...

  5. 【译】3D打印:介绍

    原文地址:(需要翻墙)https://ordina-jworks.github.io/iot/2018/09/28/3D-Printing-Intro.html 文章发表日期:2018-09-28 第 ...

  6. C# Winform程序防止多开的方法总结(亲测)

    1.Winform启动的时候,检测是否存在同样的进程名,防止程序多开: static class Program { /// <summary> /// 应用程序的主入口点. /// &l ...

  7. 【vim编辑器】文本编辑器vim

    在Linux系统中一切皆文件.配置一个服务就是在修改其配置文件的参数 一.Vim编辑器 vim是我们在Linux系统中常用的文件编辑命令,也可以使用其简写vi.其边际模式有三种:命令模式,输入模式,行 ...

  8. 14-认识DjangoRESTframework

    了解DjangoRESTframework 现在流行的前后端分离Web应用模式,然而在开发Web应用中,有两种应用模式:1.前后端不分离 2.前后端分离. 1.前后端不分离 在前后端不分离中,前端看见 ...

  9. 13-scrapy中selenium的应用

    一. 引入 在通过scrapy框架进行某些网站数据爬取的时候,往往会碰到页面动态数据加载的情况发生,如果直接使用scrapy对其url发请求,是绝对获取不到那部分动态加载出来的数据值.但是通过观察我们 ...

  10. python基础(17):正则表达式

    1. 正则表达式 1.1 正则表达式是什么 正则表达式本身也和python没有什么关系,就是匹配字符串内容的一种规则. 官方定义:正则表达式是对字符串操作的一种逻辑公式,就是用事先定义好的一些特定字符 ...