Open monajalal opened 8 years ago
Check the code of
prototxt = os.path.join(cfg.MODELS_DIR, NETS[args.demo_net][0], 'faster_rcnn_alt_opt', 'faster_rcnn_test.pt')
caffemodel = os.path.join(cfg.DATA_DIR, 'faster_rcnn_models', NETS[args.demo_net][1])
to read the end2end prototxt
and the output parameters are not correct
layer {
name: "cls_score"
type: "InnerProduct"
bottom: "fc7"
top: "cls_score"
inner_product_param {
num_output: $NUMBER_OF_CLASSES + 1 (BACKGROUND)
}
}
layer {
name: "bbox_pred"
type: "InnerProduct"
bottom: "fc7"
top: "bbox_pred"
inner_product_param {
num_output: 4* ($NUMBER_OF_CLASSES + 1 (BACKGROUND))
}
}
The bash files that you are running are calling the solver.prototxt. The paths to the datasets and the train.prototxt are to be changed here.
I think I have successfully run COCO-VGG model with the following steps:
2.Copy test.prototxt from /FASTER_RCNN_ROOT_FOLDER/models/coco/VGG16/faster_rcnn_end2end/ to /FASTER_RCNN_ROOT_FOLDER/models/pascle_voc/VGG16/. Rename test.prototxt as coco_test.pt
3.in demo.py, modify: prototxt = os.path.join(cfg.MODELS_DIR,NETS[args.demo_net][0],'faster_rcnn_alt_opt','coco_test.pt') caffemodel = '/FASTER_RCNN_ROOT_FOLDER/data/faster_rcnn_models/coco_vgg16_faster_rcnn_final.caffemodel'
4.Near the head of demo.py, modify: CLASSES = ('background', 'person', 'bicycle', 'car','motorcycle','airplane','bus','train', 'truck', 'boat','traffic light', 'fire hydrant', 'stop sign', 'parking meter', 'bench','bird','cat','dog','horse','sheep', 'cow', 'elephant','bear','zebra','giraffe','hat','umbrella', 'handbag','tie','suitcase', 'frisbee','skis','snowboard','sports ball','kite', 'baseball bat','baseball glove','skateboard','surfboard','tennis racket', 'bottle','wine glass','cup','fork','knife','spoon','bowl','banana','apple','sandwich', 'orange','broccoli','carrot','hot dog','pizza','donut','cake','chair','couch','potted plant', 'bed','dining table','window','tv','laptop','mouse','remote','keyboard','cell phone','microwave', 'oven', 'sink','refrigerator','blender','book','clock','vase','scissors','teddy bear','hair drier','tooth brush')
I cannot ganrantee everything, but at least these work for me.
I created a docker image with a working demo using the Coco model. https://hub.docker.com/r/jimmyli/faster-rcnn-gpu/
@enderhsu The link of coco-vgg model you given above is invalid now, could you tell how to download this model now? Or could you send it to me? my email address is sjtuwangzhe2015@163.com, thank you very much!
Goal: Use faster-RCNN to detect mscoco classes in random objects off the web. I am running this code (slightly modified version of tools/demo.py) and I am not sure what I should change in which setting files so that it would use the mscoco .caffemodel? https://gist.github.com/monajalal/07f891480a49c7559099d5604d5340ad When I run the code I can see that it says:
Loaded network /home/mona/computer_vision/py-faster-rcnn/data/faster_rcnn_models/VGG16_faster_rcnn_final.caffemodel
Browsing to faster_rcnn_models I have:I downloaded this caffemodel for mscoco (is this the correct one?):
mona@pascal:~/computer_vision/py-faster-rcnn/data/faster_rcnn_models$ wget www.cs.berkeley.edu/~rbg/faster-rcnn-data/coco_vgg16_faster_rcnn_final.caffemodel
How can I tell the code to use the .prototxt files from this directory?
I have changed this line in
mona@pascal:~/computer_vision/py-faster-rcnn$ vi lib/fast_rcnn/config.py
__C.MODELS_DIR = osp.abspath(osp.join(__C.ROOT_DIR, 'models', 'pascal_voc'))
to:__C.MODELS_DIR = osp.abspath(osp.join(__C.ROOT_DIR, 'models', 'coco'))
and have the following in my:
I also changed the code in demo_no_bb.py to include this https://gist.github.com/monajalal/ae805bdfc54fa0d855efa4722c6d6cb0
are lines 58 and 59 correct? When I run this new code, I get this error:
I am not sure how to fix this?
so I have 76 classes (from 81 mscoco categories) and I have changed all the places that were 81 to 76:
Additionally these are two of the other things I tried: https://gist.github.com/monajalal/b7af9236f4e7d4af047b8fa58901d79c