-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webcam Demo #29
base: master
Are you sure you want to change the base?
Webcam Demo #29
Conversation
Hello asbroad, |
Hi Christopher, To run the webcam demo you need two things in addition to Rob's fast-rcnn, (1) the webcam.py file and (2) Dlib. To get the webcam file, you can get this pull request by either following these instructions (https://help.github.com/articles/checking-out-pull-requests-locally/) or, maybe more simply, by cloning my forked repository on my github page (the only differences are the webcam file and added information in the readme about how to run it). If you're having trouble installing Dlib, be sure to consult http://dlib.net/compile.html - but it's an extremely easy to use library. Oh, and you'll also need a webcam, but I assume that is obvious :) Hope that helps, Alex |
I got the demo running, it works. I have a few questions, I still have no idea what does the scale factor actually does, and it's running like with 3-4 seconds delay on the Jetson TK1, but it's a start! |
Hey Christopher, Sorry for the delay in response, the scaling factor simply scales the webcam image. So if your webcam produces an 640x480 image, a scaling factor of 2 will produce an image scaled down by that factor in each dimension (i.e. the image that is processed will be 320x240). If you have any more specific questions, feel free to message me directly.
|
@asbroad |
Hey @smajida , I haven't looked at the Faster RCNN code much, but from what I remember about the paper, they replace the selective search region proposal method with another neural net (a region proposal net) so you shouldn't need to use any of the additions from my pull request (this was just a work around to not use matlab and to just take the image from a computer's webcam). Take a look at their github repo (https://github.com/rbgirshick/py-faster-rcnn) as it has a python implementation and a link to a matlab implementation - hope that helps and good luck! |
So if I replace 'person' in your code to say 'dog'. It should detect it right? |
yes as far as I know. 2016-01-14 11:09 GMT+01:00 arushk1 notifications@github.com:
|
@arushk1 yes, that is correct. the pascal voc 2007 dataset includes the following 20 classes Person: person |
@cuatristapr |
I solve it |
@cuatristapr |
@kesonyk |
Hi, I'm trying to run your webcam.py, but I can not run. I can not understand what is happened. What should I do? The rewrited code is blow
and
|
it's look like file connect problem if you use Japanese or not English directory maybe happed like folder file not find problem. and what about change folder file directory short? exception bug will be fix. 보낸 사람: miyamon11 notifications@github.com Hi, I'm trying to run your webcam.py, but I can not run. I can not understand what is happened. What should I do? The rewrited code is blow `#!/usr/bin/env python -- coding: utf-8 --Fast R-CNN Written by Ross Girshick""" import _init_paths CLASSES = ('background', NETS = {'vgg16': ('VGG16', def vis_detections(im, class_name, dets, thresh=0.5): im = im[:, :, (2, 1, 0)]
ax.set_title(('{} detections with ' def demo(net, im, scale_factor, classes): im2 = cv2.resize(im, (0,0), fx=1.0/scale_factor, fy=1.0/scale_factor) obj_proposals_in = [] obj_proposals = np.empty((len(obj_proposals_in),4)) Detect all object classes and regress object boundsscores, boxes = im_detect(net, im2, obj_proposals) Visualize detections for each classCONF_THRESH = 0.8 return [im2, cls, dets, CONF_THRESH] def parse_args(): args = parser.parse_args() return args if name == 'main': prototxt = os.path.join(cfg.MODELS_DIR, NETS[args.demo_net][0], if not os.path.isfile(caffemodel): if args.cpu_mode: print '\n\nLoaded network {:s}'.format(caffemodel) cap = cv2.VideoCapture(0) while(True):
When everything done, release the capturecap.release() cv2.destroyAllWindows()` — |
thank you for your reply,takemegod. I think this problem is not file connect problem. I don't use Japanese as folder names at all. in fact,
I think that the cause may be in utils/cython_nms.py. I changed this module from utils/cython_nms.py to fast_rcnn/nms_wrapper.py . and the the error resource is below(~/py-faster-rcnn/caffe-fast-rcnn/python/caffe) `def _Net_forward(self, blobs=None, start=None, end=None, **kwargs):
` `def im_detect(net, im, boxes=None):
` What should I do? |
@tsaiJN Maybe your memory issue has to deal with the libraries. Check that all the dependencies are working good, and that you use the openCV designed for the Jetson (it has a different implementation for the CUDA framework). |
@kesonyk try to use the COCO, it is a small net. Also, depends on what you want to train for. If you want for the ImageNET or PASCAL, it will be different for each. You can also train a fast-rcnn model on a imageset, which you can create and train that model on. That way, it will be smaller and the Jetson will run it better. NOTE: you are not looking to train for a large dataset, you want something small and concise, that way it runs well on the Jetson. |
@miyamon11 i meet same error , do u have solved the problem? |
Hi, I have execute the ./tools/webacm.py, the cam turn on and select the objects but no classify them. Do you know what could be? |
Hey Rob,
I added a demo of your system running a person detector on a live webcam feed. It requires Dlib to perform the selective search portion of the algorithm, and obviously a webcam. I also updated the readme to explain how to use the webcam demo. It's able to run at ~0.75 seconds per frame on a 2GB GPU and ~0.15 on a Titan X.