Videos

Deep Learning in 11 Lines of MATLAB Code



MATLAB

Watch a quick demonstration of how to use MATLAB®, a simple webcam, and a deep neural network to identify objects in your surroundings.

This demo uses AlexNet, a pretrained deep convolutional neural network (CNN or ConvNet) that has been trained on over a million images.

Get the files used in this demo: https://goo.gl/uVyfrG

The example has two parts: setting up the camera and performing object recognition. The first part shows how to use the webcam command to acquire images from the camera. Using the drawnow command, MATLAB is able to continuously update and display images taken by the camera.

The second part illustrates how to download a pretrained deep neural network called AlexNet and use MATLAB to continuously process the camera images. AlexNet takes the image as input and provides a label for the object in the image. You can experiment with objects in your surroundings to see how accurate AlexNet is.

Today you can do this very easily with MATLAB, but even just a few years ago it would have been considered science fiction.

Source

Similar Posts

39 thoughts on “Deep Learning in 11 Lines of MATLAB Code
  1. got error msg at line 6: label=classify(nnet,grayImage);
    msg is:
    Error using SeriesNetwork/predict (line 171)
    For an image input layer, the input data for predict must be a single image, a 4D array of images, or an imageDatastore
    with the correct size.

    Error in SeriesNetwork/classify (line 250)
    scores = this.predict( X, varargin{:} );

    Error in deep (line 6)
    label=classify(nnet,grayImage);

    Plz anyone help me to correct this. I am reading a grayimage.

  2. I am using my build in camera in Mac with a trial Matlab version. I try it but error message comes up

    Error using SeriesNetwork/predict (line 319)
    For an image input layer, the input data must be a single image, a 4-D array of images, an imageDatastore, or
    a MiniBatchable Datastore with the correct size.

    Error in SeriesNetwork/classify (line 555)
    scores = this.predict( X, varargin{:} );

    Error in Object_recongition_0331 (line 10)
    label = classify(nnet, picture); % recongize the picture

    can someone help?

  3. Hi Please someone help with the following problem.
    For my application, I will be using a camera to take multiple images of certain types of mushrooms. I want to use image processing toolbox and deep learning CNN to recognize the 'only that type of mushroom which has a diameter larger than 3cm and smaller than 5cm'(I can do the same by opening up the individual image on imtool command and by measuring the distance using a ruler manually) what i want is that the code should read, analyse and process image, send the coordinates or position(or pixel location) automatically and repeatedly on different images on its own….
    Is this even possible using matlab and if yes please help me about how?
    Please help..
    Regards
    Arun

  4. Can someone advise what I am doing wrong – I get the following error: Error in webcam (line 159)
    matlab.webcam.internal.WebcamController(devName, devID);

Comments are closed.

WP2Social Auto Publish Powered By : XYZScripts.com