Skip to Content
Python数据科学手册
book

Python数据科学手册

by Jake VanderPlas
January 2018
Intermediate to advanced
470 pages
13h 23m
Chinese
Posts & Telecom Press
Content preview from Python数据科学手册
机器学习
|
445
最后,收集这些
HOG
特征,并用训练好的模型来评估每个窗口中是否有人脸:
In[15]: labels = model.predict(patches_hog)
labels.sum()
Out[15]: 33.0
在近
2000
幅图像中,总共发现了
33
幅带人脸的图像。用矩形把收集到的信息画在图像上
(如图
5-152
所示):
In[16]: fig, ax = plt.subplots()
ax.imshow(test_image, cmap='gray')
ax.axis('off')
Ni, Nj = positive_patches[0].shape
indices = np.array(indices)
for i, j in indices[labels == 1]:
ax.add_patch(plt.Rectangle((j, i), Nj, Ni, edgecolor='red',
alpha=0.3, lw=2,
facecolor='none'))
图 5-152:包含人脸的窗口
所有窗口都重叠在一起,并找到了图像中的人脸!简单的几行
Python
代码就有着巨大
的威力。
5.14.3
 注意事项与改进方案
如果你继续研究前面的代码和示例,就会发现在发布一个产品级的人脸识别器之前,还有
一些工作要做。有些问题已经解决了,但还有一些内容有待完善。
我们的训练集,尤其是负样本特征(
negative feature
)并不完整
这个问题的关键在于,有许多类似人脸的纹理并不在训练集里面,因此我们的模型非常 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

流畅的Python

流畅的Python

Luciano Ramalho
Python数据分析基础

Python数据分析基础

Clinton W. Brownley
Python数据处理

Python数据处理

Jacqueline Kazil, Katharine Jarmul

Publisher Resources

ISBN: 9787115475893