utils.py
def load_data():
    """
    load all three clips to a dict variable
    """
    # =================== first clip =================== 
    print('clip_1 images importing...')
    fileName1 = sorted(glob.glob(data + 'clip_1/*.jpg'))
    img1 = [cv2.imread(img) for img in fileName1]
    label1 = np.zeros((len(img1), 1))
    shot1 = np.array([(133, 134)])
    # =================== second clip =================== 
    print('clip_2 images importing...')
    fileName2 = sorted(glob.glob(data + 'clip_2/*.jpg'))
    img2 = [cv2.imread(img) for img in fileName2]
    label2 = np.zeros((len(img2), 1))
    shot2 = np.array([(0, 1), (55, 57), (72, 74), (78, 79), 
                      (86, 87), (98, 99), (110, 112), (121, 124)])
    # =================== third clip =================== 
    print('clip_3 images importing...')
    fileName3 = sorted(glob.glob(data + 'clip_3/*.jpg'))
    img3 = [cv2.imread(img) for img in fileName3]
    label3 = np.zeros((len(img3), 1))
    shot3 = np.array([(32, 41), (59, 60), (61, 62),
                      (76, 89), (170, 171), (243, 254)])
    print('Done !')
    test = {'X': [img1, img2, img3], 'Y': [shot1, shot2, shot3]}
    return test

    load all three clips to a dict variable
    
load all three clips to a dict variable
load all three clips to a dict variable
def load_data():
    print('clip_1 images importing...')
    fileName1 = sorted(glob.glob(data + 'clip_1/*.jpg'))
    img1 = [cv2.imread(img) for img in fileName1]
    label1 = np.zeros((len(img1), 1))
    shot1 = np.array([(133, 134)])
    print('clip_2 images importing...')
    fileName2 = sorted(glob.glob(data + 'clip_2/*.jpg'))
    img2 = [cv2.imread(img) for img in fileName2]
    label2 = np.zeros((len(img2), 1))
    shot2 = np.array([(0, 1), (55, 57), (72, 74), (78, 79), 
                      (86, 87), (98, 99), (110, 112), (121, 124)])
    print('clip_3 images importing...')
    fileName3 = sorted(glob.glob(data + 'clip_3/*.jpg'))
    img3 = [cv2.imread(img) for img in fileName3]
    label3 = np.zeros((len(img3), 1))
    shot3 = np.array([(32, 41), (59, 60), (61, 62),
                      (76, 89), (170, 171), (243, 254)])
    print('Done !')
    test = {'X': [img1, img2, img3], 'Y': [shot1, shot2, shot3]}
    return test
def load_data ( ) : print ( 'clip_1 images importing...' ) fileName1 = sorted ( glob . glob ( data + 'clip_1/*.jpg' ) ) img1 = [ cv2 . imread ( img ) for img in fileName1 ] label1 = np . zeros ( ( len ( img1 ) , 1 ) ) shot1 = np . array ( [ ( 133 , 134 ) ] ) print ( 'clip_2 images importing...' ) fileName2 = sorted ( glob . glob ( data + 'clip_2/*.jpg' ) ) img2 = [ cv2 . imread ( img ) for img in fileName2 ] label2 = np . zeros ( ( len ( img2 ) , 1 ) ) shot2 = np . array ( [ ( 0 , 1 ) , ( 55 , 57 ) , ( 72 , 74 ) , ( 78 , 79 ) , ( 86 , 87 ) , ( 98 , 99 ) , ( 110 , 112 ) , ( 121 , 124 ) ] ) print ( 'clip_3 images importing...' ) fileName3 = sorted ( glob . glob ( data + 'clip_3/*.jpg' ) ) img3 = [ cv2 . imread ( img ) for img in fileName3 ] label3 = np . zeros ( ( len ( img3 ) , 1 ) ) shot3 = np . array ( [ ( 32 , 41 ) , ( 59 , 60 ) , ( 61 , 62 ) , ( 76 , 89 ) , ( 170 , 171 ) , ( 243 , 254 ) ] ) print ( 'Done !' ) test = { 'X' : [ img1 , img2 , img3 ] , 'Y' : [ shot1 , shot2 , shot3 ] } return test
load all three clips to a dict variable
load all three clips to a dict variable
"""
    load all three clips to a dict variable
    """ # =================== first clip ===================  # =================== second clip ===================  # =================== third clip =================== 