struts实现数据跳转
This post is about implementing and running a 3D point cloud object detection deep neural network on AWS. LiDAR (3D Point Clouds) object detection has been a crucial area of research in the area of autonomous driving. Since the self-driving cars use LiDARs to detect the objects on the road, it is important to detect these objects and predict their motion to make sensible driving decisions while on the road.
这篇文章是关于在AWS上实现和运行3D点云对象检测深度神经网络的。 LiDAR(3D点云)对象检测已成为自动驾驶领域研究的关键领域。 由于自动驾驶汽车使用LiDAR来检测道路上的物体,因此在道路上检测这些物体并预测其运动以做出明智的驾驶决策非常重要。
There are many open datasets for object detection and tracking on roads for you to learn from. I’m listing a few popular ones below:
有许多开放的数据集可用于道路上的对象检测和跟踪,以供您学习。 我在下面列出了一些受欢迎的:
Waymo Open Dataset (https://waymo.com/open/)
Waymo打开数据集( https://waymo.com/open/ )
Kitti Dataset (http://www.cvlibs.net/datasets/kitti/)
Kitti数据集( http://www.cvlibs.net/datasets/kitti/ )
Lyft Level 5 Dataset (https://self-driving.lyft.com/level5/)
Lyft 5级数据集( https://self-driving.lyft.com/level5/ )
Once you know what dataset to work with, then comes the well studied Neural Networks that have been performing well on such data. Considering different applications that such data can be used for, for example, object detection, segmentation, object tracking, etc. there are different networks. Please refer to this post to read more on 3D point cloud data and it’s applications, as well as which networks work best for each application. For the purpose of this post, we focus on object detection and a recently published Pillar Based method[1] to solve the purpose.
一旦知道了要使用的数据集,就会有经过充分研究的神经网络,它们在这些数据上表现良好。 考虑到这样的数据可用于例如对象检测,分割,对象跟踪等的不同应用,存在不同的网络。 请参考这篇文章,以详细了解3D点云数据及其应用程序,以及哪种网络最适合每种应用程序。 出于本文的目的,我们专注于对象检测和最近发布的基于Pillar的方法[1]来解决该问题。
Clone the GitHub repo: https://github.com/tyagi-iiitv/pillar-od.
克隆GitHub仓库: https : //github.com/tyagi-iiitv/pillar-od 。
Access to the Waymo Dataset (https://waymo.com/open/download/). It takes about 2 days to get access to their google cloud storage which looks something like the image below. We will use this so that we are able to download the data with the terminal directly on the cloud.
访问Waymo数据集( https://waymo.com/open/download/ )。 大约需要2天的时间才能访问其Google云存储,如下图所示。 我们将使用它,以便我们能够通过终端直接在云上下载数据。
Since I’m using Amazon SageMaker, we start a notebook instance with around 2TB of space and a GPU.
由于我使用的是Amazon SageMaker,因此我们启动了一个笔记本实例,该实例具有约2TB的空间和一个GPU。
Creating a notebook instance on Amazon SageMaker. 在Amazon SageMaker上创建笔记本实例。Then we start our cloud instance and open JupyterLab, followed by a new terminal on our instance.
然后,我们启动云实例并打开JupyterLab,然后在我们的实例上打开一个新终端。
Open a terminal for your cloud instance. 打开您的云实例的终端。Use the following commands to get the data from google cloud bucket (remember to add gcloud to the PATH):
使用以下命令从Google云端存储桶获取数据(请记住将gcloud添加到PATH):
curl https://sdk.cloud.google.com | bashexec -l $SHELLgcloud initIn case gcloud is not recognized still, view the contents of the .bashrc file with cat /home/ec2-user/.bashrc and verify the links for gcloud, probably on the last two lines of this file. Use the commands below to manually add them to your PATH. This should get the gcloud commands working on your terminal.
如果gcloud是不是还承认,查看内容.bashrc与文件cat /home/ec2-user/.bashrc和验证gcloud的链接,可能对这个文件的最后两行。 使用以下命令将其手动添加到您的PATH中。 这应该使gcloud命令在您的终端上运行。
source /home/ec2-user/google-cloud-sdk/path.bash.incsource /home/ec2-user/google-cloud-sdk/completion.bash.incgcloud initNow finally, get the training and validation data and store it inside a train_data and validation_data directory respectively. The command to copy data from the google cloud bucket to your instance is gsutil -m cp -r gs://waymo_open_dataset_v_xxx /path/to/my/data To find the exact name of the waymo repository, open the google cloud storage directory for the waymo open dataset and copy the repo’s name. If you downloaded a .tar file, extract it with the command tar -xvf training_xxxx.tar. This will provide the data files for various segments inside a scene.
现在,最后,获取训练和验证数据,并将其分别存储在train_data和validation_data目录中。 将数据从Google云存储桶复制到您的实例的命令是gsutil -m cp -r gs://waymo_open_dataset_v_xxx /path/to/my/data要查找waymo存储库的确切名称,请打开Google云存储目录waymo打开数据集并复制存储库的名称。 如果您下载了.tar文件,请使用命令tar -xvf training_xxxx.tar将其tar -xvf training_xxxx.tar 。 这将提供场景内各个片段的数据文件。
Clone the GitHub repo git clone https://github.com/tyagi-iiitv/pillar-od.git
克隆GitHub repo git clone https://github.com/tyagi-iiitv/pillar-od.git
Create a virtual environment to work in conda create -p ./env anaconda python=3.7 This installs an initial, complete Anaconda environment with necessary packages.
创建一个可在conda create -p ./env anaconda python=3.7的虚拟环境conda create -p ./env anaconda python=3.7这将安装一个完整的初始Anaconda环境,其中包含必要的软件包。
Activate the conda environment source activate ./env
激活source activate ./env环境source activate ./env
Install additional libraries conda install absl-py tensorflow-gpu tensorflow-datasets
安装其他库conda install absl-py tensorflow-gpu tensorflow-datasets
Install Waymo Open Dataset Wrapper library 安装Waymo Open Dataset Wrapper库 rm -rf waymo-od > /dev/nullgit clone https://github.com/waymo-research/waymo-open-dataset.git waymo-odcd waymo-od && git branch -agit checkout remotes/origin/masterpip install --upgrade pippip install waymo-open-dataset-tf-2-1-0==1.2.0Prepare the dataset for the model. Change the source and target directories inside the file pillar-od/data/generate_waymo_dataset.sh file. Now run the file to read frames from the downloaded data. This is going to take a while, depending on the size of the data that you’ve downloaded.
准备模型的数据集。 更改文件pillar-od/data/generate_waymo_dataset.sh文件中的源目录和目标目录。 现在运行文件以从下载的数据中读取帧。 这将需要一段时间,具体取决于您下载的数据大小。
cd pillar-od/datachmod +x generate_waymo_dataset.sh./generate_waymo_dataset.shBefore we can run the train.py file inside the pillar-od directory, make sure to change the paths to the dataset and other configuration parameters inside the config.py file. Once done with that, let’s install a few libraries to get started with training.
在我们可以运行fragment pillar-od目录中的train.py文件之前,请确保更改数据集的路径以及config.py文件中的其他配置参数。 完成此操作后,让我们安装一些库以开始培训。
pip install lingvo tensorflow-addonsand finally, the model is ready to train for cars (class=1)/pedestrians(class=2):
最后,模型已准备好训练汽车(class = 1)/行人(class = 2):
python train.py --class_id=1 --nms_iou_threshold=0.7 --pillar_map_size=256python train.py --class_id=2 --nms_iou_threshold=0.7 --pillar_map_size=512Same procedure for model evaluation, use the commands below:
使用相同的步骤进行模型评估,请使用以下命令:
python eval.py --class_id=1 --nms_iou_threshold=0.7 --pillar_map_size=256 --ckpt_path=/path/to/checkpoints --data_path=/path/to/data --model_dir=/path/to/resultspython eval.py --class_id=2 --nms_iou_threshold=0.2 --pillar_map_size=512 --ckpt_path=/path/to/checkpoints --data_path=/path/to/data --model_dir=/path/to/results翻译自: https://towardsdatascience.com/pillar-based-3-d-point-cloud-object-detection-implementation-on-waymo-open-dataset-423e9a449ecb
struts实现数据跳转
