mirror of https://github.com/UX-Decoder/DINOv.git
10 lines
293 B
Python
10 lines
293 B
Python
|
from PIL import Image
|
||
|
import scipy.io
|
||
|
import numpy as np
|
||
|
|
||
|
def load_semseg(filename, loader_type):
|
||
|
if loader_type == 'PIL':
|
||
|
semseg = np.array(Image.open(filename), dtype=np.int)
|
||
|
elif loader_type == 'MAT':
|
||
|
semseg = scipy.io.loadmat(filename)['LabelMap']
|
||
|
return semseg
|