SF-Mask-RCNN icon indicating copy to clipboard operation
SF-Mask-RCNN copied to clipboard

questions for inference.py

Open meiguiz opened this issue 3 years ago • 1 comments
trafficstars

hello Dr.SeungBack, thanks for your nice project! 2022-05-31 15-21-01屏幕截图 2022-05-31 15-27-09屏幕截图

I want to make a category classification for your segmentation project,and I get the predicted result as shown above,but I do not know how to show the category name and labels in inference.py. Sorry to bother you.thank you very much!

meiguiz avatar May 31 '22 07:05 meiguiz

Hi @meiguiz I think that adding the following lines at draw_prediction in utils/visualizer.py would show the category name.

labels = pred["labels"].detach().numpy()
instviz = imgviz.instances2rgb(image=rgb, masks=masks[cnd, :, :], labels=list(range(len(scores[cnd]))), 
                                    captions=[str(x) for x in labels[cnd]])

By the way, I am not a "Dr. "and a graduate student pursuing a Ph.D. degree....!

SeungBack avatar Jun 02 '22 00:06 SeungBack