Image-Contrast-Enhancement icon indicating copy to clipboard operation
Image-Contrast-Enhancement copied to clipboard

batch run in pycharm(not terminal)

Open Wangcehao opened this issue 1 year ago • 0 comments

only change the def main,code as follow:

def main(): test_path = 'testdata' save_path = 'result' imgs = os.listdir(test_path) time_sum = 0 for file in imgs: # img_name = sys.argv[1] img_name = os.path.join(test_path,file) img = imageio.imread(img_name) ta = time.time() result = Ying_2017_CAIP(img) # result: ndarray (m,n,4) time_sum += (time.time()-ta)

    # plt.imshow(result)
    # plt.show()
    save_image = cv2.cvtColor(result, cv2.COLOR_RGB2BGR)
    cv2.imwrite('result/{}'.format(file), save_image)
print('time_mean:', (time_sum/len(imgs)*1000))

if name == 'main': main()

Wangcehao avatar Jul 12 '22 10:07 Wangcehao