classify
Uses the Species Level model from Tabak et al. (the built in model) to predict
the species in each image. This function uses absolute paths, but if you are unfamilliar with this
process, you can put all of your images, the image label csv ("data_info") and the L1 folder that you
downloaded following the directions at https://github.com/mikeyEcology/MLWIC into one directory on
your computer. Then set your working directory to this location and the function will find the
absolute paths for you.
If you trained a model using train
,
this function can also be used to evalute images using the model developed by
train
by specifying the log_dir
of the trained model. If this is your first time using
this function, you should see additional documentation at https://github.com/mikeyEcology/MLWIC .
1 2 3 4 5 6 | classify(path_prefix = paste0(getwd(), "/images"),
data_info = paste0(getwd(), "/image_labels.csv"),
model_dir = getwd(), save_predictions = "model_predictions.txt",
python_loc = "/anaconda3/bin/", os = "Mac", num_classes = 28,
delimiter = ",", architecture = "resnet", depth = "18",
top_n = "5", log_dir = "USDA182")
|
path_prefix |
Absolute path to location of the images on your computer (or computing cluster). All images must be stored in one folder. |
data_info |
Name of a csv containing the file names of each image (including absolute path). This file must have Unix linebreaks! This file must have only two columns and NO HEADERS. The first column must be the file name of the image The second column can be the number corresponding to the species or group in the image. See Table 1 in Tabak et al. for the numbers (if using the built in model. If you do not know the species in the image, put a zero in each row of column 2. |
model_dir |
Absolute path to the location where you stored the L1 folder that you downloaded from github. |
save_predictions |
File name where model predictions will be stored.
You should not need to change this parameter.
After running this function, you will run |
python_loc |
The location of python on your machine. |
os |
the operating system you are using. If you are using windows, set this to "Windows", otherwise leave as default |
num_classes |
The number of classes in your model. If you are using the Species Level model from Tabak et al., the number is '28'. |
delimiter |
this will be a ',' for a csv. |
depth |
the number of layers in the DNN. If you are using the built in model, do not adjust this parameter. If you are using a model that you trained, use the same architecture and depth as that model. |
top_n |
the number of guesses you want the model to make (how many species do you want to see the confidence for?). This number must be less than or equal to 'num_classes'. |
log_dir |
If you trained a model with |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.