File size: 944 Bytes
d4b77ac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
from .STTN_mask import create_random_shape_with_random_motion
import logging
logger = logging.getLogger('base')
def initialize_mask(videoLength, dataInfo):
from .MaskModel import RandomMask
from .MaskModel import MidRandomMask
from .MaskModel import MatrixMask
from .MaskModel import FreeFormMask
from .MaskModel import StationaryMask
return {'random': RandomMask(videoLength, dataInfo),
'mid': MidRandomMask(videoLength, dataInfo),
'matrix': MatrixMask(videoLength, dataInfo),
'free': FreeFormMask(videoLength, dataInfo),
'stationary': StationaryMask(videoLength, dataInfo)
}
def create_mask(maskClass, form):
if form == 'mix':
from random import randint
candidates = list(maskClass.keys())
candidate_index = randint(0, len(candidates) - 1)
return maskClass[candidates[candidate_index]]()
return maskClass[form]() |