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.03k stars 228 forks source link

Some issues about generating the realtionships (using PreCls) based on boxes and classes label. #79

Open Einstone-rose opened 3 years ago

Einstone-rose commented 3 years ago

❓ Questions and Help

Hi, it seems like that the pretrained PredCls model is trained on VG datasets (51 relationships, 150 objects). But if I want to test on this model using customs images (custom images have 1600 objects, i.e. 1600 classes labels), it seems that it doesn't work. Is there detection model pretrained on 1600 objects VG datasets? where can i download this kind of datasets? Thanks.

Einstone-rose commented 3 years ago

Hello, i am very confused when i test custom images (COCO 2014 train, given images and bboxes) on SGCls model, why does the model need the class label, attribute and relationships as input? It located at following: target = BoxList(box, (w, h), 'xyxy') # xyxy target.add_field("labels", torch.from_numpy(self.gt_classes[index])) target.add_field("attributes", torch.from_numpy(self.gt_attributes[index])) Because when i comment target.add_field("labels",...) and target.add_field("attributes"... , it doesn't work. How should I deal with it?

Einstone-rose commented 3 years ago

Hi, how can i generate fixed the number of boxes using SGDet? Should i alter certain parameters?

KaihuaTang commented 3 years ago

Hi, how can i generate fixed the number of boxes using SGDet? Should i alter certain parameters?

You can change ROI_HEADS.DETECTIONS_PER_IMG in the yaml config file or directly assign ROI_HEADS.DETECTIONS_PER_IMG Your_Prefered_Number in the command

Einstone-rose commented 3 years ago

Hi, how can i generate fixed the number of boxes using SGDet? Should i alter certain parameters?

You can change ROI_HEADS.DETECTIONS_PER_IMG in the yaml config file or directly assign ROI_HEADS.DETECTIONS_PER_IMG Your_Prefered_Number in the command

Thanks a lot! Also, i have a questions urgently need to be solved: When i test custom images using SGCls (theoretically only need images and boxes), and i alter the dataloader as following, (only put into the bounding box and comment out target.add_field("labels",...) and target.add_field("attributes"...): target = BoxList(box, (w, h), 'xyxy') # xyxy #target.add_field("labels", torch.from_numpy(self.gt_classes[index])) #target.add_field("attributes", torch.from_numpy(self.gt_attributes[index])) it will pop a error that also need the label and attributes input. It confuse me a lot.

KaihuaTang commented 3 years ago

SGCls and PredCls on custom images are not supported yet. Currently, in SGCls & PredCls modes, labels & attributes information are always loaded in order to generate the ground-truth annotations for all detected RoIs that used in the evaluation. Even if you don't need to evaluate the results in your custom images, these processings are always executed. To support you custom SGCls, you need to remove those parts in the codes.