main.py 文件源码

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

项目:PaintingToArtists 作者: achintyagopal 项目源码 文件源码
def get_files(folder_name, algorithm, args):

    foldersTmp = os.listdir(folder_name)
    folders = []
    for folder in foldersTmp:
        if folder[0] == '.':
            continue
        folders.append(folder)

    imgs = []
    for folder in folders:
        path = folder_name + folder + '/'
        if not os.path.isdir(path):
            continue

        files = os.listdir(path)
        for file_str in files:
            complete_file_str = str((os.path.join(path, file_str)))
            if os.path.isfile(complete_file_str) and (complete_file_str.endswith('.jpg') or complete_file_str.endswith('.JPG')):
                imgs.append((os.path.join(path, file_str), folder))

    return imgs


# load instances from filename
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号