single_File_For_ColorizationModel_For_Not_OOP_Fan.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:Deep-learning-Colorization-for-visual-media 作者: OmarSayedMostafa 项目源码 文件源码
def ReadNextBatch(): 
    '''Reads the Next (grey,Color) Batch and computes the Color_Images_batch Chrominance (AB colorspace values)

    Return:
     GreyImages_Batch: List with all Greyscale images [Batch size,224,224,1]
     ColorImages_Batch: List with all Colored images [Batch size,Colored images]
    '''
    global GreyImages_Batch
    global ColorImages_Batch
    global CurrentBatch_indx
    global Batch_size
    GreyImages_Batch = []
    ColorImages_Batch = []
    for ind in range(Batch_size):
        Colored_img = Image.open(ColorImgsPath + str(CurrentBatch_indx) + '.png')
        ColorImages_Batch.append(Colored_img)
        Grey_img = Image.open(GreyImgsPath + str(CurrentBatch_indx) + '.png')        
        Grey_img = np.asanyarray(Grey_img) 
        img_shape = Grey_img.shape
        img_reshaped = Grey_img.reshape(img_shape[0],img_shape[1], GreyChannels)#[224,224,1]
        GreyImages_Batch.append(img_reshaped)#[#imgs,224,224,1]
        CurrentBatch_indx = CurrentBatch_indx + 1
    Get_Batch_Chrominance() 
    return GreyImages_Batch
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号