At the end the tutorial uses something like prediction[0]['masks'][0, 0] to get a mask.
So taking the boolean selector tensor preds_to_keep = prediction[0]['scores'] > 0.8
and then indexing the masks as prediction[0]['masks'][preds_to_keep, 0]. should do the trix. use .max(dim=0).values or so to take the maximum over all masks.
Best regards
Thomas