aim-uofa / AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.
https://git.io/AdelaiDet
Other
3.38k stars 650 forks source link

How to visulize the result of MEInst? #150

Open Paddy-Xu opened 4 years ago

Paddy-Xu commented 4 years ago
I got pretty decent result, but not sure how to visualize the result. AP AP50 AP75 APs APm APl
87.370 99.010 97.750 nan nan 87.481

I tried the example from Detectron, but it does not work (outputs is none)

`from detectron2.utils.visualizer import ColorMode dataset_dicts = get_balloon_dicts("................")

for d in random.sample(dataset_dicts, 3):
im = cv2.imread(d["file_name"]) outputs = predictor(im) v = Visualizer(im[:, :, ::-1], metadata=balloon_metadata, scale=0.5, instance_mode=ColorMode.IMAGE_BW # remove the colors of unsegmented pixels. This option is only available for segmentation models ) out = v.draw_instance_predictions(outputs["instances"].to("cpu")) cv2_imshow(out.get_image()[:, :, ::-1])`

ustczhouyu commented 4 years ago

@Paddy-Xu Hi, do you know how to generate a json file for MEINS training? Can you give me this code? My email is zhou19920226@126.com. Thank you. @tianzhi0549 @

Paddy-Xu commented 4 years ago

@Paddy-Xu Hi, do you know how to generate a json file for MEINS training? Can you give me this code? My email is zhou19920226@126.com. Thank you. @tianzhi0549 @

Hi, do you mean the json file for COCO dataset or your custom data?

zzzzzz0407 commented 4 years ago

@Paddy-Xu Hello, I'm sorry I donot find this issue at once. Have you solved the problem? If not, I will update the demo this week (maybe sat/sunday). Actually, it should be same as Mask RCNN.

Paddy-Xu commented 4 years ago

@Paddy-Xu Hello, I'm sorry I donot find this issue at once. Have you solved the problem? If not, I will update the demo this week (maybe sat/sunday). Actually, it should be same as Mask RCNN.

That would be very helpful! I did try out the tutorial of Detectron2 for mask-RCNN, https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5. But it didn't work. By the way, I am also wondering if it is possible to to train like given in Detectron2. `trainer = DefaultTrainer(cfg)

trainer.resume_or_load(resume=False)

trainer.train() `.

Because otherwise, I have to modify the code in train_net to register the custom dataset and change cfg. Thanks!

zzzzzz0407 commented 4 years ago

@Paddy-Xu Hello, I'm sorry I donot find this issue at once. Have you solved the problem? If not, I will update the demo this week (maybe sat/sunday). Actually, it should be same as Mask RCNN.

That would be very helpful! I did try out the tutorial of Detectron2 for mask-RCNN, https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5. But it didn't work. By the way, I am also wondering if it is possible to to train like given in Detectron2. `trainer = DefaultTrainer(cfg)

trainer.resume_or_load(resume=False)

trainer.train() `.

Because otherwise, I have to modify the code in train_net to register the custom dataset and change cfg. Thanks!

It should be same as other algorithms in AdelaiDet, I do not modify the train scheme. (In my guess, the training of AdelaiDet is same as detectron2.) And if you want to train your own datasets, just follow the detectron's register way.

Paddy-Xu commented 4 years ago

@Paddy-Xu Hello, I'm sorry I donot find this issue at once. Have you solved the problem? If not, I will update the demo this week (maybe sat/sunday). Actually, it should be same as Mask RCNN.

That would be very helpful! I did try out the tutorial of Detectron2 for mask-RCNN, https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5. But it didn't work. By the way, I am also wondering if it is possible to to train like given in Detectron2. trainer = DefaultTrainer(cfg) trainer.resume_or_load(resume=False) trainer.train() . Because otherwise, I have to modify the code in train_net to register the custom dataset and change cfg. Thanks!

It should be same as other algorithms in AdelaiDet, I do not modify the train scheme. (In my guess, the training of AdelaiDet is same as detectron2.) And if you want to train your own datasets, just follow the detectron's register way.

Of course, if you could make a demo of visualization for one of the algortihms in AdelaiDet, I believe I could figure it out for my case! Thanks a lot!

zzzzzz0407 commented 4 years ago

@

@Paddy-Xu Hello, I'm sorry I donot find this issue at once. Have you solved the problem? If not, I will update the demo this week (maybe sat/sunday). Actually, it should be same as Mask RCNN.

That would be very helpful! I did try out the tutorial of Detectron2 for mask-RCNN, https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5. But it didn't work. By the way, I am also wondering if it is possible to to train like given in Detectron2. trainer = DefaultTrainer(cfg) trainer.resume_or_load(resume=False) trainer.train(). Because otherwise, I have to modify the code in train_net to register the custom dataset and change cfg. Thanks!

It should be same as other algorithms in AdelaiDet, I do not modify the train scheme. (In my guess, the training of AdelaiDet is same as detectron2.) And if you want to train your own datasets, just follow the detectron's register way.

Of course, if you could make a demo of visualization for one of the algortihms in AdelaiDet, I believe I could figure it out for my case! Thanks a lot!

Just follow these commands for vis (repalce the config/weights for MEInst). python demo/demo.py \ --config-file configs/FCOS-Detection/R_50_1x.yaml \ --input input1.jpg input2.jpg \ --opts MODEL.WEIGHTS fcos_R_50_1x.pth Actually, the demo can be used for every algorithm in AdelaiDet, feel free! The info is in our homepage