-
Notifications
You must be signed in to change notification settings - Fork 6
/
CensorArchivalComponents.yaml
140 lines (117 loc) · 6.3 KB
/
CensorArchivalComponents.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# __ __ ___ __ ___ __ __ __ __ __ __
# /__` |__) |__ / ` | |\/| |__ |\ | / ` |__) / \ |__) |__) | |\ | / _`
# .__/ | |___ \__, | | | |___ | \| \__, | \ \__/ | | | | \| \__>
# LeafMachine2 SpecimenCropping Module
# William N. Weaver 2023
# University of Michigan
#
#
# Cite:
# Weaver, W. N., and S. A.Smith. 2023. From leaves to labels: Building modular
# machine learning networks for rapid herbarium specimen analysis with LeafMachine2.
# Applications in Plant Sciences. e11548. https://doi.org/10.1002/aps3.11548
leafmachine:
do:
check_for_illegal_filenames: False
check_for_corrupt_images_make_vertical: False
# Overall Project Input Settings
project:
# Image to Process
dir_images_local: 'C:/ML_Projects/Dan_Park/annotated_images/Dioscorea-HNC-ColombianHerbarium/Annotated_Dioscorea_HNCOL' #'path/to/input/images'
run_name: 'Censored__Annotated_Dioscorea_HNCOL'
# Project Output Dir
# Can set this to a temp location if the intermediate files are not needed
dir_output: 'C:/ML_Projects/Dan_Park/annotated_images/Dioscorea-HNC-ColombianHerbarium' #'path/to/output/dir'
censor_archival_components: True
hide_archival_components: ['ruler', 'barcode', 'label', 'colorcard', 'map', 'photo', 'weights',]
replacement_color: '#FFFFFF'
# Processing Options
batch_size: 50000 # Default: 50 | Determines RAM usage
num_workers: 8 # Default: 4 | Most hardware loses performance beyond 4 workers
image_location: 'local'
cropped_components:
# empty list for all, add to list to IGNORE, lowercase, comma seperated
# archival |FROM|
# ruler, barcode, colorcard, label, map, envelope, photo, attached_item, weights
# plant |FROM|
# leaf_whole, leaf_partial, leaflet, seed_fruit_one, seed_fruit_many, flower_one, flower_many, bud, specimen, roots, wood
include_these_objects_in_specimen_crop: ['ruler','barcode','colorcard', 'label', 'map', 'envelope', 'photo', 'attached_item', 'leaf_whole', 'leaf_partial', 'leaflet', 'seed_fruit_one', 'seed_fruit_many', 'flower_one', 'flower_many', 'bud', 'specimen', 'roots', 'wood']
save_per_image: False # creates a folder for each image, saves crops into class-names folders # TODO
save_per_annotation_class: True # saves crops into class-names folders
# Optional: Save individual components as images
# - Save jpgs for each identified object
# - e.g. Save a jpg of each barcode that is identified from the input images
# - can pick from any of the items listed in archival |FROM| and plant |FROM|
do_save_cropped_annotations: False # Saves individual cropped components
save_cropped_annotations: ['ruler','barcode','colorcard', 'label',] # Saves individual cropped components of these classes
# For almost all use cases, the settings below do not need to be changed
#
# minimum_confidence_threshold
# - By default the detector confidence is set quite low to make sure that
# the detector actually finds the objects in the image.
# - If you expereince issues and the detector is skipping or detecting too many objects,
# try increaseing or decreasing the 'minimum_confidence_threshold'
# values. They must be between 0 and 1.
# - Higher values will yeild fewer but more confident detections
#
# do_save_prediction_overlay_images
# - To save space, set:
# do_save_prediction_overlay_images = False
# - False will not save the intermediate object detection images.
# - These intermediate images are useful for debugging, but are otherwise unimportant.
#
# NOTE: For everyday use, we recommend setting 'do_save_prediction_overlay_images to False
# so that you are not saving hundreds of overlay images.
modules:
specimen_crop: True
# Configure Plant Component Detector
plant_component_detector:
# ./leafmachine2/component_detector/runs/train/detector_type/detector_version/detector_iteration/weights/detector_weights
detector_type: 'Plant_Detector'
detector_version: 'PLANT_LeafPriority'
detector_iteration: 'PLANT_LeafPriority'
detector_weights: 'LeafPriority.pt'
minimum_confidence_threshold: 0.2 # 0.2 = default
do_save_prediction_overlay_images: True
ignore_objects_for_overlay: []
# Configure Archival Component Detector
archival_component_detector:
# ./leafmachine2/component_detector/runs/train/detector_type/detector_version/detector_iteration/weights/detector_weights
detector_type: 'Archival_Detector'
detector_version: 'PREP_final'
detector_iteration: 'PREP_final'
detector_weights: 'best.pt'
minimum_confidence_threshold: 0.2 # 0.2 = default
do_save_prediction_overlay_images: True
ignore_objects_for_overlay: []
print:
verbose: True
optional_warnings: True
leaf_segmentation:
segment_whole_leaves: False
segment_partial_leaves: False
landmark_detector:
landmark_whole_leaves: False
landmark_partial_leaves: False
logging:
log_level: null
overlay:
save_overlay_to_pdf: False
save_overlay_to_jpgs: True
overlay_dpi: 300 # int |FROM| 100 to 300
overlay_background_color: 'black' # str |FROM| 'white' or 'black'
show_archival_detections: True
ignore_archival_detections_classes: []
show_plant_detections: True
ignore_plant_detections_classes: [] #['leaf_whole', 'specimen'] #['leaf_whole', 'leaf_partial', 'specimen']
show_segmentations: True
show_landmarks: True
ignore_landmark_classes: []
line_width_archival: 12 # int
line_width_plant: 12 # int
line_width_seg: 12 # int # thick = 12
line_width_efd: 12 # int # thick = 3
alpha_transparency_archival: 0.3 # float between 0 and 1
alpha_transparency_plant: 0
alpha_transparency_seg_whole_leaf: 0.4
alpha_transparency_seg_partial_leaf: 0.3