More Related Content
Similar to Combining “Text to Speech” and “Object Recognition” Using Deep Learning Tool (Alexnet) in MatLab (20)
Combining “Text to Speech” and “Object Recognition” Using Deep Learning Tool (Alexnet) in MatLab
- 1. Aim: Combining “Text to Speech” and “Object Recognition” Using Deep
Learning Tool(Alexnet) in MatLab
Program:
Text to Speech:
UserPrompt = 'Enter your Text';
TitleBar = 'TEXT TO SPEECH';
String = 'MATLAB is Best!';
UserInput = inputdlg(UserPrompt,TitleBar,1,{String});
if isempty(UserInput)
return;
end
UserInput = char(UserInput);
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, UserInput);
OBJECT RECOGNTION:
neural_Network = alexnet;
load_Image = imread('butterfly.jpg');
candidate_Image = imresize(load_Image,[227,227]);
label = classify(neural_Network, candidate_Image);
image(candidate_Image);
title(char(label));
object_Name = char(label);
NET.addAssembly('System.Speech');
objt = System.Speech.Synthesis.SpeechSynthesizer;
objt.Volume = 100;
Speak(objt, object_Name);
- 2. OBJECT DETECTED:
COMBINING THE TWO PROGRAMS IN ONE:
clc;
close all;
clear all;
UserPrompt = 'Enter your Text';
TitleBar = 'TEXT TO SPEECH';
String = '.jpg';
UserInput = inputdlg(UserPrompt,TitleBar,1,{String});
if isempty(UserInput)
return;
end
UserInput = char(UserInput);
NET.addAssembly('System.Speech');
obj = System.Speech.Synthesis.SpeechSynthesizer;
obj.Volume = 100;
Speak(obj, UserInput);
neural_Network = alexnet;
load_Image = imread (UserInput);
candidate_Image = imresize(load_Image,[227,227]);
label = classify(neural_Network, candidate_Image);
image(candidate_Image);
title(char(label));
object_Name = char(label);