LightlyDataset with filenames bug on subfolders
See original GitHub issueLightlyDataset with filenames bug on subfolders
For
dataset = LightlyDataset(
input_dir=tmp_dir,
filenames=filenames
)
I get an error when filenames
doesn’t contain at least one image from every subfolder, e.g.
data/
L subfolder_1/
L img0.png
L img1.png
L subfolder_2/
L img0.png
Then filenames=[subfolder_1/img0.png']
will fail.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
ImageFolder(root) raises error if root contains empty subfolders
Describe the bug When using torchvision.datasets.ImageFolder(root) on a root with a subfolder not containing images, an error is thrown.
Read more >copy & paste image dataset from single folder to subfolders ...
Image filenames are in a specific order: label_randomNo._randomString.JPEG . Using a custom Python function, I want to be able to copy/paste ...
Read more >Tutorial 1: Structure Your Input — lightly 1.2.38 documentation
You can give structure to your input directory by collecting the input images in subdirectories. In this case, the filenames loaded by lightly...
Read more >WinMerge / Bugs / #2241 'View > Expand All Subfolders' does ...
All subfolders are not expanded, and when I export to CSV, ... Under Filename column, Subfolder1-2 appears (with a folder icon) instead of ......
Read more >Loading files from subfolders, the file name in all the folders ...
The simulation results file contains 40 sub folders and the files in all the folders are same but with different data. Example my...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yep, have alread found out, forgot to edit the comment! Thanks anyways and keep up with the good work 😄
I have discussed this issue in length with some developers from torchvision: https://github.com/pytorch/vision/issues/4925
The key takeaway is: Do not use
LightlyDataset(input_dir)
on input_dirs which contain subdirectories without images. This is needed to ensures that the labels returned when iterating over theLightlyDataset
are continuous, start with 0 and that there is at least one image for every label.