danfeiX / scene-graph-TF-release

"Scene Graph Generation by Iterative Message Passing" code repository
http://cs.stanford.edu/~danfei/scene-graph/
MIT License
425 stars 130 forks source link

getting the vert features #10

Closed mrfarazi closed 7 years ago

mrfarazi commented 7 years ago

Hello @danfeiX I am trying to get the features for the each vert in an image. I figured it is passed through the vert_factor but when I save the vert_factor to a np.ndarry it's only a 512d vector for one image. I suspect it's only for one bounding_box?

If someone can give any insight on how to get the features for all vert of an image, would be much appreciated.

danfeiX commented 7 years ago

Could you elaborate on how you get the factor? Note that boxes from all images are stacked on the first dimension to form a batch. The first (i.e., 0) dimension of the tensor is the batch size, which is the total number of boxes of all images in the current mini-batch. If you only save the first sample, e.g., vert_factor[i, ...], it would be the factor of the first box, not the factor of the first image.

mrfarazi commented 7 years ago

Thanks for you reply.

I pass the vert_factor through the self variable. I guess the minibatch size is 1 by default? If so, it would mean for each image the first dimension of the vert_factor tensor would be no. of boxes and the corresponding values would be the features in that box.

danfeiX commented 7 years ago

The batch size is 256 by default (https://github.com/danfeiX/scene-graph-TF-release/blob/master/lib/fast_rcnn/config.py#L50).

The number of image does not affect the mini-batch size. Again, boxes from each image are stacked together to form a minibatch (the 0-th dimension). Each min-batch of vert_factor would just be (256, 512) instead of (num_images, 256, 512)

danfeiX commented 7 years ago

close due to inactivity