Spaces:
Sleeping
Sleeping
from graphbook import param, resource | |
from transformers import AutoModelForImageSegmentation | |
def rmbg_model(self): | |
model = AutoModelForImageSegmentation.from_pretrained( | |
self.model_name, trust_remote_code=True | |
) | |
if self.use_cuda: | |
return model.to("cuda") | |
return model | |