jwyang / graph-rcnn.pytorch

[ECCV 2018] Official code for "Graph R-CNN for Scene Graph Generation"
733 stars 157 forks source link

RGB channel correct? #90

Open liunian-harold-li opened 4 years ago

liunian-harold-li commented 4 years ago

Hi Jianwei, thank you for the excellent code! When I was trying to visualize the image and predictions, I find the RGB channels of the image swapped.

I looked into the original code for generating the imdb_1024.h5 and I find the dataset is already in the BGR format (https://github.com/danfeiX/scene-graph-TF-release/blob/master/data_tools/vg_to_imdb.py#L81). But in this repo, the model flips it back to RGB (https://github.com/jwyang/graph-rcnn.pytorch/blob/master/lib/data/transforms/transforms.py#L117). I wonder if that is the intended behavior as I presume that the input to the model should be in BGR. Am I using the correct imdb_1024.h5?

I would greatly appreciate your input. Thanks!

entalent commented 4 years ago

I encountered the same question ... I used the mini_vg from http://svl.stanford.edu/projects/scene-graph/dataset/mini-vg.zip, abd the R and B channels of the visualized images are swapped. I noticed that in all the yaml files provided in the config folder, the value of TO_BGR255 is not specified, and the value of cfg.INPUT.TO_BGR255 is True all the time. Thus, I guess the img read from the h5 file ( https://github.com/jwyang/graph-rcnn.pytorch/blob/master/lib/data/vg_hdf5.py#L108 ) should be in RGB format.

I would be grateful if the author could confirm the order of the image channels.