How do I split a folder with images into two folders with images using MATLAB?
Mostrar comentarios más antiguos
Hi, how are you. I have a question about images in a folder. I have a folder with multiple images (2000). How do I separate this folder into two folders with randomly chosen images? For example, 70% of images in one folder and 30% in another folder.
Respuestas (1)
Jos (10584)
el 22 de Feb. de 2018
Editada: Jos (10584)
el 22 de Feb. de 2018
2 votos
- retrieve all filenames using dir
- create a random logical vector with 70% true, e.g. tf = randperm(N) > (0.70 *N), where N is the number of files
- create two new directories with mkdir
- loop over all files, using for
- use movefile to move the file to one folder, if the logical vector is true, otherwise move it to the other folder
2 comentarios
Gledson Melotti
el 12 de Dic. de 2018
Priyom Goswami
el 11 de Mayo de 2021
Can You Help me with the code please, I'm unable to do so.
Categorías
Más información sobre Deep Learning for Image Processing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!