I have multiple images in a folder (over 70,000 images) and I don't want to read in all of them.
I have written these scripts to filter out the files I need, there are roughly 5000 selective images I need. I filtered out the files through a CSV file which has filenames of the images in the rows.
install.packages("dplyr")
library(dplyr)
ClassifyLeison = read.csv('C:#The file path......)
Melanoma <- ClassifyLeison[1:2]
Melanoma <- filter(Melanoma, MEL == 1 )
Below is a the first 6 image files I need, there are 5000 image files that I need to read in (but I could only display the 6 rows, but there are more rows)
               image         MEL
1.             ISIC_0000002   1
2.             ISIC_0000004   1
3.             ISIC_0000013   1
4. ISIC_0000022_downsampled   1
5. ISIC_0000026_downsampled   1
6. ISIC_0000029_downsampled   1
Below I have written scripts which reads in all of the files in the folder, but I can't read in all of the files because of the memory constraints with R Studio, so for now I only need the selective files.
library(keras)
library(EBImage)
library(imager)
SkinImages <- "C:\\Users\\user\\Documents\\Final Year Proj\\DATA\\ISIC_2019_Training_Input"
SkinLeison <- list.files(path = SkinImages, pattern = "*.jpg", full.names = T)
 for (i in seq_along(SkinLeison)) {
      assign(paste("T_0_low_000", i, sep = "."),load.image(SkinLeison[i]))
    }
 
    