Detectron-MaskRCnn: 用于抠图的FCNN
?????? 市面上暫時(shí)還沒有找到可以在消費(fèi)機(jī)顯卡上實(shí)時(shí)運(yùn)行的MaskRCnn,TensorFlow即使是C++版本訓(xùn)練在coco數(shù)據(jù)集上的模型也是慢的要死,最后不堪忍受,只能放棄。
?????? 經(jīng)歷了一些列fuckingDog的復(fù)雜配置之后,終于配置成功了。測(cè)試一把
?????? Detectron地址:https://github.com/facebookresearch/Detectron
一、預(yù) 安裝環(huán)境
??????? #查看python ?? ubuntu16.04 默認(rèn)安裝了2.7 和3.5
??????? whereis python
??????? #安裝pip
??????? sudo apt-get install python-pip
??????? #根據(jù)Caffe2的介紹,安裝其他庫(kù)
??????? 使用cmake make之時(shí),選擇blas為openblas
???????
??????? sudo apt-get install libopenblas-dev
???????? 省去重新安裝eigen3.3Up...................................................
?????? #安裝caffe2成功后安裝detection,根據(jù)detection Github上的介紹
...................................................
二、InferImage
把Detectron導(dǎo)入Eclipse ,把infer_sample.py復(fù)制到根目錄;
在debug選項(xiàng)里面添加參數(shù):
--cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml
--output-dir out/? --image-ext? jpg --wts /home/wishchin/build/detectron/model/model_final.pkl demo
結(jié)果輸出到out文件夾
?
對(duì)于自己的數(shù)據(jù),檢測(cè)結(jié)果還不錯(cuò)!
時(shí)間消耗在1秒左右
INFO infer_simple.py: 145: Inference time: 0.906s
INFO infer_simple.py: 147:? | im_detect_bbox: 0.765s
INFO infer_simple.py: 147:? | misc_mask: 0.091s
INFO infer_simple.py: 147:? | im_detect_mask: 0.041s
INFO infer_simple.py: 147:? | misc_bbox: 0.008s
NFO infer_simple.py: 111: Processing image/nordic/livingroom (40).jpg -> image/nordicOut/livingroom (40).jpg.pdf
INFO infer_simple.py: 119: Inference time: 0.846s
INFO infer_simple.py: 121:? | im_detect_bbox: 0.783s
INFO infer_simple.py: 121:? | misc_mask: 0.017s
INFO infer_simple.py: 121:? | im_detect_mask: 0.035s
INFO infer_simple.py: 121:? | misc_bbox: 0.010s
INFO infer_simple.py: 124:? \ Note: inference on the first image will be slower than the rest (caches and auto-tuning need to warm up)
INFO infer_simple.py: 111: Processing image/nordic/livingroom (32).jpg -> image/nordicOut/livingroom (32).jpg.pdf
INFO infer_simple.py: 119: Inference time: 0.366s
INFO infer_simple.py: 121:? | im_detect_bbox: 0.320s
INFO infer_simple.py: 121:? | misc_mask: 0.015s
INFO infer_simple.py: 121:? | im_detect_mask: 0.020s
INFO infer_simple.py: 121:? | misc_bbox: 0.011s
INFO infer_simple.py: 111: Processing image/nordic/livingroom (57).jpg -> image/nordicOut/livingroom (57).jpg.pdf
INFO infer_simple.py: 119: Inference time: 0.514s
INFO infer_simple.py: 121:? | im_detect_bbox: 0.445s
INFO infer_simple.py: 121:? | misc_mask: 0.017s
INFO infer_simple.py: 121:? | im_detect_mask: 0.042s
INFO infer_simple.py: 121:? | misc_bbox: 0.011s
INFO infer_simple.py: 111: Processing image/nordic/livingroom (41).jpg -> image/nordicOut/livingroom (41).jpg.pdf
INFO infer_simple.py: 119: Inference time: 0.336s
INFO infer_simple.py: 121:? | im_detect_bbox: 0.297s
INFO infer_simple.py: 121:? | misc_mask: 0.006s
INFO infer_simple.py: 121:? | im_detect_mask: 0.021s
INFO infer_simple.py: 121:? | misc_bbox: 0.012s
INFO infer_simple.py: 111: Processing image/nordic/livingroom (65).jpg -> image/nordicOut/livingroom (65).jpg.pdf
INFO infer_simple.py: 119: Inference time: 0.582s
INFO infer_simple.py: 121:? | im_detect_bbox: 0.483s
INFO infer_simple.py: 121:? | misc_mask: 0.025s
INFO infer_simple.py: 121:? | im_detect_mask: 0.063s
INFO infer_simple.py: 121:? | misc_bbox: 0.011s
INFO infer_simple.py: 111: Processing image/nordic/livingroom (42).jpg -> image/nordicOut/livingroom (42).jpg.pdf
INFO infer_simple.py: 119: Inference time: 0.397s
INFO infer_simple.py: 121:? | im_detect_bbox: 0.348s
INFO infer_simple.py: 121:? | misc_mask: 0.014s
INFO infer_simple.py: 121:? | im_detect_mask: 0.024s
INFO infer_simple.py: 121:? | misc_bbox: 0.011s
總結(jié)
以上是生活随笔為你收集整理的Detectron-MaskRCnn: 用于抠图的FCNN的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 知道这样重命名文件都是大神级别!
- 下一篇: oracle权限grant权限