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

ERROR issues #24

Open
zkzk123zk opened this issue Jul 13, 2022 · 1 comment
Open

ERROR issues #24

zkzk123zk opened this issue Jul 13, 2022 · 1 comment

Comments

@zkzk123zk
Copy link

TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

@JackCobra11
Copy link

The same image in different sets has the same name. However, the image format of 'train' is '.jpg', while the others are '.png'. So you need to turn the '.png' files into '.jpg' files. Otherwise, OpenCV can't find you low light images, and return TypeError. (your code can't open your low light datasets image)
Here's the code to modify the file type,

import os

file_path = r"..\train_dark"

files = os.listdir(file_path)

for file in files:

    if file.endswith('png'):

        src = os.path.join(file_path, file)

        r_name = file.split('.')[0] + '.jpg'

        dct = os.path.join(r"..\train_dark", r_name)

        os.rename(src, dct)

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

2 participants