필터 지우기
필터 지우기

classify an image?

조회 수: 1 (최근 30일)
Tathva
Tathva 2023년 5월 15일
편집: Tathva 2023년 7월 16일
. Thank you. help has been appreciated
  댓글 수: 1
KSSV
KSSV 2023년 5월 15일
Save the net and use it. You need to provide inputs in the way you have trained.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sandeep
Sandeep 2023년 5월 22일
Hi Tathva,
To use a trained neural network in MATLAB to classify a random image, you can use the classify function when you have your trained network stored in an appropriate variable. Assuming that you have your network stored in variable called net a sample implementation is given below,
% Load the pretrained network
load('network.mat');
% Load a random image to classify
im = imread('my_image.jpg');
% Resize the image to the same size as the training images
im = imresize(im,net.Layers(1).InputSize(1:2));
% Classify the image
label = classify(net,im);
% Display the predicted label
disp([char(label)]);
The image is resized to the same size that was used during training of the neural network. We use the classify function to classify the image, which returns the predicted label for the image.
For more insight about the classify function, refer the following documentation: Classify data using trained deep learning neural network

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by