Closed insomniaaac closed 2 years ago
you can use the os.listdir to get you folder all images, and write the path with label in txt file.The format is like this, xxx/1.jpg, label xxx/2.jpg, label ... xxx/9999.jpg, label
Thank you for your quick reply. But I am still confused because the model should not need labeled images in the pre-training stage. My dataset is composed of several small datasets, which makes it difficult to extract their labels. So if you mean that pretrain code and finetune code are in one module?
Pretrain model is not need label, but finetune need. In my pretrain stage, i not used the label for supervision model, only use the images.My dataset is used for pretrain and finetune, so my format is the image with label.You can randomly label, such as all is 0, which is not used in the pretrain stage.
suppose I have many images in a folder, like: 1.jpg 2.jpg ... 9999.jpg
how could I organize these pics to pretrain my model?