import os import sys import cv2 import json import random import time import pickle import requests import func_timeout import numpy as np proj_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) data_dir = os.path.join(proj_dir, 'Datas') work_dir = os.path.join(data_dir, 'task3/temps') for f in os.listdir(work_dir): img = cv2.imread(os.path.join(work_dir, f)) cv2.imwrite(os.path.join(work_dir, f.replace(".png", ".jpg")), img)