说起人工智能,有没有感觉很高大上呢?随着AI的逐渐发展,人工智能适用的领域也越来越广泛,相信未来的世界会是AI的世界。前阵子在MATLAB官网上看到过一个深度学习的例子,只需要10行代码,就可以实时识别电脑摄像头内的物品,据说他们训练了几百万次,能识别几千种物品。代码如下:
camera = webcam; % Connect to the camerannet = alexnet; % Load the neural netwhile true
picture = camera.snapshot; % Take a picture
picture = imresize(picture,[227 227]); % Resize the picture for alexnet
label = classify(nnet,picture); % Classify the picture
image(picture); % Show the picture
title(char(label)); % Show the label
drawnow;end
使用前需要先下载摄像头工具包和深度学习工具包,然后运行程序就可以了。有些东西识别的还是比较准的,比如水杯,iPod,鼠标什么的,但其他的就看人品了。当然,这个程序是娱乐大于应用的,玩玩就行了,不用太认真。最后祝大家玩的愉快,下面放几个官方的图片。
<img src="https://pic4.zhimg.com/50/v2-37d6da93c5e23c82be86fc7d22f23a7d_hd.jpg" data-rawwidth="517" data-rawheight="397" data-size="normal" data-default-watermark-src="https://pic2.zhimg.com/50/v2-816d2fcf57f20e86c1205a1c6f865c36_hd.jpg" class="origin_image zh-lightbox-thumb" width="517" data-original="https://pic4.zhimg.com/v2-37d6da93c5e23c82be86fc7d22f23a7d_r.jpg"/>
咖啡杯
<img src="https://pic4.zhimg.com/50/v2-f094ee9c576ea73f439efe6de42b5ed5_hd.jpg" data-rawwidth="1064" data-rawheight="940" data-size="normal" data-default-watermark-src="https://pic3.zhimg.com/50/v2-2ee681630ce505d46326aabb69e1dffe_hd.jpg" class="origin_image zh-lightbox-thumb" width="1064" data-original="https://pic4.zhimg.com/v2-f094ee9c576ea73f439efe6de42b5ed5_r.jpg"/>
石榴
原网站链接
Deep Learning in 10 Lines of MATLAB Code
uk.mathworks.com
最后,大家有关于编程和仿真的任何需求可以添加管理员微信号:CAE320,同时也欢迎大家关注“320科技工作室”的微信公众号,扫一扫二维码即可关注~~