Git Product home page Git Product logo

animalimageretrieval's Introduction

animalImageRetrieval

The goal of animalImageRetrieval is to enable quick download of reptile images from online sources.

Installation (easy)

Download the entire repo and use targets::tar_source() to load all R functions in the R folder into your environment.

Installation (untested)

You may be able to install the development version of animalImageRetrieval from GitHub with:

# install.packages("devtools")
devtools::install_github("BenMMarshall/animalImageRetrieval")

A note about API keys

You will need an API keyy from Flickr to run any of the Flickr-related functions, as well as the overall targets pipeline. You can remove the Flickr related sections in the _targets.R file to run the pipeline otherwise.

Example

library(here)
library(dplyr)
library(readr)
library(spocc)
library(targets)

# loads in all the custom functions
targets::tar_source()

# reads in the reptile database file inlcuded and filters it so we aren't searching for everything
reptileData <- animalImageRetrieval::read_reptile_data(orderFilter = "Serpentes",
                                                       familyFilter = NULL,
                                                       speciesFilter = NULL)

# we create a list to store each result of the inat searches, one object per
# family so if there is a failure we will only lose less than a family of
# progress
snakeResultsList <- vector("list", length = length(unique(reptileData$Family)))
names(snakeResultsList) <- unique(reptileData$Family)
# loop through family my family getting the results for the first 50 inat observations
for(fam in unique(reptileData$Family)){
  snakeResultsList[[fam]] <- get_urls_inat(reptileData = reptileData,
                                subset = fam,
                                inatLimit = 50)
}

Alternative targets approach

You can use targets::tar_visnetwork() to see the planned workflow for mass downloading images, and targets::tar_make() to run that. Ensure all packages listed in the _targets.R file are present.

animalimageretrieval's People

Contributors

benmmarshall avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.