smallcorgi / Faster-RCNN_TF

Faster-RCNN in Tensorflow
MIT License
2.34k stars 1.12k forks source link

How to extract the features from bounding boxes? #148

Open paulcx opened 7 years ago

paulcx commented 7 years ago

I wonder if I can use the frcnn to extract the features after bbox regression. Then I need to add one more layer like xgboost to output some possibility. For example, I trained some classes like ears,noses,eyes and I want to use these features from such selected bboxes to predict age. It's grateful if anyone can help.

LHagendoorn commented 7 years ago

I'm pretty sure the features you are looking for can be extracted from the roi-pooling layer

louisquinn commented 7 years ago

@paulcx,

(Assuming you're using VGG16). You can get the features in the following way:

paulcx commented 7 years ago

Thank you @louisquinn. I'm using resnet101 from here . I'm wondering if your second approach could suit my case. General speaking of the solution would be extracting the tensors from last fc layer (or pooling layer) and teach a softmax layer after that for the classifier.

btw, the resnet on frcnn has very good detection performance.