File size: 458 Bytes
1457e31 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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)
|