优达学城无人驾驶工程师——P2交通路牌识别

2023-10-27

这次是P2项目——交通路牌识别,用到的是简单的卷积网络,2层的卷积层加上4层全连接层,因为用的数据集的图片大小是32x32的,所以不用很复杂的神经网络。

数据地址在这里:https://s3-us-west-1.amazonaws.com/udacity-selfdrivingcar/traffic-signs-data.zip

直接粘贴到迅雷下载就好了。

下载好后解压是有3个文件,test.p train.p valid.p

我这次做到的准确率是93%,网上还有大神做到了98%,https://github.com/kenshiro-o/CarND-Traffic-Sign-Classifier-Project,这是他的github,大家可以看看。

下面开始我的代码

首先先读取数据

# Load pickled data
import pickle

# TODO: Fill this in based on where you saved the training and testing data

training_file = 'train.p'
validation_file='valid.p'
testing_file = 'test.p'

with open(training_file, mode='rb') as f:
    train = pickle.load(f)
with open(validation_file, mode='rb') as f:
    valid = pickle.load(f)
with open(testing_file, mode='rb') as f:
    test = pickle.load(f)
    
X_train, y_train = train['features'], train['labels']
X_valid, y_valid = valid['features'], valid['labels']
X_test, y_test = test['features'], test['labels']

然后分析数据

### Replace each question mark with the appropriate value. 
### Use python, pandas or numpy methods rather than hard coding the results

# TODO: Number of training examples
n_train = len(X_train)

# TODO: Number of validation examples
n_validation = len(X_valid)

# TODO: Number of testing examples.
n_test = len(X_test)

# TODO: What's the shape of an traffic sign image?
image_shape = X_train[0].shape

# TODO: How many unique classes/labels there are in the dataset.
n_classes = len(set(y_train))

print("Number of training examples =", n_train)
print("Number of testing examples =", n_test)
print("Image data shape =", image_shape)
print("Number of classes =", n_classes)

可以看到train有3万多张图片 大小是32x32x3 总共有43种分类

下面是随机show一张图片和分析train,valid,test中各各类别图片的数量

### Data exploration visualization code goes here.
### Feel free to use as many code cells as needed.
import matplotlib.pyplot as plt
from collections import Counter
import numpy as np
# Visualizations will be shown in the notebook.
%matplotlib inline
index=np.random.randint(n_train)
plt.imshow(X_train[index],cmap='gray')
print(y_train[index])

sign_count_test = Counter(y_train)

range_x = np.array(range(n_classes))
range_y = [sign_count_test[i] for i in range_x]
plt.figure(figsize=(9,5))
plt.bar(range_x,range_y)
plt.xticks(list(range(n_classes)))
plt.xlabel("class")
plt.ylabel("numbers")
plt.ti
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

优达学城无人驾驶工程师——P2交通路牌识别 的相关文章

  • 无人驾驶:Term-1-p2-traffic-sign-classifier

    简介 Term 1第二节课是进行交通标志分类 xff0c 数据集主要来自于German Traffic Sign xff0c 包含了42种交通标志 xff0c 通过深度学习网络进行分类 环境准备 python 2 7numpyscikit
  • 无人驾驶(四)---远程桌面控制工具: NoMachine踩坑记录

    NoMachine for mac是一款免费的远程桌面访问工具 xff0c 这款软件的连接到远程桌面后延迟可以非常低 xff0c NX协议在高延迟低带宽的链路上提供了近乎本地速度的响应能力 xff0c 打破空间和时间的障碍 xff0c 让您
  • python无人驾驶_无人驾驶技术入门(四):无人车传感器 IMU 深入剖析

    上一次的分享里 xff0c 我介绍了GPS的原理 xff08 三角定位 xff09 及特性 xff08 精度 频率 xff09 xff0c 同时也从无人车控制的角度 xff0c 讨论了为什么仅有GPS无法满足无人车的定位要求 为了能让无人驾
  • 无人驾驶——激光雷达篇

    激光雷达技术简介 无人驾驶技术是多项技术的集成 xff0c 包括传感器 定位与深度学习 高精地图 路径规划 障碍物检测与规避 机械控制 系统集成与优化 能耗与散热管理等 无人车系统的感知端由不同的传感器组成 xff0c 其中包括GPS xf
  • 【无人驾驶】自动驾驶领域有哪些岗位可选?

    导读 想要进入自动驾驶这个领域 xff0c 便首先去调查了下这个领域的岗位 xff0c 希冀能从中找出自己最感兴趣且匹配度也比较高的方向 废话不多说 xff0c 见下 下图为自动驾驶方向的所有岗位 xff0c 总量的来说 xff0c 方向可
  • 高精地图在无人驾驶中的应用

    转自 http 36kr com p 5060994 html 编者按 本文来自 程序员 作者 陈辰 刘少山 36氪经授权发布 高精地图是无人驾驶核心技术之一 精准的地图对无人车定位 导航与控制 以及安全至关重要 本文是 无人驾驶技术系列
  • costmap 代价地图

    转自 https sychaichangkun gitbooks io ros tutorial icourse163 content chapter10 10 3 html 10 3 costmap costmap是Navigation
  • 无人驾驶系统Autoware与仿真环境LGSVL Simulator联合配置

    在此 把在Ubuntu 16 04中 搭建无人驾驶系统Autoware编译环境 配置无人驾驶仿真环境LGSVL Simulator 并进行联合测试的步骤 记录下来 以备查阅 系统配置 我所用的配置 需要两个系统 一个Ubuntu系统 一个W
  • useful link for compiling segmap

    https www cnblogs com chenlinchong p 12576699 html ubuntu16 04编译segmap https blog csdn net weixin 42606990 article detai
  • 优达学城无人驾驶工程师——P2交通路牌识别

    这次是P2项目 交通路牌识别 用到的是简单的卷积网络 2层的卷积层加上4层全连接层 因为用的数据集的图片大小是32x32的 所以不用很复杂的神经网络 数据地址在这里 https s3 us west 1 amazonaws com udac
  • 自动驾驶中无迹卡尔曼滤波器的应用(Unscented-Kalman-Filter)

    无迹卡尔曼滤波 一 无迹卡尔曼滤波器 二 CTRV模型 2 1 状态向量 2 2 状态转移方程计算 2 2 1 确定部分 2 2 2 噪声 三 无迹卡尔曼滤波器 3 1 无迹卡尔曼滤波思路 3 2 sigma点 3 3 无迹卡尔曼滤波器的实
  • 整理的apollo 入门课程

    转自 https blog csdn net weixin 36662031 article details 81081744 转载自 https mp csdn net postedit 81081744 自动驾驶系统主要包含三个部分 感
  • NVIDIA 不同显卡对应的GPU计算能力

    转自 https blog csdn net dlhlsc article details 85088280 Fermi CUDA 3 2 until CUDA 8 deprecated from CUDA 9 SM20 or SM 20
  • Apollo如何通知/订阅主题topic

    转自 https blog csdn net u012423865 article details 80024870 How to advertise and subscribe a topic 导读 众所周知 Apollo是基于ROS开发
  • Apollo如何通知/订阅主题topic

    转自 https blog csdn net u012423865 article details 80024870 导读 众所周知 Apollo是基于ROS开发的 所以其底层也是基于消息的机制进行节点通信的 但是它在ROS的基础上做了一些
  • 多项式轨迹--五次多项式轨迹

    转自 https blog csdn net libing403 article details 78715418 多项式轨迹 五次多项式轨迹 1 5 Polynomial of degree five 利用三次多项式 根据过q0 q1 q
  • 【仿真】Carla介绍与使用 [1] (附代码手把手讲解)

    0 参考与前言 主要介绍无人驾驶的仿真环境CARLA 开源社区维护 以下为相关参考链接 Carla官方文档 建议后续找的时候 先按好版本号 有些功能 api 是新版本里有的 Carla官方github Youtube Python Wind
  • 机器人学习书籍

    1 概率机器人 2 机器人学的几何基础 3 Eigen学习 https blog csdn net u012936940 article details 79691911 eigen 使用手册 平时使用参考 4 opencv opencv
  • 概率机器人教学课件

    http www probabilistic robotics org
  • 传感器超声波雷达

    转自 http www itsiwei com 21962 html 在上一次分享中 我介绍了毫米波雷达的原理 数据特性及优缺点 毫米波雷达的低环境敏感和低成本的特性使得其在ADAS和自动驾驶领域得到了广泛的应用 今天要介绍的是一款极其常见

随机推荐