powered by
Apply MegaDetector to a Given Batch of Images
detect( detector, image_file_names, resize_width, resize_height, letterbox = TRUE, confidence_threshold = 0.1, file_col = "filepath", batch_size = 1, num_workers = 1, device = NULL, checkpoint_path = NULL, checkpoint_frequency = -1 )
list of dictionaries of MegaDetector detections
preloaded md model
list of image filenames, a single image filename, or folder
width to resize images to
height to resize images to
if True, resize and pad image to keep aspect ratio, else resize without padding
only detections above this threshold are returned
select which column if image_file_names is a manifest
size of each batch
number of processes to handle the data
specify to run on cpu or gpu
path to checkpoint file
write results to checkpoint file every N images
if (FALSE) mdres <- detect(md_py, allframes$Frame, 1280, 960, device='cpu')
Run the code above in your browser using DataLab