Skip to content

Instantly share code, notes, and snippets.

@smzn
Created June 20, 2019 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smzn/193c42f55f1096f0de416a5da5fb680f to your computer and use it in GitHub Desktop.
Save smzn/193c42f55f1096f0de416a5da5fb680f to your computer and use it in GitHub Desktop.
DeepLearning Camera
camera = webcam; % Connect to the camera
%preview(camera);
net = alexnet; % Load the neural networ k
im = snapshot(camera); % Take a picture
image(im) % Show the picture
im = imresize(im,[227 227]); % Resize the picture for alexnet
label = classify(net,im); % Classify the picture
title(char(label),'FontSize',50) % Show the class label
drawnow
clear camera
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment