Flower Color Detection

If you want some r code to download inat images from urls:

 install.packages(rinat) 
 library(rinat)

 #### Set this to the directory where you want the photos to go
 setwd("folder_where_you_want_to_download_photos") 
 
 ####Change this query to get the images you want

 get_inat_obs(query = NULL, taxon_name = NULL, taxon_id = NULL,
     quality = NULL, geo = NULL, year = NULL, month = NULL, day = NULL,
     bounds = NULL, maxresults = 100, meta = FALSE)

 #### This code downloads the images
 for(i in 1:nrow(inat_results)){
      file_source <- inat_results$Image.url[i]
      file_name <- paste(inat_results$Id[i],".jpg", sep = "")
      download.file(file_source, file_name, mode = 'wb')
     }

You just have to change to the file you want to download the images to and change the observation query. As its set right now, it saves each image as [observation ID].jpg

Just be careful with the number of images you try to download at once, this is an easy way to max out the space on your computer. I only use this to download direct to an external drive.

1 Like