Description Usage Arguments Details
make_input
will make a csv with the specifications necessary to either classify
images or to train a new model. See 'details' below for using the different options
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | make_input(
input_file = NULL,
output_dir = getwd(),
option = NULL,
find_file_names = FALSE,
path_prefix = getwd(),
image_file_suffixes = c(".jpg", ".JPG"),
recursive = TRUE,
usingBuiltIn = TRUE,
model_type = "species_model",
images_classified = FALSE,
find_class_IDs = FALSE,
trainTest = FALSE,
file_prefix = "",
shiny = FALSE,
propTrain = 0.9
)
|
input_file |
The absolute path to your input csv. It must contain a column called "filename" and unless you are using the built in model, a column called "class" (which would be your species or group of species). |
output_dir |
The absolute path where you would like to store your new csv. It can be anywhere on your computer, but you'll want to be able to find it in the next step, so you might want to store it in your MLWIC2_helper_files folder. |
option |
A value of 1-5 descrbing how you want to supply data and how you want the function to create an input file. See 'details' below for what each option means. Setting an option value overrides inputs for 'find_file_names', 'usingBuiltIn', 'images_classified', 'find_class_IDs', and 'trainTest'. |
find_file_names |
logical. If TRUE, this function will find all image files within a specified directory. You must specify the directory ('path_prefix') for this to work. If you already have a spreadsheet (eg. a '.csv') with the names of files and their classifications, this is not the option for you. |
path_prefix |
Path to where your images are stored. You need to specify this if you want MLWIC2 to 'find_file_names' (or if you are using option 4). |
image_file_suffixes |
The suffix for your image files. Only specify this if you are using the 'find_file_names' option. The default is .jpg files. This is case-sensitive. |
recursive |
logical. Only necessary if you are using the 'find_file_names' option. If TRUE, the function will find all relevant image files in all subdirectories from the path you specify. If FALSE, it will only find images in the folder that you provide as your 'path_prefix'. |
usingBuiltIn |
logical. If TRUE, you are setting up a data file to classify images using the built in model. |
model_type |
If usingBuiltIn=TRUE, you can specify 'species_model' or 'empty_animal' so that your class_ID's will match those of the model |
images_classified |
logical. If TRUE, you have classifications to go along with these images (and you want to test how the model performs on these images). |
find_class_IDs |
logical. If TRUE, and you have images_classified, MLWIC2 will try to match up your text classifications with the values from the trained model. If FALSE and you have images classified, you need to have a column in your input file called 'class_ID'. |
trainTest |
logical. Do you want to create separate csvs for training and testing |
file_prefix |
What you want to appear as the filename before the suffix. If you are only creating a file to test the model, you could specify "test_" and your output file name would be "test_image_labels.csv". If you specify 'trainTest = TRUE', your suffixes will automatically be "_train.csv" and "_test.csv" |
propTrain |
proportion of images you want for training. '1-propTrain' is the proportion that will be used for testing the model. |
Use option=1
if you have labels for your images and you want to test the model on your images, you need to have an ‘input_file' csv that has at last two columns and one of these must be ’filename' and the other must be 'class_ID'. The 'class_ID' column must contain the number associated with each class.
option=2
: This is the same as Option 1, except instead of having a number for each class, you have a column called ‘class' containing your classifications as words (e.g., ’dog' or 'cattle', 'empty'), the function will find the appropriate 'class_ID' associated with these words.
Use option=3
if you do not have your images classified, but you have all of the filenames for the images you want to classify, you can have an ‘input_file' csv with a column called ’filename' and whatever other columns you would like.
option=4
: MLWIC2 will find the filenames of all of your images and create your input file. For this option, you need to specify your 'path_prefix' which is the parent directory of your images.
option=5
: If you are planning to train a model, you will want training and testing sets of images. This function will set up these files also.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.