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

Structure of Datasets #51

Open
NhanDoremon opened this issue Nov 20, 2024 · 2 comments
Open

Structure of Datasets #51

NhanDoremon opened this issue Nov 20, 2024 · 2 comments

Comments

@NhanDoremon
Copy link

Dear author, Could I ask you about the structure of your datasets? . I am struggling with training, and also I cannot download the datasets from your link because BAIDU download really slowly with the free version.

@NhanDoremon
Copy link
Author

I cannot train the model because of the error when I create label_path from images_path. So that is why I revised the original code from the line 391 in "datasets.py" into the below code, and fortunately It works well:

def img2label_paths(img_paths):
# Define label paths as a function of image paths
sb, t = 'labels', [] # Replace visible or infrared with labels
for x in img_paths:
if 'visible' in x.split(os.sep):
sa = 'visible'
elif 'infrared' in x.split(os.sep):
sa = 'infrared'
else:
print(f"Skipping invalid path: {x}")
continue
# Replace and ensure paths are joined correctly
label_path = x.replace(sa, sb, 1).rsplit('.', 1)[0] + '.txt'
label_path = os.path.normpath(label_path) # Normalize the path
t.append(label_path)
# print("Generated label paths:", t) # Debugging
return t

@jacksonwu09
Copy link

你要根据你数据集的结构修改啊

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