import os
import cv2


def png2jpg():
    path = 'K:/label5/'
    for file in os.listdir(path):
        img = cv2.imread(path + file)
        img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
        cv2.imwrite(
            'K:/label5/' + file.split('.')[0]+'.jpg', img)


png2jpg()