label_processing.label_detection

Label Detection Module (Detectron2 / Detecto)

Detects and crops individual labels from full specimen photographs using a trained Faster R-CNN object-detection model. Used by the traditional MLI pipeline; the Gemini pipeline uses gemini_processor.detect_and_classify instead.

Functions

clean_predictions(jpg_dir, dataframe, threshold)

Filter predictions based on a threshold and save the results to a CSV file.

create_crops(jpg_dir, dataframe[, out_dir])

Creates crops by using the csv from applying the model and the original pictures inside a directory.

crop_picture(img_raw, path, filename, ...)

Crop the picture using the given coordinates.

is_image_file(path)

prediction_parallel(jpg_dir, predictor, ...)

Perform predictions for all JPG files in a directory with parallel processing.

Classes

PredictLabel(path_to_model, classes[, ...])

Class for predicting labels using a trained object detection model.