faster-rcnn.pytorch icon indicating copy to clipboard operation
faster-rcnn.pytorch copied to clipboard

How to use demo.py to get the visual feature of each region (box)?

Open HaoYang0123 opened this issue 5 years ago • 4 comments

I download VGG-16 model and use this model in demo.py. It returns multiple boxes in each image, however it doesn't output the visual features of these boxes. How to modify this code?

HaoYang0123 avatar Apr 10 '20 14:04 HaoYang0123

it doesn't output the visual features of these boxes

What do you mean? Network visualize bounding boxes on image, class name and probability.

loolzaaa avatar Apr 12 '20 09:04 loolzaaa

I have resolved this problem. I need each region feature, you can find in lib/model/faster_rcnn/faster_rcnn.py (line 86): pooled_feat = self._head_to_tail(pooled_feat). I need pooled_feat, if I use resnet-101 model, pooled_feat shape is 300*2048, which has 300 regions and each region has features (dim=2048).

HaoYang0123 avatar Apr 12 '20 15:04 HaoYang0123

Is your torch.utils.ffi running correctly?

cskarthik7 avatar Apr 16 '20 05:04 cskarthik7

I have resolved this problem. I need each region feature, you can find in lib/model/faster_rcnn/faster_rcnn.py (line 86): pooled_feat = self._head_to_tail(pooled_feat). I need pooled_feat, if I use resnet-101 model, pooled_feat shape is 300*2048, which has 300 regions and each region has features (dim=2048).

HI, I have the same problem. Can you share your code?

KrystalCWT avatar Oct 15 '21 06:10 KrystalCWT