megadetector 5.0.6__py3-none-any.whl → 5.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of megadetector might be problematic. Click here for more details.
- api/batch_processing/data_preparation/manage_local_batch.py +297 -202
- api/batch_processing/data_preparation/manage_video_batch.py +7 -2
- api/batch_processing/postprocessing/add_max_conf.py +1 -0
- api/batch_processing/postprocessing/combine_api_outputs.py +2 -2
- api/batch_processing/postprocessing/compare_batch_results.py +111 -61
- api/batch_processing/postprocessing/convert_output_format.py +24 -6
- api/batch_processing/postprocessing/load_api_results.py +56 -72
- api/batch_processing/postprocessing/md_to_labelme.py +119 -51
- api/batch_processing/postprocessing/merge_detections.py +30 -5
- api/batch_processing/postprocessing/postprocess_batch_results.py +175 -55
- api/batch_processing/postprocessing/remap_detection_categories.py +163 -0
- api/batch_processing/postprocessing/render_detection_confusion_matrix.py +628 -0
- api/batch_processing/postprocessing/repeat_detection_elimination/find_repeat_detections.py +71 -23
- api/batch_processing/postprocessing/repeat_detection_elimination/remove_repeat_detections.py +1 -1
- api/batch_processing/postprocessing/repeat_detection_elimination/repeat_detections_core.py +224 -76
- api/batch_processing/postprocessing/subset_json_detector_output.py +132 -5
- api/batch_processing/postprocessing/top_folders_to_bottom.py +1 -1
- classification/prepare_classification_script.py +191 -191
- data_management/cct_json_utils.py +7 -2
- data_management/coco_to_labelme.py +263 -0
- data_management/coco_to_yolo.py +72 -48
- data_management/databases/integrity_check_json_db.py +75 -64
- data_management/databases/subset_json_db.py +1 -1
- data_management/generate_crops_from_cct.py +1 -1
- data_management/get_image_sizes.py +44 -26
- data_management/importers/animl_results_to_md_results.py +3 -5
- data_management/importers/noaa_seals_2019.py +2 -2
- data_management/importers/zamba_results_to_md_results.py +2 -2
- data_management/labelme_to_coco.py +264 -127
- data_management/labelme_to_yolo.py +96 -53
- data_management/lila/create_lila_blank_set.py +557 -0
- data_management/lila/create_lila_test_set.py +2 -1
- data_management/lila/create_links_to_md_results_files.py +1 -1
- data_management/lila/download_lila_subset.py +138 -45
- data_management/lila/generate_lila_per_image_labels.py +23 -14
- data_management/lila/get_lila_annotation_counts.py +16 -10
- data_management/lila/lila_common.py +15 -42
- data_management/lila/test_lila_metadata_urls.py +116 -0
- data_management/read_exif.py +65 -16
- data_management/remap_coco_categories.py +84 -0
- data_management/resize_coco_dataset.py +14 -31
- data_management/wi_download_csv_to_coco.py +239 -0
- data_management/yolo_output_to_md_output.py +40 -13
- data_management/yolo_to_coco.py +313 -100
- detection/process_video.py +36 -14
- detection/pytorch_detector.py +1 -1
- detection/run_detector.py +73 -18
- detection/run_detector_batch.py +116 -27
- detection/run_inference_with_yolov5_val.py +135 -27
- detection/run_tiled_inference.py +153 -43
- detection/tf_detector.py +2 -1
- detection/video_utils.py +4 -2
- md_utils/ct_utils.py +101 -6
- md_utils/md_tests.py +264 -17
- md_utils/path_utils.py +326 -47
- md_utils/process_utils.py +26 -7
- md_utils/split_locations_into_train_val.py +215 -0
- md_utils/string_utils.py +10 -0
- md_utils/url_utils.py +66 -3
- md_utils/write_html_image_list.py +12 -2
- md_visualization/visualization_utils.py +380 -74
- md_visualization/visualize_db.py +41 -10
- md_visualization/visualize_detector_output.py +185 -104
- {megadetector-5.0.6.dist-info → megadetector-5.0.8.dist-info}/METADATA +11 -13
- {megadetector-5.0.6.dist-info → megadetector-5.0.8.dist-info}/RECORD +74 -67
- {megadetector-5.0.6.dist-info → megadetector-5.0.8.dist-info}/WHEEL +1 -1
- taxonomy_mapping/map_lila_taxonomy_to_wi_taxonomy.py +1 -1
- taxonomy_mapping/map_new_lila_datasets.py +43 -39
- taxonomy_mapping/prepare_lila_taxonomy_release.py +5 -2
- taxonomy_mapping/preview_lila_taxonomy.py +27 -27
- taxonomy_mapping/species_lookup.py +33 -13
- taxonomy_mapping/taxonomy_csv_checker.py +7 -5
- md_visualization/visualize_megadb.py +0 -183
- {megadetector-5.0.6.dist-info → megadetector-5.0.8.dist-info}/LICENSE +0 -0
- {megadetector-5.0.6.dist-info → megadetector-5.0.8.dist-info}/top_level.txt +0 -0
|
@@ -76,56 +76,75 @@ def main():
|
|
|
76
76
|
|
|
77
77
|
parser = argparse.ArgumentParser()
|
|
78
78
|
parser.add_argument('inputFile')
|
|
79
|
+
|
|
79
80
|
parser.add_argument('--outputFile', action='store', type=str, default=None,
|
|
80
81
|
help=".json file to write filtered results to... don't use this " + \
|
|
81
82
|
"if you're going to do manual review of the repeat detection images")
|
|
83
|
+
|
|
82
84
|
parser.add_argument('--imageBase', action='store', type=str, default='',
|
|
83
85
|
help='Image base dir, relevant if renderHtml is True or if " + \
|
|
84
86
|
"omitFilteringFolder is not set')
|
|
87
|
+
|
|
85
88
|
parser.add_argument('--outputBase', action='store', type=str, default='',
|
|
86
89
|
help='HTML or filtering folder output dir')
|
|
87
|
-
|
|
88
|
-
help='Path to detectionIndex.json, which should be inside a ' + \
|
|
89
|
-
'folder of images that are manually verified to _not_ ' + \
|
|
90
|
-
'contain valid animals')
|
|
91
|
-
|
|
92
|
-
parser.add_argument('--confidenceMax', action='store', type=float,
|
|
93
|
-
default=defaultOptions.confidenceMax,
|
|
94
|
-
help='Detection confidence threshold; don\'t process anything above this')
|
|
90
|
+
|
|
95
91
|
parser.add_argument('--confidenceMin', action='store', type=float,
|
|
96
92
|
default=defaultOptions.confidenceMin,
|
|
97
93
|
help='Detection confidence threshold; don\'t process anything below this')
|
|
94
|
+
|
|
95
|
+
parser.add_argument('--confidenceMax', action='store', type=float,
|
|
96
|
+
default=defaultOptions.confidenceMax,
|
|
97
|
+
help='Detection confidence threshold; don\'t process anything above this')
|
|
98
|
+
|
|
98
99
|
parser.add_argument('--iouThreshold', action='store', type=float,
|
|
99
100
|
default=defaultOptions.iouThreshold,
|
|
100
101
|
help='Detections with IOUs greater than this are considered ' + \
|
|
101
102
|
'"the same detection"')
|
|
103
|
+
|
|
102
104
|
parser.add_argument('--occurrenceThreshold', action='store', type=int,
|
|
103
105
|
default=defaultOptions.occurrenceThreshold,
|
|
104
106
|
help='More than this many near-identical detections in a group ' + \
|
|
105
107
|
'(e.g. a folder) is considered suspicious')
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
|
|
109
|
+
parser.add_argument('--minSuspiciousDetectionSize', action='store', type=float,
|
|
110
|
+
default=defaultOptions.minSuspiciousDetectionSize,
|
|
111
|
+
help='Detections smaller than this fraction of image area are not ' + \
|
|
112
|
+
'considered suspicious')
|
|
113
|
+
|
|
109
114
|
parser.add_argument('--maxSuspiciousDetectionSize', action='store', type=float,
|
|
110
115
|
default=defaultOptions.maxSuspiciousDetectionSize,
|
|
111
116
|
help='Detections larger than this fraction of image area are not ' + \
|
|
112
117
|
'considered suspicious')
|
|
113
118
|
|
|
114
|
-
parser.add_argument('--
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
parser.add_argument('--maxImagesPerFolder', action='store', type=int,
|
|
120
|
+
default=defaultOptions.maxImagesPerFolder,
|
|
121
|
+
help='Ignore folders with more than this many images in them')
|
|
122
|
+
|
|
123
|
+
parser.add_argument('--excludeClasses', action='store', nargs='+', type=int,
|
|
124
|
+
default=None,
|
|
125
|
+
help='List of integer classes we don\'t want to treat as suspicious, separated by spaces.')
|
|
126
|
+
|
|
127
|
+
parser.add_argument('--pass_detections_to_processes_method', action='store', type=str,
|
|
128
|
+
default=defaultOptions.pass_detections_to_processes_method,
|
|
129
|
+
help='Pass detections information to/from workers via "memory" (default) or "files"')
|
|
130
|
+
|
|
131
|
+
parser.add_argument('--nWorkers', action='store', type=int,
|
|
132
|
+
default=defaultOptions.nWorkers,
|
|
133
|
+
help='Level of parallelism for rendering and IOU computation')
|
|
134
|
+
|
|
135
|
+
parser.add_argument('--parallelizationUsesProcesses', action='store_false',
|
|
136
|
+
dest='parallelizationUsesThreads',
|
|
137
|
+
help='Parallelize with processes (defaults to threads)')
|
|
138
|
+
|
|
139
|
+
parser.add_argument('--filterFileToLoad', action='store', type=str, default='',
|
|
140
|
+
help='Path to detectionIndex.json, which should be inside a ' + \
|
|
141
|
+
'folder of images that are manually verified to _not_ ' + \
|
|
142
|
+
'contain valid animals')
|
|
143
|
+
|
|
118
144
|
parser.add_argument('--omitFilteringFolder', action='store_false',
|
|
119
145
|
dest='bWriteFilteringFolder',
|
|
120
146
|
help='Should we create a folder of rendered detections for post-filtering?')
|
|
121
|
-
|
|
122
|
-
default=defaultOptions.excludeClasses,
|
|
123
|
-
help='List of classes (ints) to exclude from analysis, separated by spaces')
|
|
124
|
-
|
|
125
|
-
parser.add_argument('--nDirLevelsFromLeaf', default=0, type=int,
|
|
126
|
-
help='Number of levels from the leaf folders to use for repeat ' + \
|
|
127
|
-
'detection (0 == leaves)')
|
|
128
|
-
|
|
147
|
+
|
|
129
148
|
parser.add_argument('--debugMaxDir', action='store', type=int, default=-1)
|
|
130
149
|
parser.add_argument('--debugMaxRenderDir', action='store', type=int, default=-1)
|
|
131
150
|
parser.add_argument('--debugMaxRenderDetection', action='store', type=int, default=-1)
|
|
@@ -136,6 +155,35 @@ def main():
|
|
|
136
155
|
parser.add_argument('--forceSerialRendering', action='store_false',
|
|
137
156
|
dest='bParallelizeRendering')
|
|
138
157
|
|
|
158
|
+
parser.add_argument('--maxOutputImageWidth', action='store', type=int,
|
|
159
|
+
default=defaultOptions.maxOutputImageWidth,
|
|
160
|
+
help='Maximum output size for thumbnail images')
|
|
161
|
+
|
|
162
|
+
parser.add_argument('--lineThickness', action='store', type=int,
|
|
163
|
+
default=defaultOptions.lineThickness,
|
|
164
|
+
help='Line thickness thumbnail images')
|
|
165
|
+
|
|
166
|
+
parser.add_argument('--boxExpansion', action='store', type=int,
|
|
167
|
+
default=defaultOptions.boxExpansion,
|
|
168
|
+
help='Box expansion for thumbnail images')
|
|
169
|
+
|
|
170
|
+
parser.add_argument('--nDirLevelsFromLeaf', type=int,
|
|
171
|
+
default=defaultOptions.nDirLevelsFromLeaf,
|
|
172
|
+
help='Number of levels from the leaf folders to use for repeat ' + \
|
|
173
|
+
'detection (0 == leaves)')
|
|
174
|
+
|
|
175
|
+
parser.add_argument('--bRenderOtherDetections', action='store_true',
|
|
176
|
+
help='Show non-target detections in light gray on each image')
|
|
177
|
+
|
|
178
|
+
parser.add_argument('--bRenderDetectionTiles', action='store_true',
|
|
179
|
+
help='Should we render a grid showing every instance for each detection?')
|
|
180
|
+
|
|
181
|
+
parser.add_argument('--detectionTilesPrimaryImageWidth', type=int,
|
|
182
|
+
default=defaultOptions.detectionTilesPrimaryImageWidth)
|
|
183
|
+
|
|
184
|
+
parser.add_argument('--renderHtml', action='store_true',
|
|
185
|
+
dest='bRenderHtml', help='Should we render HTML output?')
|
|
186
|
+
|
|
139
187
|
if len(sys.argv[1:]) == 0:
|
|
140
188
|
parser.print_help()
|
|
141
189
|
parser.exit()
|
api/batch_processing/postprocessing/repeat_detection_elimination/remove_repeat_detections.py
CHANGED
|
@@ -30,7 +30,7 @@ def remove_repeat_detections(inputFile,outputFile,filteringDir):
|
|
|
30
30
|
else:
|
|
31
31
|
assert os.path.isdir(filteringDir), '{} is not a valid folder'.format(filteringDir)
|
|
32
32
|
options.filterFileToLoad = \
|
|
33
|
-
os.path.join(filteringDir,repeat_detections_core.
|
|
33
|
+
os.path.join(filteringDir,repeat_detections_core.detection_index_file_name_base)
|
|
34
34
|
repeat_detections_core.find_repeat_detections(inputFile, outputFile, options)
|
|
35
35
|
|
|
36
36
|
|