megadetector 5.0.27__py3-none-any.whl → 5.0.29__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.

Files changed (176) hide show
  1. megadetector/api/batch_processing/api_core/batch_service/score.py +4 -5
  2. megadetector/api/batch_processing/api_core_support/aggregate_results_manually.py +1 -1
  3. megadetector/api/batch_processing/api_support/summarize_daily_activity.py +1 -1
  4. megadetector/api/batch_processing/integration/digiKam/xmp_integration.py +2 -2
  5. megadetector/api/batch_processing/integration/eMammal/test_scripts/push_annotations_to_emammal.py +1 -1
  6. megadetector/api/batch_processing/integration/eMammal/test_scripts/select_images_for_testing.py +1 -1
  7. megadetector/api/synchronous/api_core/tests/load_test.py +2 -3
  8. megadetector/classification/aggregate_classifier_probs.py +3 -3
  9. megadetector/classification/analyze_failed_images.py +5 -5
  10. megadetector/classification/cache_batchapi_outputs.py +5 -5
  11. megadetector/classification/create_classification_dataset.py +11 -12
  12. megadetector/classification/crop_detections.py +10 -10
  13. megadetector/classification/csv_to_json.py +8 -8
  14. megadetector/classification/detect_and_crop.py +13 -15
  15. megadetector/classification/evaluate_model.py +7 -7
  16. megadetector/classification/identify_mislabeled_candidates.py +6 -6
  17. megadetector/classification/json_to_azcopy_list.py +1 -1
  18. megadetector/classification/json_validator.py +29 -32
  19. megadetector/classification/map_classification_categories.py +9 -9
  20. megadetector/classification/merge_classification_detection_output.py +12 -9
  21. megadetector/classification/prepare_classification_script.py +19 -19
  22. megadetector/classification/prepare_classification_script_mc.py +23 -23
  23. megadetector/classification/run_classifier.py +4 -4
  24. megadetector/classification/save_mislabeled.py +6 -6
  25. megadetector/classification/train_classifier.py +1 -1
  26. megadetector/classification/train_classifier_tf.py +9 -9
  27. megadetector/classification/train_utils.py +10 -10
  28. megadetector/data_management/annotations/annotation_constants.py +1 -1
  29. megadetector/data_management/camtrap_dp_to_coco.py +45 -45
  30. megadetector/data_management/cct_json_utils.py +101 -101
  31. megadetector/data_management/cct_to_md.py +49 -49
  32. megadetector/data_management/cct_to_wi.py +33 -33
  33. megadetector/data_management/coco_to_labelme.py +75 -75
  34. megadetector/data_management/coco_to_yolo.py +189 -189
  35. megadetector/data_management/databases/add_width_and_height_to_db.py +3 -2
  36. megadetector/data_management/databases/combine_coco_camera_traps_files.py +38 -38
  37. megadetector/data_management/databases/integrity_check_json_db.py +202 -188
  38. megadetector/data_management/databases/subset_json_db.py +33 -33
  39. megadetector/data_management/generate_crops_from_cct.py +38 -38
  40. megadetector/data_management/get_image_sizes.py +54 -49
  41. megadetector/data_management/labelme_to_coco.py +130 -124
  42. megadetector/data_management/labelme_to_yolo.py +78 -72
  43. megadetector/data_management/lila/create_lila_blank_set.py +81 -83
  44. megadetector/data_management/lila/create_lila_test_set.py +32 -31
  45. megadetector/data_management/lila/create_links_to_md_results_files.py +18 -18
  46. megadetector/data_management/lila/download_lila_subset.py +21 -24
  47. megadetector/data_management/lila/generate_lila_per_image_labels.py +91 -91
  48. megadetector/data_management/lila/get_lila_annotation_counts.py +30 -30
  49. megadetector/data_management/lila/get_lila_image_counts.py +22 -22
  50. megadetector/data_management/lila/lila_common.py +70 -70
  51. megadetector/data_management/lila/test_lila_metadata_urls.py +13 -14
  52. megadetector/data_management/mewc_to_md.py +339 -340
  53. megadetector/data_management/ocr_tools.py +258 -252
  54. megadetector/data_management/read_exif.py +232 -223
  55. megadetector/data_management/remap_coco_categories.py +26 -26
  56. megadetector/data_management/remove_exif.py +31 -20
  57. megadetector/data_management/rename_images.py +187 -187
  58. megadetector/data_management/resize_coco_dataset.py +41 -41
  59. megadetector/data_management/speciesnet_to_md.py +41 -41
  60. megadetector/data_management/wi_download_csv_to_coco.py +55 -55
  61. megadetector/data_management/yolo_output_to_md_output.py +117 -120
  62. megadetector/data_management/yolo_to_coco.py +195 -188
  63. megadetector/detection/change_detection.py +831 -0
  64. megadetector/detection/process_video.py +341 -338
  65. megadetector/detection/pytorch_detector.py +308 -266
  66. megadetector/detection/run_detector.py +186 -166
  67. megadetector/detection/run_detector_batch.py +366 -364
  68. megadetector/detection/run_inference_with_yolov5_val.py +328 -325
  69. megadetector/detection/run_tiled_inference.py +312 -253
  70. megadetector/detection/tf_detector.py +24 -24
  71. megadetector/detection/video_utils.py +291 -283
  72. megadetector/postprocessing/add_max_conf.py +15 -11
  73. megadetector/postprocessing/categorize_detections_by_size.py +44 -44
  74. megadetector/postprocessing/classification_postprocessing.py +808 -311
  75. megadetector/postprocessing/combine_batch_outputs.py +20 -21
  76. megadetector/postprocessing/compare_batch_results.py +528 -517
  77. megadetector/postprocessing/convert_output_format.py +97 -97
  78. megadetector/postprocessing/create_crop_folder.py +220 -147
  79. megadetector/postprocessing/detector_calibration.py +173 -168
  80. megadetector/postprocessing/generate_csv_report.py +508 -0
  81. megadetector/postprocessing/load_api_results.py +25 -22
  82. megadetector/postprocessing/md_to_coco.py +129 -98
  83. megadetector/postprocessing/md_to_labelme.py +89 -83
  84. megadetector/postprocessing/md_to_wi.py +40 -40
  85. megadetector/postprocessing/merge_detections.py +87 -114
  86. megadetector/postprocessing/postprocess_batch_results.py +319 -302
  87. megadetector/postprocessing/remap_detection_categories.py +36 -36
  88. megadetector/postprocessing/render_detection_confusion_matrix.py +205 -199
  89. megadetector/postprocessing/repeat_detection_elimination/find_repeat_detections.py +57 -57
  90. megadetector/postprocessing/repeat_detection_elimination/remove_repeat_detections.py +27 -28
  91. megadetector/postprocessing/repeat_detection_elimination/repeat_detections_core.py +702 -677
  92. megadetector/postprocessing/separate_detections_into_folders.py +226 -211
  93. megadetector/postprocessing/subset_json_detector_output.py +265 -262
  94. megadetector/postprocessing/top_folders_to_bottom.py +45 -45
  95. megadetector/postprocessing/validate_batch_results.py +70 -70
  96. megadetector/taxonomy_mapping/map_lila_taxonomy_to_wi_taxonomy.py +52 -52
  97. megadetector/taxonomy_mapping/map_new_lila_datasets.py +15 -15
  98. megadetector/taxonomy_mapping/prepare_lila_taxonomy_release.py +14 -14
  99. megadetector/taxonomy_mapping/preview_lila_taxonomy.py +66 -69
  100. megadetector/taxonomy_mapping/retrieve_sample_image.py +16 -16
  101. megadetector/taxonomy_mapping/simple_image_download.py +8 -8
  102. megadetector/taxonomy_mapping/species_lookup.py +33 -33
  103. megadetector/taxonomy_mapping/taxonomy_csv_checker.py +14 -14
  104. megadetector/taxonomy_mapping/taxonomy_graph.py +11 -11
  105. megadetector/taxonomy_mapping/validate_lila_category_mappings.py +13 -13
  106. megadetector/utils/azure_utils.py +22 -22
  107. megadetector/utils/ct_utils.py +1019 -200
  108. megadetector/utils/directory_listing.py +21 -77
  109. megadetector/utils/gpu_test.py +22 -22
  110. megadetector/utils/md_tests.py +541 -518
  111. megadetector/utils/path_utils.py +1511 -406
  112. megadetector/utils/process_utils.py +41 -41
  113. megadetector/utils/sas_blob_utils.py +53 -49
  114. megadetector/utils/split_locations_into_train_val.py +73 -60
  115. megadetector/utils/string_utils.py +147 -26
  116. megadetector/utils/url_utils.py +463 -173
  117. megadetector/utils/wi_utils.py +2629 -2868
  118. megadetector/utils/write_html_image_list.py +137 -137
  119. megadetector/visualization/plot_utils.py +21 -21
  120. megadetector/visualization/render_images_with_thumbnails.py +37 -73
  121. megadetector/visualization/visualization_utils.py +424 -404
  122. megadetector/visualization/visualize_db.py +197 -190
  123. megadetector/visualization/visualize_detector_output.py +126 -98
  124. {megadetector-5.0.27.dist-info → megadetector-5.0.29.dist-info}/METADATA +6 -3
  125. megadetector-5.0.29.dist-info/RECORD +163 -0
  126. {megadetector-5.0.27.dist-info → megadetector-5.0.29.dist-info}/WHEEL +1 -1
  127. megadetector/data_management/importers/add_nacti_sizes.py +0 -52
  128. megadetector/data_management/importers/add_timestamps_to_icct.py +0 -79
  129. megadetector/data_management/importers/animl_results_to_md_results.py +0 -158
  130. megadetector/data_management/importers/auckland_doc_test_to_json.py +0 -373
  131. megadetector/data_management/importers/auckland_doc_to_json.py +0 -201
  132. megadetector/data_management/importers/awc_to_json.py +0 -191
  133. megadetector/data_management/importers/bellevue_to_json.py +0 -272
  134. megadetector/data_management/importers/cacophony-thermal-importer.py +0 -793
  135. megadetector/data_management/importers/carrizo_shrubfree_2018.py +0 -269
  136. megadetector/data_management/importers/carrizo_trail_cam_2017.py +0 -289
  137. megadetector/data_management/importers/cct_field_adjustments.py +0 -58
  138. megadetector/data_management/importers/channel_islands_to_cct.py +0 -913
  139. megadetector/data_management/importers/eMammal/copy_and_unzip_emammal.py +0 -180
  140. megadetector/data_management/importers/eMammal/eMammal_helpers.py +0 -249
  141. megadetector/data_management/importers/eMammal/make_eMammal_json.py +0 -223
  142. megadetector/data_management/importers/ena24_to_json.py +0 -276
  143. megadetector/data_management/importers/filenames_to_json.py +0 -386
  144. megadetector/data_management/importers/helena_to_cct.py +0 -283
  145. megadetector/data_management/importers/idaho-camera-traps.py +0 -1407
  146. megadetector/data_management/importers/idfg_iwildcam_lila_prep.py +0 -294
  147. megadetector/data_management/importers/import_desert_lion_conservation_camera_traps.py +0 -387
  148. megadetector/data_management/importers/jb_csv_to_json.py +0 -150
  149. megadetector/data_management/importers/mcgill_to_json.py +0 -250
  150. megadetector/data_management/importers/missouri_to_json.py +0 -490
  151. megadetector/data_management/importers/nacti_fieldname_adjustments.py +0 -79
  152. megadetector/data_management/importers/noaa_seals_2019.py +0 -181
  153. megadetector/data_management/importers/osu-small-animals-to-json.py +0 -364
  154. megadetector/data_management/importers/pc_to_json.py +0 -365
  155. megadetector/data_management/importers/plot_wni_giraffes.py +0 -123
  156. megadetector/data_management/importers/prepare_zsl_imerit.py +0 -131
  157. megadetector/data_management/importers/raic_csv_to_md_results.py +0 -416
  158. megadetector/data_management/importers/rspb_to_json.py +0 -356
  159. megadetector/data_management/importers/save_the_elephants_survey_A.py +0 -320
  160. megadetector/data_management/importers/save_the_elephants_survey_B.py +0 -329
  161. megadetector/data_management/importers/snapshot_safari_importer.py +0 -758
  162. megadetector/data_management/importers/snapshot_serengeti_lila.py +0 -1067
  163. megadetector/data_management/importers/snapshotserengeti/make_full_SS_json.py +0 -150
  164. megadetector/data_management/importers/snapshotserengeti/make_per_season_SS_json.py +0 -153
  165. megadetector/data_management/importers/sulross_get_exif.py +0 -65
  166. megadetector/data_management/importers/timelapse_csv_set_to_json.py +0 -490
  167. megadetector/data_management/importers/ubc_to_json.py +0 -399
  168. megadetector/data_management/importers/umn_to_json.py +0 -507
  169. megadetector/data_management/importers/wellington_to_json.py +0 -263
  170. megadetector/data_management/importers/wi_to_json.py +0 -442
  171. megadetector/data_management/importers/zamba_results_to_md_results.py +0 -180
  172. megadetector/data_management/lila/add_locations_to_island_camera_traps.py +0 -101
  173. megadetector/data_management/lila/add_locations_to_nacti.py +0 -151
  174. megadetector-5.0.27.dist-info/RECORD +0 -208
  175. {megadetector-5.0.27.dist-info → megadetector-5.0.29.dist-info}/licenses/LICENSE +0 -0
  176. {megadetector-5.0.27.dist-info → megadetector-5.0.29.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,163 @@
1
+ megadetector/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ megadetector/api/batch_processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ megadetector/api/batch_processing/api_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ megadetector/api/batch_processing/api_core/server.py,sha256=-g6hfaSp7dUaT-2-bUSXkLE-MJnig3gZ3W_GbNkoAE0,11618
5
+ megadetector/api/batch_processing/api_core/server_api_config.py,sha256=AjmLStXYoMMwxZJSephYROEprcSkG5RPlOr7Zho9xLk,3277
6
+ megadetector/api/batch_processing/api_core/server_app_config.py,sha256=tQCFsFv0wJCegHfnu-Za3okdXwEd4U522hiM0YGNkMY,1860
7
+ megadetector/api/batch_processing/api_core/server_batch_job_manager.py,sha256=K7fMFBJA8Z1SkA4eBM-nymcq7VQjwZ6ZRaNnNKFlat8,10324
8
+ megadetector/api/batch_processing/api_core/server_job_status_table.py,sha256=P621Df7RTTKqW8VlxnCqkBtIO4Ko5bSS6WbU0ETzPGY,5984
9
+ megadetector/api/batch_processing/api_core/server_orchestration.py,sha256=LYHABzhOvP0NrM1VIjI6Vwb95YZ5xjQ52mUJW8oIOQ0,17003
10
+ megadetector/api/batch_processing/api_core/server_utils.py,sha256=uJvnW50lSE_LnRtEyrFI2dbVSecmGudaRhUH6NcAx1M,3100
11
+ megadetector/api/batch_processing/api_core/batch_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ megadetector/api/batch_processing/api_core/batch_service/score.py,sha256=05SsMIGP4I683jZq94BRUW_vkrq0Y9ekLGU6Dvt9M_Q,17339
13
+ megadetector/api/batch_processing/api_core_support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ megadetector/api/batch_processing/api_core_support/aggregate_results_manually.py,sha256=8Z9WawOczjP0JwjFBKXTF_5aFgsEU2OYaKE7CkYf-x8,2281
15
+ megadetector/api/batch_processing/api_support/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ megadetector/api/batch_processing/api_support/summarize_daily_activity.py,sha256=4XVvKI9Npes_G2ZWNiSTA0wo0rLPZ8L-Bu6UF5GaxaI,5389
17
+ megadetector/api/batch_processing/data_preparation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ megadetector/api/batch_processing/integration/digiKam/setup.py,sha256=7P1X3JYrBDXmLUeLRrzxNfDkL5lo-pY8nXsp9Cz8rOI,203
19
+ megadetector/api/batch_processing/integration/digiKam/xmp_integration.py,sha256=dbib8WseSrNpLnSTKvnmEseii5ls5WAi1C612ovmwps,17796
20
+ megadetector/api/batch_processing/integration/eMammal/test_scripts/config_template.py,sha256=UnvrgaFRBu59MuVUJa2WpG8ebcOJWcNeZEx6GWuYLzc,73
21
+ megadetector/api/batch_processing/integration/eMammal/test_scripts/push_annotations_to_emammal.py,sha256=86MluxfHY5JsslX0OWgmVUyuPP6DMDE-o6kYKdlTtMI,3583
22
+ megadetector/api/batch_processing/integration/eMammal/test_scripts/select_images_for_testing.py,sha256=z8DkkV9VU69HFPEwwTVDQI9BSJa72TMoqwRt6ZiilNo,1376
23
+ megadetector/api/synchronous/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
+ megadetector/api/synchronous/api_core/animal_detection_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ megadetector/api/synchronous/api_core/animal_detection_api/api_backend.py,sha256=g4HvPJ1bynLPzL79yta0GtWunxb8RjCADF56_YbYCsA,4955
26
+ megadetector/api/synchronous/api_core/animal_detection_api/api_frontend.py,sha256=f16J7OBN87Tv0vVIIpXlyyVDeT6qYXDe5Kpr5XGqhdQ,10233
27
+ megadetector/api/synchronous/api_core/animal_detection_api/config.py,sha256=05fVcLx0KK3wWFi62Mr-m_soewVn81qqeObUh-a2mrA,982
28
+ megadetector/api/synchronous/api_core/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ megadetector/api/synchronous/api_core/tests/load_test.py,sha256=rKiVHP4011POuPWgnISA_-sv9TR2gTvxYyt5kktZZis,3276
30
+ megadetector/classification/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
+ megadetector/classification/aggregate_classifier_probs.py,sha256=ScRlN7yV6qOES8hDwyAylKQ92Vn-klbdPGqDbPM3pGw,3417
32
+ megadetector/classification/analyze_failed_images.py,sha256=dsNajqn4c-yL6vUelxqhotdNBFLHzaONfJkMAdwX7QI,8426
33
+ megadetector/classification/cache_batchapi_outputs.py,sha256=m4HrRg2XSP1oP_1YTzPSOydnhyR1pWu0m2LbIXUUWwE,6304
34
+ megadetector/classification/create_classification_dataset.py,sha256=Sv79ocsy1sWAWzzkKg4tWruQD434faOpJGBHb4Kt3XY,25404
35
+ megadetector/classification/crop_detections.py,sha256=LWT3zzNKfJNwTVKl1-nM_qzjkdCuFjEmPRDsSZ0MV4Y,20387
36
+ megadetector/classification/csv_to_json.py,sha256=j_edQLiMyDvpZFxYDNh-BAvzwSM4zbbQEXMIH-44nAs,5894
37
+ megadetector/classification/detect_and_crop.py,sha256=Y3T1gr2DJr6LEg17QXoBvhYMihnMAmbKJ-gBmmwoMd8,36925
38
+ megadetector/classification/evaluate_model.py,sha256=x51dfebVtsObAcLafXq7xMJv7hOiwiXHM-Cg06sUAyw,19323
39
+ megadetector/classification/identify_mislabeled_candidates.py,sha256=NvLAUk5VgwyyPKMxY875V5k2iRsl-Eh_sAuZRjtgc4c,5011
40
+ megadetector/classification/json_to_azcopy_list.py,sha256=Om8efCzRwlfA5LRXtzOgdrY0P5YDofs0vuewQvKNmsA,1669
41
+ megadetector/classification/json_validator.py,sha256=EOwX2aV_GDhkz6EQqkq6iC08IuBlNiUiR4OMUXuSGWo,26417
42
+ megadetector/classification/map_classification_categories.py,sha256=VFSBQhZjJMwMDZwv-rFHs4cE3q5GionqLYumjBypZhw,10661
43
+ megadetector/classification/merge_classification_detection_output.py,sha256=N4HhGSKZz_YbgY8SNtxxjw3S-CvpwfpIEsj2WCpUD7M,20163
44
+ megadetector/classification/prepare_classification_script.py,sha256=hD_vdd4oMBimz4rTkuTVI51dYnlDXHaAoBdL7FvXan4,6361
45
+ megadetector/classification/prepare_classification_script_mc.py,sha256=XbCEzl8Wl_NPrv27EwCj-emz2pzIlHqtT1DcyRUGH8Y,7052
46
+ megadetector/classification/run_classifier.py,sha256=JKMdeD33yo-CY6lyTfPZmOWnvr_Ft-vDbysfdSiXSX4,9323
47
+ megadetector/classification/save_mislabeled.py,sha256=hoxYmGbfGxEwvuH9JcYDW8NOs8CxCx0K4UtMHDaG0KI,3386
48
+ megadetector/classification/train_classifier.py,sha256=ksAcLpIn-D1sq8jdJjpjru8cUNXLhEoNVJsfWRayfLA,32334
49
+ megadetector/classification/train_classifier_tf.py,sha256=sXJ9i_BhEam5ndxm65cwe3CaZIFTg5-eEdKGhMpEhHo,28051
50
+ megadetector/classification/train_utils.py,sha256=BNOnGl2dNegsQdOYzfq5IE3hsS2gL3eUd9q-Tgimf_E,11293
51
+ megadetector/classification/efficientnet/__init__.py,sha256=e-jfknjzCc5a0CSW-TaZ2vi0SPU1OMIsayoz2s94QAo,182
52
+ megadetector/classification/efficientnet/model.py,sha256=qJHWV9-rYKa4E_TIee5N_OjRhqDdM-icPpoMap3Q5HM,17040
53
+ megadetector/classification/efficientnet/utils.py,sha256=dzrDrQQcvINdJFbODmrHQMUaM0RaUbct52zcSprseAg,24693
54
+ megadetector/data_management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ megadetector/data_management/camtrap_dp_to_coco.py,sha256=L4gk9E0SLKh25A4IOCo-ZdXw1ET3jlLUf0MQMDkJeCM,8426
56
+ megadetector/data_management/cct_json_utils.py,sha256=mdKo_vfHYTMVLXIyiA8HI-f30zrby7NEir741E5Bb2o,19525
57
+ megadetector/data_management/cct_to_md.py,sha256=e1fYevSz0m65n5H16uB6uwzNiXiwxjdB2ka5p68R4d0,5120
58
+ megadetector/data_management/cct_to_wi.py,sha256=wcBOmurXY5I-hiqV6SmRSGUAeYaKHEU1LgCZjqVmCyw,9561
59
+ megadetector/data_management/coco_to_labelme.py,sha256=uYJ60XoZfHUEfLzj-EjLyeNM590skNnMp-IThWwNISo,8683
60
+ megadetector/data_management/coco_to_yolo.py,sha256=HjuLYdPqcrMvfLaAwCmekJ7JdqMeBG2e1yTO8xaUzNM,27812
61
+ megadetector/data_management/generate_crops_from_cct.py,sha256=OSoh_c71-iftrGgkBCXqOAXDwzBNZmKnErCW59XE58w,4094
62
+ megadetector/data_management/get_image_sizes.py,sha256=sZtjRxhlIj56oA9X4Iq1ek4xeT3MllyWpZCOV19MkCY,6501
63
+ megadetector/data_management/labelme_to_coco.py,sha256=jM6Ir9ahPHnyLzekoXqm2egOcHTmDtRYGSlsLJjm1zU,20773
64
+ megadetector/data_management/labelme_to_yolo.py,sha256=e6F6_F1c0Dye582PTHrGaXBNLo_DHMJA0ls8auiXw90,9852
65
+ megadetector/data_management/mewc_to_md.py,sha256=4l2Z5lfL8lUVq3NtL3ssvcUp80BABazWwDGcdS34mQA,12288
66
+ megadetector/data_management/ocr_tools.py,sha256=ueqbPiZL_KAC9DYDdWpCKr9tcNIOS9S9v1IExMs0Bx0,31370
67
+ megadetector/data_management/read_exif.py,sha256=4zDe4Jv7S-isdWOKZf76KhON9ZmD8GKoDl9hd6MFyd8,29249
68
+ megadetector/data_management/remap_coco_categories.py,sha256=suAwZH7u29ozFnK8MWrfL4q_s9va53mJi4vtwdCPvVo,4982
69
+ megadetector/data_management/remove_exif.py,sha256=cvX_1FoSd1e5ozqla2bW_OxLvvOIUgMJp4JgyhlaofI,2696
70
+ megadetector/data_management/rename_images.py,sha256=Ql8ZuJjXNDmBVbf_L2RU_oF2fwYHQZNm1tx4WQ7d8FI,6487
71
+ megadetector/data_management/resize_coco_dataset.py,sha256=hEtIO9kpE7dXXO-zkTem2iBOCZQpgfx8iBNtw9DUZOo,6551
72
+ megadetector/data_management/speciesnet_to_md.py,sha256=kINd7PfWC1G-kawZH8YDigtBAuewahLYpLszKC-lpOM,1368
73
+ megadetector/data_management/wi_download_csv_to_coco.py,sha256=rhqWSEmDiXs1GbHavoNwdGSqk01-a-4xmz7z7x1Qjs4,7973
74
+ megadetector/data_management/yolo_output_to_md_output.py,sha256=Hwr2yUuXYJi7lFaQcYGReLjS-oDnYq5m8QAFBcYRXrM,17476
75
+ megadetector/data_management/yolo_to_coco.py,sha256=gmsbAhuUKt-OVDJwEqieNJiX2Wx2oq9VyhmUuauHiFM,26600
76
+ megadetector/data_management/annotations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
77
+ megadetector/data_management/annotations/annotation_constants.py,sha256=XMtv63F6JfPdScx8bGrY5C3CGOd0XkJrEkyD6zHZIfg,952
78
+ megadetector/data_management/databases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
+ megadetector/data_management/databases/add_width_and_height_to_db.py,sha256=cyYXX2wSvUrJH3kGOVcFRJto7EUPzPFVZUpVEbpW8vs,809
80
+ megadetector/data_management/databases/combine_coco_camera_traps_files.py,sha256=-eWeuUrIwN8Z6H4FhvaIZenyxud8THDwlALVGSLNhfw,6583
81
+ megadetector/data_management/databases/integrity_check_json_db.py,sha256=kANQiNpAqTfLUiqpV8cvg2u7tGsFVxT5HP3CmLlwOc8,17076
82
+ megadetector/data_management/databases/subset_json_db.py,sha256=mO1eAkrfCSAp2_r5vHVjHvet_utFJcWRm3rNa8WvSx8,4134
83
+ megadetector/data_management/lila/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
+ megadetector/data_management/lila/create_lila_blank_set.py,sha256=tApCL4XN1Vzl6YvcdI6SY4TZbHeCyHLzNYweFfX0sy0,19490
85
+ megadetector/data_management/lila/create_lila_test_set.py,sha256=UWJPKrwNW-UVeGrMUrFvmIt2UHVyuFiPzRFKkbEbk5A,5014
86
+ megadetector/data_management/lila/create_links_to_md_results_files.py,sha256=XrtbM1MJtN-4PKzViGkDov8Rw-lJogF1E8_hHh6wR9U,3687
87
+ megadetector/data_management/lila/download_lila_subset.py,sha256=coLlmga7r5I37L_YxjUoERLC1JAGUjcED16oWtd072Y,5339
88
+ megadetector/data_management/lila/generate_lila_per_image_labels.py,sha256=dnXb-yB-dvPXSr9xsB2ASEyCi7zk7fYTAWrJKgrBx_4,17397
89
+ megadetector/data_management/lila/get_lila_annotation_counts.py,sha256=58EtCtx3w_c8bHLoBzURvJwqGSzVt6clfla18dXiAwM,5520
90
+ megadetector/data_management/lila/get_lila_image_counts.py,sha256=Jz89nNHwghguMJBUs1v_ZN5VPwg9zH9ggat-6ZsUfQ4,3518
91
+ megadetector/data_management/lila/lila_common.py,sha256=nvNxyQuRuq0a7FpDO3i1xHLEF904XNBVMW9mn4sJsBg,10726
92
+ megadetector/data_management/lila/test_lila_metadata_urls.py,sha256=yWq9bJ2sOppTw1XMyPn-RJskydk6V_02r5Mmex1lquE,5010
93
+ megadetector/detection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
+ megadetector/detection/change_detection.py,sha256=-ntEPII5nwuGLssxqu9t69uuzV9YSyy7uB79QP4a6aw,28594
95
+ megadetector/detection/process_video.py,sha256=yc5TdaCxUX1dBzckXwp0b7ehXjfNqAIAjQIFG5qDEy4,52388
96
+ megadetector/detection/pytorch_detector.py,sha256=S8imfMbjpGz7wMi3LGY-z-P-7NHJ6i4nIKlSM_oMxuA,45015
97
+ megadetector/detection/run_detector.py,sha256=oHfD62A-p2m1bPYPJB0E399C3NuP-TFHHYJDLwq-ZIs,39128
98
+ megadetector/detection/run_detector_batch.py,sha256=Gfl7cjPRtZ6eAslyfRUnv_uPCkSc-DDhNDrG7lvUeF4,71655
99
+ megadetector/detection/run_inference_with_yolov5_val.py,sha256=3YOBH5T2ML-s7GWPjKONb_ot_kcZQfyu5zbRG-u5xnw,53035
100
+ megadetector/detection/run_tiled_inference.py,sha256=GwlKvnfWRh58juyuJ9EpZSNlYbq5NsBc8pnEA7vp7EM,39272
101
+ megadetector/detection/tf_detector.py,sha256=3b2MiqgMw8KBDzHQliUSDXWrmKpa9iZnfe6EgYpMcYo,8398
102
+ megadetector/detection/video_utils.py,sha256=Ne7-ltDJbtwFczYoy9plKSvoMlg16_i4Ew5wsrk3lCs,42580
103
+ megadetector/postprocessing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
104
+ megadetector/postprocessing/add_max_conf.py,sha256=9Ao6OpjWvzZ0SrUtH5_SZ-xY8z_Aa9CyEzNt76aadNA,1578
105
+ megadetector/postprocessing/categorize_detections_by_size.py,sha256=Ok9c2Bfxtmn65ZwxccfB37UiU2NPdECKsta_33DSJFU,5372
106
+ megadetector/postprocessing/classification_postprocessing.py,sha256=ISpmtv7l3Gt1zMRC_-5zXfHiCbFXqgHfzGb0ikSJmfA,58046
107
+ megadetector/postprocessing/combine_batch_outputs.py,sha256=L4eW93fLL0VtpfbBy9z8q2CJIO1skrYq8d5GDoA8mxQ,8332
108
+ megadetector/postprocessing/compare_batch_results.py,sha256=0l5NcZ7zJqG2fbbci-Y3bvSZs-R_1iZugyeRrvd4Dko,81329
109
+ megadetector/postprocessing/convert_output_format.py,sha256=_RBteogwwzFy0TyWxIFWsZToBUTYq2Oa4iCqoTOXBjw,14766
110
+ megadetector/postprocessing/create_crop_folder.py,sha256=2j9_IsHSNXji67sPkVosiIrErnLt9jKRtoPKYsZh18s,19294
111
+ megadetector/postprocessing/detector_calibration.py,sha256=UFjJ8D6tMghatLRj3CyrtJ7vrPIJkULMNsYMIj98j2M,20495
112
+ megadetector/postprocessing/generate_csv_report.py,sha256=QLLxE2b6JXoqtuU4h1tgVROgOQXjwK4tCTYcNF0XJlk,19160
113
+ megadetector/postprocessing/load_api_results.py,sha256=fROvcmQ_BHCv-NPzmqf0efhbt744mKP5zt7yC9XLFXQ,7045
114
+ megadetector/postprocessing/md_to_coco.py,sha256=_nFqanWmbtlAtN8smJOdUAIRAEAf_xKlV2K_qhOWkys,16915
115
+ megadetector/postprocessing/md_to_labelme.py,sha256=3ZUnetkazVSet0567079ATYZ6b6g65cXpUKY306Fk8A,11543
116
+ megadetector/postprocessing/md_to_wi.py,sha256=AiECnonxGBrAvWYl_hnOGvciGRZKBfF4BcJX6ZV3hyE,1211
117
+ megadetector/postprocessing/merge_detections.py,sha256=o9MikrplIZm-730hJX58NnWsZlpNApEBr2jjPIcR4yY,15325
118
+ megadetector/postprocessing/postprocess_batch_results.py,sha256=aspVRVDZVcB_MsBKhEF_ao8T5IWqBF1R37nfqFBPWEM,84559
119
+ megadetector/postprocessing/remap_detection_categories.py,sha256=ldijLjDGWYhVPUFjOxhfydFUxFXOIpvLjqGuZ1OAPL8,6290
120
+ megadetector/postprocessing/render_detection_confusion_matrix.py,sha256=GVuchFeVoqVRf02mHeSu9-J5rbN-Xx8udL_96ibCoC4,26240
121
+ megadetector/postprocessing/separate_detections_into_folders.py,sha256=rRYvRblQFKYTV-dNt7e19Eco9eLTaGru_i9aOCGyEH0,32258
122
+ megadetector/postprocessing/subset_json_detector_output.py,sha256=Quz6xxM1T0N6bb1zGVKMv5GHBECLwNtuu9Sb35bWPhI,32188
123
+ megadetector/postprocessing/top_folders_to_bottom.py,sha256=zYrqMHjUZG8urh2CYphfs91ZQ620uqe-TL8jVYy8KVw,6049
124
+ megadetector/postprocessing/validate_batch_results.py,sha256=alIAJj4g76m3sXDwjkj6JaJCfeoWrGLyY89xCvw64K4,11012
125
+ megadetector/postprocessing/repeat_detection_elimination/find_repeat_detections.py,sha256=XgVeyga8iSC01MAjXxb2rn-CgJTYHqC_gfxxEoSn4aw,9420
126
+ megadetector/postprocessing/repeat_detection_elimination/remove_repeat_detections.py,sha256=mJtexTuWRJbjxu-ss4GRs6Ivl7PFDWlFVSitXTbpbhA,2820
127
+ megadetector/postprocessing/repeat_detection_elimination/repeat_detections_core.py,sha256=WvvWwyP86TZTc1WkuzA0UFkVOjWHOK3_oVOdJIX3Q4k,66771
128
+ megadetector/taxonomy_mapping/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
+ megadetector/taxonomy_mapping/map_lila_taxonomy_to_wi_taxonomy.py,sha256=cutQ4rtZ6T3WtnpHxUd9A5tM5f3bdyUdMMbe8Qss8eA,17694
130
+ megadetector/taxonomy_mapping/map_new_lila_datasets.py,sha256=-VA2MeAEznc0CtYVSjJuuo5EmZ0WDcr0ehRssJCrUd0,4177
131
+ megadetector/taxonomy_mapping/prepare_lila_taxonomy_release.py,sha256=rkpTjHxgg4Uaac3BTbvFYhnryYSY5Ha0l_9JeWuAKDo,4711
132
+ megadetector/taxonomy_mapping/preview_lila_taxonomy.py,sha256=V5eAZTLbLZZR6OwPsJYO7m9H6LXDoWw7J37zg5xPQlI,17341
133
+ megadetector/taxonomy_mapping/retrieve_sample_image.py,sha256=YZcOsu15ZSQCZSzkYPw80Rk6eCfnDjKg5y2wyYKkybY,1866
134
+ megadetector/taxonomy_mapping/simple_image_download.py,sha256=sxmt8LGOd0rQCLpJhu3XI_tqzI_b3U1iVl5d9sK9Ygc,6875
135
+ megadetector/taxonomy_mapping/species_lookup.py,sha256=M_T2hecfvzTb8LsXaNudLRd5XP2nPTeIogZMQH143p0,29666
136
+ megadetector/taxonomy_mapping/taxonomy_csv_checker.py,sha256=PIQh-5q43ibSgT6CdG1iwfZXZx_zOHWSv7AiHnql8d4,4782
137
+ megadetector/taxonomy_mapping/taxonomy_graph.py,sha256=GjrDZq7HesF40cUA9sPz7bGKojRdM2KBFvcUPy69hp4,12203
138
+ megadetector/taxonomy_mapping/validate_lila_category_mappings.py,sha256=sAKYreO1FDMxWl_0IvkmaGhiuS4OtzzMvSosovpugNc,2415
139
+ megadetector/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
140
+ megadetector/utils/azure_utils.py,sha256=LplsyaKI41PHcmr3YHI1mhF-KtmgCb-XAkqG7YIPtD0,6215
141
+ megadetector/utils/ct_utils.py,sha256=lP6js2hPj0K26vqGOL37QQ3uHkum1TWNYyobE_qhQP4,57221
142
+ megadetector/utils/directory_listing.py,sha256=CZBzwg0Fus1xuRAp3ycEBjViDdwwk4eKdGq06ZERLDg,6414
143
+ megadetector/utils/gpu_test.py,sha256=5zUfAVeSjH8I08eCqayFmMxL-0mix8SjJJTe5ORABvU,3544
144
+ megadetector/utils/md_tests.py,sha256=ChMWgR0eLGVSiAlzkSELeYaRYYrz7gIdV_OkfYoe9c0,72844
145
+ megadetector/utils/path_utils.py,sha256=ZYFvq1RPHTABl9Ac71WoPwag_qdoLLvJlyEEKYKHgJ4,97981
146
+ megadetector/utils/process_utils.py,sha256=gQcpH9WYvGPUs0FhtJ5_Xvl6JsvoGz8_mnDQk0PbTRM,5673
147
+ megadetector/utils/sas_blob_utils.py,sha256=p3kzTlE3TEfo2gsoCQeqMDrDGGLae6HcRROz2FO4KvY,16696
148
+ megadetector/utils/split_locations_into_train_val.py,sha256=GJXrvwxNRsFOe6mn9MRCc3kRoCsAN4Z_fG4Or_Idm_4,10297
149
+ megadetector/utils/string_utils.py,sha256=OONChvVyBmk3NdUHqN-Uj6isPOYqBa6YNE_WTD59z1w,6180
150
+ megadetector/utils/url_utils.py,sha256=1u80nGXV0k-OLK1vK7q0EpQzJ5NlcdRYqXGEyRvBYzE,24992
151
+ megadetector/utils/wi_utils.py,sha256=Relk8_H4h5YLmc3Vj0E1Bbw70pstRrwAW5dy_-m0HWw,99074
152
+ megadetector/utils/write_html_image_list.py,sha256=6Tbe5wyUxoBYJgH9yVrxxKCeWF2BVre_wQMEOQJ-ZIU,9068
153
+ megadetector/visualization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
154
+ megadetector/visualization/plot_utils.py,sha256=Z3hkMKJZPPk3A0zqssBHPDh6_EG--_315cbUK4RPt3k,10598
155
+ megadetector/visualization/render_images_with_thumbnails.py,sha256=_dRnKU5nEbOoVxNeuPTu8QN6vAOyUz0C3vLNP_Xjsg0,8385
156
+ megadetector/visualization/visualization_utils.py,sha256=zDlxRiB-5GZZVuaNr1nK_B4umxVrzUFf9VaUytTKFkk,74251
157
+ megadetector/visualization/visualize_db.py,sha256=kSopXVtxVSGwv3NSKOo1lx5SNm5VNgndYRm6RkeaQ0I,24499
158
+ megadetector/visualization/visualize_detector_output.py,sha256=6CsgTb7A_EwmUxOwnrU0w9XpIfQm9I4BEijBrtYuWQk,20198
159
+ megadetector-5.0.29.dist-info/licenses/LICENSE,sha256=RMa3qq-7Cyk7DdtqRj_bP1oInGFgjyHn9-PZ3PcrqIs,1100
160
+ megadetector-5.0.29.dist-info/METADATA,sha256=upPPtMgx1nRsA5-TXopsGnJnncDrxY4o3ZVEc64ScBA,6384
161
+ megadetector-5.0.29.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
162
+ megadetector-5.0.29.dist-info/top_level.txt,sha256=wf9DXa8EwiOSZ4G5IPjakSxBPxTDjhYYnqWRfR-zS4M,13
163
+ megadetector-5.0.29.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,52 +0,0 @@
1
- """
2
-
3
- add_nacti_sizes.py
4
-
5
- NACTI bounding box metadata was posted before we inclduded width and height as semi-standard
6
- fields; pull size information from the main metadata file and add to the bbox file.
7
-
8
- """
9
-
10
- #%% Constants and environment
11
-
12
- import json
13
- from tqdm import tqdm
14
-
15
- input_file = 'G:/temp/nacti_metadata.json'
16
- input_bbox_file = 'G:/temp/nacti_20200401_bboxes.json'
17
- output_bbox_file = 'G:/temp/nacti_20230920_bboxes.json'
18
-
19
-
20
- #%% Read .json files
21
-
22
- with open(input_file,'r') as f:
23
- input_data = json.load(f)
24
-
25
- with open(input_bbox_file,'r') as f:
26
- input_bbox_data = json.load(f)
27
-
28
- print('Finished reading .json data')
29
-
30
-
31
- #%% Map image names to width and height
32
-
33
- filename_to_size = {}
34
- for im in tqdm(input_data['images']):
35
- filename_to_size[im['file_name']] = (im['width'],im['height'])
36
-
37
-
38
- #%% Add to output data
39
-
40
- for im in tqdm(input_bbox_data['images']):
41
- size = filename_to_size[im['file_name']]
42
- im['width'] = size[0]
43
- im['height'] = size[1]
44
-
45
-
46
- #%% Write output
47
-
48
- output_bbox_data = input_bbox_data
49
- output_bbox_data['version'] = '2023-09-20'
50
-
51
- with open(output_bbox_file,'w') as f:
52
- json.dump(output_bbox_data,f,indent=1)
@@ -1,79 +0,0 @@
1
- """
2
-
3
- add_timestamps_to_icct.py
4
-
5
- The Island Conservation Camera Traps dataset was originally posted without timestamps
6
- in either .json metadata or EXIF metadata. We pulled timestamps out using ocr_tools.py,
7
- this script adds those timestamps into the .json metadata.
8
-
9
- """
10
-
11
- #%% Imports and constants
12
-
13
- import json
14
-
15
- ocr_results_file = r'g:\temp\ocr_results.2023.10.31.07.37.54.json'
16
- input_metadata_file = r'd:\lila\islandconservationcameratraps\island_conservation.json'
17
- output_metadata_file = r'g:\temp\island_conservation_camera_traps_1.02.json'
18
- ocr_results_file_base = 'g:/temp/island_conservation_camera_traps/'
19
- assert ocr_results_file_base.endswith('/')
20
-
21
-
22
- #%% Read input metadata
23
-
24
- with open(input_metadata_file,'r') as f:
25
- input_metadata = json.load(f)
26
-
27
- assert input_metadata['info']['version'] == '1.01'
28
-
29
- # im = input_metadata['images'][0]
30
- for im in input_metadata['images']:
31
- assert 'datetime' not in im
32
-
33
-
34
- #%% Read OCR results
35
-
36
- with open(ocr_results_file,'r') as f:
37
- abs_filename_to_ocr_results = json.load(f)
38
-
39
- relative_filename_to_ocr_results = {}
40
-
41
- for fn_abs in abs_filename_to_ocr_results:
42
- assert ocr_results_file_base in fn_abs
43
- fn_relative = fn_abs.replace(ocr_results_file_base,'')
44
- relative_filename_to_ocr_results[fn_relative] = abs_filename_to_ocr_results[fn_abs]
45
-
46
-
47
- #%% Add datetimes to metadata
48
-
49
- images_not_in_datetime_results = []
50
- images_with_failed_datetimes = []
51
-
52
- for i_image,im in enumerate(input_metadata['images']):
53
- if im['file_name'] not in relative_filename_to_ocr_results:
54
- images_not_in_datetime_results.append(im)
55
- im['datetime'] = None
56
- continue
57
- ocr_results = relative_filename_to_ocr_results[im['file_name']]
58
- if ocr_results['datetime'] is None:
59
- images_with_failed_datetimes.append(im)
60
- im['datetime'] = None
61
- continue
62
- im['datetime'] = ocr_results['datetime']
63
-
64
- print('{} of {} images were not in datetime results'.format(
65
- len(images_not_in_datetime_results),len(input_metadata['images'])))
66
-
67
- print('{} of {} images were had failed datetime results'.format(
68
- len(images_with_failed_datetimes),len(input_metadata['images'])))
69
-
70
- for im in input_metadata['images']:
71
- assert 'datetime' in im
72
-
73
-
74
- #%% Write output
75
-
76
- input_metadata['info']['version'] = '1.02'
77
-
78
- with open(output_metadata_file,'w') as f:
79
- json.dump(input_metadata,f,indent=1)
@@ -1,158 +0,0 @@
1
- """
2
-
3
- animl_results_to_md_results.py
4
-
5
- Convert a .csv file produced by the Animl package:
6
-
7
- https://github.com/conservationtechlab/animl-py
8
-
9
- ...to a MD results file suitable for import into Timelapse.
10
-
11
- Columns are expected to be:
12
-
13
- file
14
- category (MD category identifies: 1==animal, 2==person, 3==vehicle)
15
- detection_conf
16
- bbox1,bbox2,bbox3,bbox4
17
- class
18
- classification_conf
19
-
20
- """
21
-
22
- #%% Imports and constants
23
-
24
- import pandas as pd
25
- import json
26
-
27
- # It's a little icky to hard-code this here rather than importing from elsewhere
28
- # in the MD repo, but it seemed silly to take a dependency on lots of MD code
29
- # just for this, so, hard-coding.
30
- detection_category_id_to_name = {'1':'animal','2':'person','3':'vehicle'}
31
-
32
-
33
- #%% Main function
34
-
35
- def animl_results_to_md_results(input_file,output_file=None):
36
- """
37
- Converts the .csv file [input_file] to the MD-formatted .json file [output_file].
38
-
39
- If [output_file] is None, '.json' will be appended to the input file.
40
- """
41
-
42
- if output_file is None:
43
- output_file = input_file + '.json'
44
-
45
- df = pd.read_csv(input_file)
46
-
47
- expected_columns = ('file','category','detection_conf',
48
- 'bbox1','bbox2','bbox3','bbox4','class','classification_conf')
49
-
50
- for s in expected_columns:
51
- assert s in df.columns,\
52
- 'Expected column {} not found'.format(s)
53
-
54
- classification_category_name_to_id = {}
55
- filename_to_results = {}
56
-
57
- # i_row = 0; row = df.iloc[i_row]
58
- for i_row,row in df.iterrows():
59
-
60
- # Is this the first detection we've seen for this file?
61
- if row['file'] in filename_to_results:
62
- im = filename_to_results[row['file']]
63
- else:
64
- im = {}
65
- im['detections'] = []
66
- im['file'] = row['file']
67
- filename_to_results[im['file']] = im
68
-
69
- assert isinstance(row['category'],int),'Invalid category identifier in row {}'.format(im['file'])
70
- detection_category_id = str(row['category'])
71
- assert detection_category_id in detection_category_id_to_name,\
72
- 'Unrecognized detection category ID {}'.format(detection_category_id)
73
-
74
- detection = {}
75
- detection['category'] = detection_category_id
76
- detection['conf'] = row['detection_conf']
77
- bbox = [row['bbox1'],row['bbox2'],row['bbox3'],row['bbox4']]
78
- detection['bbox'] = bbox
79
- classification_category_name = row['class']
80
-
81
- # Have we seen this classification category before?
82
- if classification_category_name in classification_category_name_to_id:
83
- classification_category_id = \
84
- classification_category_name_to_id[classification_category_name]
85
- else:
86
- classification_category_id = str(len(classification_category_name_to_id))
87
- classification_category_name_to_id[classification_category_name] = \
88
- classification_category_id
89
-
90
- classifications = [[classification_category_id,row['classification_conf']]]
91
- detection['classifications'] = classifications
92
-
93
- im['detections'].append(detection)
94
-
95
- # ...for each row
96
-
97
- info = {}
98
- info['format_version'] = '1.3'
99
- info['detector'] = 'Animl'
100
- info['classifier'] = 'Animl'
101
-
102
- results = {}
103
- results['info'] = info
104
- results['detection_categories'] = detection_category_id_to_name
105
- results['classification_categories'] = \
106
- {v: k for k, v in classification_category_name_to_id.items()}
107
- results['images'] = list(filename_to_results.values())
108
-
109
- with open(output_file,'w') as f:
110
- json.dump(results,f,indent=1)
111
-
112
- # ...animl_results_to_md_results(...)
113
-
114
-
115
- #%% Interactive driver
116
-
117
- if False:
118
-
119
- pass
120
-
121
- #%%
122
-
123
- input_file = r"G:\temp\animl-runs\animl-runs\Coati_v2\manifest.csv"
124
- output_file = None
125
- animl_results_to_md_results(input_file,output_file)
126
-
127
-
128
- #%% Command-line driver
129
-
130
- import sys,argparse
131
-
132
- def main():
133
-
134
- parser = argparse.ArgumentParser(
135
- description='Convert an Animl-formatted .csv results file to MD-formatted .json results file')
136
-
137
- parser.add_argument(
138
- 'input_file',
139
- type=str,
140
- help='input .csv file')
141
-
142
- parser.add_argument(
143
- '--output_file',
144
- type=str,
145
- default=None,
146
- help='output .json file (defaults to input file appended with ".json")')
147
-
148
- if len(sys.argv[1:]) == 0:
149
- parser.print_help()
150
- parser.exit()
151
-
152
- args = parser.parse_args()
153
-
154
- animl_results_to_md_results(args.input_file,args.output_file)
155
-
156
- if __name__ == '__main__':
157
- main()
158
-