camera = webcam; 
net = alexnet;  
f = figure;
while ishandle(f)  
    im = camera.snapshot;              
    im = imresize(im,[227,227]);  
    label = classify(net, im);        
    image(im);     
    title(char(label)); 
    drawnow
end
delete(camera)