File size: 403 Bytes
28b27d8
adff5a8
28b27d8
3005834
28b27d8
 
 
3005834
 
28b27d8
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from ldm.util import create_carvekit_interface, load_and_preprocess
import spaces

@spaces.GPU
def load_preprocess_model():
    carvekit = create_carvekit_interface()
    return carvekit
    
@spaces.GPU
def preprocess_image(models, input_im):
    '''
    :param input_im (PIL Image).
    :return input_im (H, W, 3) array.
    '''
    input_im = load_and_preprocess(models, input_im)
    return input_im