ScanNet数据集下载与导出颜色图、深度图、内参、位姿数据
0 介绍
(1)简介
ScanNet是一个RGB-D视频数据集,包含1500多个扫描中的250万个视图,用3D摄像机的姿势、表面重建和实例级的语义分割来注释。为了收集这些数据,我们设计了一个易于使用和可扩展的RGB-D捕捉系统,包括自动表面重建和众包语义注释。我们表明,使用这些数据有助于在几个三维场景理解任务上实现最先进的性能,包括三维物体分类、语义体素标签和CAD模型检索。
(2)版本
在ScanNet之后发布了ScanNet v2(全部文件很大, 共1.3T),好像现在大部分使用的都是v2版本,具体更改见:ScanNet Changelog,主要更改如下:
Changelo中ScanNet v2 (2018-06-11)
声明为:
ScanNet 的新 2D/3D 基准挑战(benchmark challenge)
新的语义标签和实例注释(semantic label and instance annotations )
新的场景类型注释
新的轴对齐
1 申请与下载
一般从别的博客直接copy下来的代码好像不能进行下载,所以需要自己申请一下。
1.1 申请
参考github:https://github.com/ScanNet/ScanNet
填写申请:https://kaldir.vc.in.tum.de/scannet/ScanNet_TOS.pdf
注:PI可以理解为学术带头人或导师:https://wap.sciencenet.cn/blog-293721-337429.html?mobile=1
发送到邮箱:scannet@googlegroups.com
,周一中午12:03
发送的邮件,当天下午6:15
接收到邮件
1.2 使用数据脚本下载指定序列
参考命令:download-scannet.py -o [directory in which to download] --id
注:使用vpn的话下载速度会快一些。
scene0004_00python download-scannet.py -o . --id scene0004_00
下图第一个箭头按任意键进行下载确认,第二个箭头不按下n
键,因为第一次使用该数据集,宁愿下载更多无用的避免后续出问题。
scene0005_00python download-scannet.py -o . --id scene0005_00
scene0009_00python download-scannet.py -o . --id scene0009_00
scene0010_00python download-scannet.py -o . --id scene0010_00
scene0030_00python download-scannet.py -o . --id scene0030_00
scene0031_00python download-scannet.py -o . --id scene0031_00
2 将下载的数据序列进行转化
脚本:https://github.com/ScanNet/ScanNet/tree/master/SensReader/python
脚本说明是使用python 2.7
开发和测试。
脚本使用的参考命令:
python reader.py --filename [.sens file to export data from] --output_path [output directory to export data to]
Options:
--export_depth_images: export all depth frames as 16-bit pngs (depth shift 1000)
--export_color_images: export all color frames as 8-bit rgb jpgs
--export_poses: export all camera poses (4x4 matrix, camera to world)
--export_intrinsics: export camera intrinsics (4x4 matrix)
(1)使用python2.7(ubuntu18.04自带环境)----采用方案
以scene0004_00为例
将脚本reader.py
,SensorData.py
copy进数据序列文件夹(下图中SensorData.pyc
是后来生成的)python reader.py --filename scene0004_00.sens --output_path . --export_depth_images --export_color_images --export_poses --export_intrinsics
将结果存储在四个文件夹中
确实是深度图像,虽然下面截图看不清:
报错1:
imageio requires Python '>=3.5' but the running Python is 2.7.17
参考:(https://blog.csdn.net/space_dandy/article/details/108142800)得知最新版本的imageio仅支持python>=3.5的版本,可以选择小于小于2.6.1版本的imageio库,结合(https://stackoverflow.com/questions/57332153/pytest-requires-python-3-5-but-the-running-python-is-2-7-10)关于pytest
类似的包的相似处理办法
解决办法为:pip install "imageio<2.6.1"
报错2
ImportError: No module named png
参考:https://github.com/liuwons/wxBot/issues/79pip install pypng
持续报错:
IOError: [Errno 2] No such file or directory: '/tmp/pip-build-xPQDii/pypng/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xPQDii/pypng/
参考下面(3)使用python3.8(anaconda创建环境) 中 报错2
安装的版本,这里降低版本
输入pip install "pypng<0.2.0"
(3)使用python3.8(anaconda创建环境)----弃用方案/参考意义
scene0004_00python reader.py --filename scene0004_00.sens --output_path . --export_depth_images --export_color_images --export_poses --export_intrinsics
报错1
print 'exporting', len(self.frames)//frame_skip, 'camera poses to', output_path
^
SyntaxError: invalid syntax
结合python2和python3的print()函数的不同,修改SensorData.py
的以下四处----给print()函数加()
# print 'exporting', len(self.frames)//frame_skip, ' depth frames to', output_path #hxz
print ('exporting', len(self.frames)//frame_skip, ' depth frames to', output_path) #hxz
# print 'exporting', len(self.frames)//frame_skip, 'color frames to', output_path #hxz
print ('exporting', len(self.frames)//frame_skip, 'color frames to', output_path) #hxz
# print 'exporting', len(self.frames)//frame_skip, 'camera poses to', output_path #hxz
print ('exporting', len(self.frames)//frame_skip, 'camera poses to', output_path) #hxz
# print 'exporting camera intrinsics to', output_path #hxz
print ('exporting camera intrinsics to', output_path) #hxz
报错2
ImportError: No module named png
参考:https://github.com/liuwons/wxBot/issues/79pip install pypng
可以有效安装
(isdf) meng@meng:/media/meng/T7/dataset/ScanNet/scans/scene0004_00$ pip3 install pypng
Collecting pypng
Downloading pypng-0.20220715.0-py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 486 kB/s
Installing collected packages: pypng
Successfully installed pypng-0.20220715.0
(3)其他序列同样处理:
scene0005_00python reader.py --filename scene0005_00.sens --output_path . --export_depth_images --export_color_images --export_poses --export_intrinsics
scene0009_00python reader.py --filename scene0009_00.sens --output_path . --export_depth_images --export_color_images --export_poses --export_intrinsics
scene0010_00python reader.py --filename scene0010_00.sens --output_path . --export_depth_images --export_color_images --export_poses --export_intrinsics
scene0030_00python reader.py --filename scene0030_00.sens --output_path . --export_depth_images --export_color_images --export_poses --export_intrinsics
scene0031_00python reader.py --filename scene0031_00.sens --output_path . --export_depth_images --export_color_images --export_poses --export_intrinsics
文章来源:https://www.toymoban.com/news/detail-651179.html
3附录
3.1 python2.7(ubuntu18.04自带环境)–环境配置:
python2.7环境配置如下(红字就不需要管啦)
文章来源地址https://www.toymoban.com/news/detail-651179.html
meng@meng:~$ python
Python 2.7.17 (default, Jul 1 2022, 15:56:32)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
meng@meng:~$ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
actionlib (1.12.1)
angles (1.9.12)
asn1crypto (0.24.0)
attrs (17.4.0)
autobahn (17.10.1)
Automat (0.6.0)
backports.functools-lru-cache (1.4)
base-local-planner (1.16.7)
beautifulsoup4 (4.6.0)
bzr (2.8.0.dev1)
cairocffi (0.8.0)
CairoSVG (1.0.20)
camera-calibration-parsers (1.11.13)
catkin (0.7.29)
catkin-pkg (0.5.2)
catkin-pkg-modules (0.5.2)
catkin-tools (0.6.1)
cbor (1.0.0)
cffi (1.11.5)
chardet (3.0.4)
click (6.7)
colorama (0.3.7)
configobj (5.0.6)
configparser (3.5.0)
constantly (15.1.0)
controller-manager (0.18.4)
controller-manager-msgs (0.18.4)
cryptography (2.1.4)
cv-bridge (1.13.0)
cwiid (0.6.0)
cycler (0.10.0)
Cython (0.26.1)
defusedxml (0.5.0)
diagnostic-updater (1.9.7)
dnspython (1.15.0)
docutils (0.18.1)
drone-wrapper (1.3.10)
dynamic-reconfigure (1.6.5)
empy (3.3.2)
enum34 (1.1.10)
future (0.15.2)
futures (3.4.0)
gazebo-plugins (2.8.7)
gazebo-ros (2.8.7)
gencpp (0.6.5)
geneus (2.2.6)
genlisp (0.4.16)
genmsg (0.5.16)
gennodejs (2.0.1)
genpy (0.6.16)
html5lib (0.999999999)
httplib2 (0.9.2)
hyperlink (17.3.1)
idna (2.6)
image-geometry (1.13.0)
imageio (2.6.0)
incremental (16.10.1)
interactive-markers (1.11.5)
ipaddress (1.0.17)
joint-state-publisher (1.12.15)
joy-listener (0.2.6)
joy-mouse (0.1.15)
keyring (10.6.0)
keyrings.alt (3.0)
laser-geometry (1.6.7)
launchpadlib (1.10.6)
lazr.restfulclient (0.13.5)
lazr.uri (1.0.3)
lxml (4.2.1)
lz4 (0.10.1)
matplotlib (2.1.1)
mavros (1.13.0)
mercurial (4.5.3)
message-filters (1.14.13)
mpi4py (2.0.0)
netifaces (0.10.4)
nose (1.3.7)
numpy (1.16.6)
oauth (1.0.1)
olefile (0.45.1)
osrf-pycommon (0.2.1)
PAM (0.4.2)
paramiko (2.0.0)
Pillow (6.2.2)
pip (9.0.1)
ply (3.11)
Printrun (1.6.0)
psutil (5.4.2)
py-trees (0.6.9)
py-ubjson (0.8.5)
pyasn1 (0.4.2)
pyasn1-modules (0.2.1)
PyBluez (0.18)
pycairo (1.16.2)
pycparser (2.18)
pycrypto (2.6.1)
pycryptodomex (3.4.7)
pydot (1.2.3)
pyglet (1.3.0)
Pygments (2.2.0)
pygobject (3.26.1)
pygraphviz (1.4rc1)
PyNaCl (1.1.2)
PyOpenGL (3.1.0)
pyOpenSSL (17.5.0)
pyparsing (2.4.7)
pypng (0.0.20)
pyserial (3.4)
python-dateutil (2.8.2)
python-gnupg (0.4.1)
python-qt-binding (0.4.4)
python-snappy (0.5)
PyTrie (0.2)
pytz (2018.3)
pyudev (0.21.0)
pyxdg (0.25)
PyYAML (5.4.1)
qrcode (5.3)
qt-dotgraph (0.4.2)
qt-gui (0.4.2)
qt-gui-cpp (0.4.2)
qt-gui-py-common (0.4.2)
resource-retriever (1.12.7)
roman (2.0.0)
rosbag (1.14.13)
rosboost-cfg (1.14.9)
rosclean (1.14.9)
roscreate (1.14.9)
rosdep-modules (0.22.1)
rosdistro (0.9.0)
rosdistro-modules (0.9.0)
rosgraph (1.14.13)
rosinstall (0.7.8)
roslaunch (1.14.13)
roslib (1.14.9)
roslint (0.11.2)
roslz4 (1.14.13)
rosmake (1.14.9)
rosmaster (1.14.13)
rosmsg (1.14.13)
rosnode (1.14.13)
rosparam (1.14.13)
rospkg (1.4.0)
rospkg-modules (1.4.0)
rospy (1.14.13)
rosservice (1.14.13)
rostest (1.14.13)
rostopic (1.14.13)
rosunit (1.14.9)
roswtf (1.14.13)
rqt-action (0.4.9)
rqt-bag (0.5.1)
rqt-bag-plugins (0.5.1)
rqt-console (0.4.9)
rqt-controller-manager (0.18.4)
rqt-dep (0.4.9)
rqt-drone-teleop (1.3.10)
rqt-ez-publisher (0.5.0)
rqt-graph (0.4.11)
rqt-ground-robot-teleop (1.3.10)
rqt-gui (0.5.3)
rqt-gui-py (0.5.3)
rqt-image-view (0.4.16)
rqt-joint-trajectory-controller (0.17.2)
rqt-joint-trajectory-plot (0.0.5)
rqt-launch (0.4.8)
rqt-launchtree (0.2.0)
rqt-logger-level (0.4.8)
rqt-moveit (0.5.10)
rqt-msg (0.4.8)
rqt-multiplot (0.0.10)
rqt-nav-view (0.5.7)
rqt-play-motion-builder (1.0.2)
rqt-plot (0.4.13)
rqt-pose-view (0.5.8)
rqt-publisher (0.4.8)
rqt-py-common (0.5.3)
rqt-py-console (0.4.8)
rqt-py-trees (0.3.1)
rqt-reconfigure (0.5.4)
rqt-robot-dashboard (0.5.7)
rqt-robot-monitor (0.5.14)
rqt-robot-steering (0.5.10)
rqt-rotors (2.2.3)
rqt-runtime-monitor (0.5.7)
rqt-rviz (0.7.0)
rqt-service-caller (0.4.8)
rqt-shell (0.4.9)
rqt-srv (0.4.8)
rqt-tf-tree (0.6.0)
rqt-top (0.4.8)
rqt-topic (0.4.11)
rqt-virtual-joy (0.1.2)
rqt-web (0.4.8)
rviz (1.13.29)
SecretStorage (2.3.1)
sensor-msgs (1.12.8)
service-identity (16.0.0)
setuptools (44.1.1)
simplejson (3.13.2)
six (1.16.0)
smach (2.0.1)
smclib (1.8.5)
subprocess32 (3.2.7)
termcolor (1.1.0)
tf (1.12.1)
tf-conversions (1.12.1)
tf2-geometry-msgs (0.6.5)
tf2-kdl (0.6.5)
tf2-py (0.6.5)
tf2-ros (0.6.5)
tf2-sensor-msgs (0.6.5)
topic-tools (1.14.13)
trollius (2.0.1)
Twisted (17.9.0)
txaio (2.8.1)
u-msgpack-python (2.1)
unique-id (1.0.6)
vcstools (0.1.42)
wadllib (1.3.2)
webencodings (0.5)
wheel (0.30.0)
wiimote (1.14.0)
wsaccel (0.6.2)
wstool (0.1.17)
wxPython (3.0.2.0)
wxPython-common (3.0.2.0)
xacro (1.13.17)
xcffib (0.5.1)
zope.interface (4.3.2)
到了这里,关于ScanNet数据集下载与导出颜色图、深度图、内参、位姿数据的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!