Open AliAlfatemi opened 1 year ago
You can set cfg.MODEL.DEVICE = "cpu"
before you load your Predictor
Example:
class Foo:
def __init__(self):
cfg = get_cfg()
add_deeplab_config(cfg)
add_maskformer2_config(cfg)
cfg.merge_from_file("./ai/image_segmentation/Mask2Former/configs/coco/panoptic-segmentation/swin/maskformer2_swin_large_IN21k_384_bs16_100ep.yaml")
cfg.MODEL.WEIGHTS = 'https://dl.fbaipublicfiles.com/maskformer/mask2former/coco/panoptic/maskformer2_swin_large_IN21k_384_bs16_100ep/model_final_f07440.pkl'
cfg.MODEL.MASK_FORMER.TEST.SEMANTIC_ON = True
cfg.MODEL.MASK_FORMER.TEST.INSTANCE_ON = True
cfg.MODEL.MASK_FORMER.TEST.PANOPTIC_ON = True
cfg.MODEL.DEVICE = "cpu"
self.predictor = DefaultPredictor(cfg)
Hello, I am trying to run mask2former on my local laptop, but it requires a GPU which I do not have. I know that I can run it using Google Colab, but I am unfamiliar with how to use the platform and am not sure if I can manipulate the package in order to visualize the mask binary for the main object in the image. If I do not have a GPU on my computer, what are my options for running mask2former and manipulating the package as I need to? Can you please advise me on what to do in this situation?