필터 지우기
필터 지우기

How can i give a trained model some images as an input ?

조회 수: 3 (최근 30일)
Lukas Sohlbach
Lukas Sohlbach 2017년 12월 3일
댓글: Lukas Sohlbach 2017년 12월 5일
I trained a model with classification learner to classify fruits. Now i want to test my model. How can i give the model some images as an input ?

채택된 답변

Mukul Rao
Mukul Rao 2017년 12월 5일
Hello, in order to use the trained model to predict new data, you will first have to export the trained model to the workspace. You can click on the "Export Model" drop-down in the Classification Learner App, and select the first option. Once you have the trained model in the MATLAB workspace, you can call its "predict" method and supply new image data to make predictions.
  댓글 수: 3
Mukul Rao
Mukul Rao 2017년 12월 5일
Hi Lukas, yes that makes sense. You might want to take a look at this example that demonstrates the workflow. Using the bag of features, you will have to create an "imageCategoryClassifierObject" with the "trainImageCategoryClassifier" function. You can call the "predict" method on the classifier object and plug in the the new image data set as the input without having to convert it to a table. I believe you might have referred the predict method for a different classifier class in the documentation.
Lukas Sohlbach
Lukas Sohlbach 2017년 12월 5일
Hi Mark, does the "imageCategoryClassifierObject" only works on SVM ? Because my trained model based on a Decision Tree. I attached my trained classifier. This classifier has a function "c.predictFcn" link (where c is a variable for the classifier name) and this function requests a table as an input. Is there any possibility, after using a bagOfFeatures to train a Decision Tree, to this function to make a prediction on a new image? By the way, thanks for helping me out.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by