SamsungLabs / fbrs_interactive_segmentation

[CVPR2020] f-BRS: Rethinking Backpropagating Refinement for Interactive Segmentation https://arxiv.org/abs/2001.10331
Mozilla Public License 2.0
583 stars 94 forks source link

Can i use the pretrained model without the GUI? #4

Closed humzaahmad906 closed 4 years ago

ptrvilya commented 4 years ago

Yes, checkout Evaluation section of readme and jupyter notebook for details.

humzaahmad906 commented 4 years ago

Yes but if i'm passing custom images here like

clicks_list, ious_arr, pred = evaluate_sample(cv2.imread("example.jpg"), cv2.imread("1.jpg", cv2.IMREAD_GRAYSCALE), predictor, pred_thr=MODEL_THRESH, max_iou_thr=TARGET_IOU, max_clicks=EVAL_MAX_CLICKS)

Do i need to change something? Also can i use the evaluation process without giving it a mask?

ptrvilya commented 4 years ago

There are two options:

  1. If you want to get NoC metric value you have to pass gt mask to evaluate_sample as in this mode user clicks are generated automatically with a certain strategy (refer to the paper for details).
  2. If you want to get a predicted mask for the image with custom clicks you have to pass user clicks to a predictor (see lines 28 - 57 for an example). GUI is used here to ease the choosing of the next click, but this can be done manually without interface.

In both options image should be normalized before passing it to the network.

humzaahmad906 commented 4 years ago

It helped alot. Thanks