facebookarchive / fb.resnet.torch

Torch implementation of ResNet from http://arxiv.org/abs/1512.03385 and training scripts
Other
2.29k stars 664 forks source link

Can I use video or webcam to classify ? (I have a fine-tuned model with my own data.) #194

Open Laodax opened 7 years ago

Laodax commented 7 years ago

HI! I know that I can classify image one by one with classify.lua, but I need to know how to use video or webcam to classify? My idea is that cut the video to frames, and then each frame use classify.lua to classify. I hope I can classify each frame with my video and webcam in realtime. But I really don't know how to do it. Could somebody help me,please? I am new in marchine learning. Thanks a lot!

Laodax commented 7 years ago
-- load the image as a RGB float tensor with values 0..1
   local img = image.load(arg[i], 3, 'float')
   local name = arg[i]:match( "([^/]+)$" )

They are in classify.lua.

I think that maybe "image.load" can use videocapture to replace it. Let each frame to classify. Does this method work?

@aabobakr @colesbury Do you have any idea?Please.