Hi, How do I resize a video to satisfy google net's size input layer ?
3 views (last 30 days)
Show older comments
I am currently doing a project whereby I have to detect vehicles using googlenet but I need to resize the size of the video for that. Anyone is able to help?
4 Comments
Guillaume
on 18 Jul 2018
I have tried imresize but it still doesn't work
imresize works. So if it still doesn't work it's because you've done something wrong. However, since you haven't shown use what you've done we can't tell you what you've done wrong.
As far as I know the googlenet interface does not take videos anyway, so you'd have to pass it each frame of the video.
Answers (2)
Diwakar Ravichandran
on 18 Jul 2018
Hi Syafiqah,
This is a question that was already answered on MATLAB answers. This should give you some headway for your problem. This is the link to the answer.
Hope this helps
Cheers!
0 Comments
Guillaume
on 18 Jul 2018
Are you willing to clarify about "pass it each frame of the video."
Your question is puzzling since at first glance you're doing the right thing in the 2nd half of your code. Yet, the first half of your code is nonsense.
The classification should be done similarly to the 2nd half. Something similar to:
trafficVid = VideoReader('C:\Users\syafiqah\Desktop\project\traffic.mp4');
for k = 1:trafficVid.NumberOfFrames %or use while trafficVid.HasFrame
label = classify(net, imresize(trafficis.readFrame, net.Layers(1).Inputsize)); %get image, resize and pass to classifier
%...
end
0 Comments
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!