Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batch run in pycharm(not terminal) #16

Open
Wangcehao opened this issue Jul 12, 2022 · 0 comments
Open

batch run in pycharm(not terminal) #16

Wangcehao opened this issue Jul 12, 2022 · 0 comments

Comments

@Wangcehao
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant