KaihuaTang / Scene-Graph-Benchmark.pytorch

A new codebase for popular Scene Graph Generation methods (2020). Visualization & Scene Graph Extraction on custom images/datasets are provided. It's also a PyTorch implementation of paper “Unbiased Scene Graph Generation from Biased Training CVPR 2020”
MIT License
1.06k stars 228 forks source link

Makes the image retrieval part work without too much effort. (should address issues #64 and #109) #156

Closed rafiberlin closed 2 years ago

rafiberlin commented 2 years ago

I have made some modifications to the code to be able to run the image retrieval part with the pre-trained SGDet Model you uploaded. With proper pre-configuration, the only hard coded path are in tools/image_retrieval_main.py.

The main changes:

The evaluator uses normalized cosine similarity for the scoring. There s some handling for bad training samples (samples with no relationships) Some input Tensors needed to be transposed to enable the network to train properly.

rafiberlin commented 2 years ago

I added a script that shows how the sentence scene graphs were created (can''t recreate exactly the same text graph, as this is based on Spacy Parsing and it has changed since the original version). I also added an evaluation script for image retrieval with another logic.

PS: I believe, that could have achieve better performance, if you had trained for only 9 / 10 epochs. I am using your code for a project and some results can be found here:

https://github.com/rafiberlin/WS21_IM_map_world_image_retrieval/blob/main/avatar_sgg/notebooks/plot_metrics.ipynb