megadetector 5.0.10__py3-none-any.whl → 5.0.12__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 (226) hide show
  1. {api → megadetector/api}/batch_processing/api_core/batch_service/score.py +2 -2
  2. {api → megadetector/api}/synchronous/api_core/animal_detection_api/api_backend.py +1 -1
  3. {api → megadetector/api}/synchronous/api_core/animal_detection_api/api_frontend.py +1 -1
  4. {classification → megadetector/classification}/analyze_failed_images.py +3 -3
  5. {classification → megadetector/classification}/cache_batchapi_outputs.py +1 -1
  6. {classification → megadetector/classification}/create_classification_dataset.py +1 -1
  7. {classification → megadetector/classification}/crop_detections.py +1 -1
  8. {classification → megadetector/classification}/detect_and_crop.py +5 -5
  9. {classification → megadetector/classification}/evaluate_model.py +1 -1
  10. {classification → megadetector/classification}/json_to_azcopy_list.py +2 -2
  11. {classification → megadetector/classification}/json_validator.py +13 -9
  12. {classification → megadetector/classification}/map_classification_categories.py +1 -1
  13. {classification → megadetector/classification}/merge_classification_detection_output.py +1 -1
  14. {classification → megadetector/classification}/run_classifier.py +2 -1
  15. {classification → megadetector/classification}/train_classifier.py +8 -6
  16. {classification → megadetector/classification}/train_classifier_tf.py +10 -9
  17. {classification → megadetector/classification}/train_utils.py +3 -2
  18. {data_management → megadetector/data_management}/camtrap_dp_to_coco.py +4 -3
  19. {data_management → megadetector/data_management}/cct_json_utils.py +2 -2
  20. {data_management → megadetector/data_management}/cct_to_md.py +1 -1
  21. {data_management → megadetector/data_management}/coco_to_labelme.py +1 -1
  22. {data_management → megadetector/data_management}/coco_to_yolo.py +1 -1
  23. {data_management → megadetector/data_management}/databases/integrity_check_json_db.py +2 -2
  24. {data_management → megadetector/data_management}/get_image_sizes.py +4 -3
  25. {data_management → megadetector/data_management}/importers/auckland_doc_test_to_json.py +6 -5
  26. {data_management → megadetector/data_management}/importers/auckland_doc_to_json.py +4 -3
  27. {data_management → megadetector/data_management}/importers/awc_to_json.py +6 -4
  28. {data_management → megadetector/data_management}/importers/bellevue_to_json.py +3 -3
  29. {data_management → megadetector/data_management}/importers/cacophony-thermal-importer.py +4 -4
  30. {data_management → megadetector/data_management}/importers/carrizo_shrubfree_2018.py +5 -4
  31. {data_management → megadetector/data_management}/importers/carrizo_trail_cam_2017.py +8 -6
  32. {data_management → megadetector/data_management}/importers/cct_field_adjustments.py +2 -1
  33. {data_management → megadetector/data_management}/importers/channel_islands_to_cct.py +2 -2
  34. {data_management → megadetector/data_management}/importers/ena24_to_json.py +6 -5
  35. {data_management → megadetector/data_management}/importers/filenames_to_json.py +2 -1
  36. {data_management → megadetector/data_management}/importers/helena_to_cct.py +7 -6
  37. {data_management → megadetector/data_management}/importers/idaho-camera-traps.py +6 -6
  38. {data_management → megadetector/data_management}/importers/idfg_iwildcam_lila_prep.py +4 -4
  39. {data_management → megadetector/data_management}/importers/jb_csv_to_json.py +1 -1
  40. {data_management → megadetector/data_management}/importers/missouri_to_json.py +4 -3
  41. {data_management → megadetector/data_management}/importers/noaa_seals_2019.py +2 -2
  42. {data_management → megadetector/data_management}/importers/pc_to_json.py +5 -5
  43. {data_management → megadetector/data_management}/importers/prepare-noaa-fish-data-for-lila.py +3 -3
  44. {data_management → megadetector/data_management}/importers/prepare_zsl_imerit.py +3 -3
  45. {data_management → megadetector/data_management}/importers/rspb_to_json.py +2 -2
  46. {data_management → megadetector/data_management}/importers/save_the_elephants_survey_A.py +4 -4
  47. {data_management → megadetector/data_management}/importers/save_the_elephants_survey_B.py +6 -9
  48. {data_management → megadetector/data_management}/importers/snapshot_safari_importer.py +4 -4
  49. {data_management → megadetector/data_management}/importers/snapshot_safari_importer_reprise.py +2 -2
  50. {data_management → megadetector/data_management}/importers/snapshot_serengeti_lila.py +4 -4
  51. {data_management → megadetector/data_management}/importers/timelapse_csv_set_to_json.py +3 -3
  52. {data_management → megadetector/data_management}/importers/ubc_to_json.py +3 -3
  53. {data_management → megadetector/data_management}/importers/umn_to_json.py +2 -2
  54. {data_management → megadetector/data_management}/importers/wellington_to_json.py +3 -3
  55. {data_management → megadetector/data_management}/importers/wi_to_json.py +3 -2
  56. {data_management → megadetector/data_management}/labelme_to_coco.py +6 -7
  57. {data_management → megadetector/data_management}/labelme_to_yolo.py +2 -2
  58. {data_management → megadetector/data_management}/lila/add_locations_to_island_camera_traps.py +4 -4
  59. {data_management → megadetector/data_management}/lila/create_lila_blank_set.py +10 -9
  60. {data_management → megadetector/data_management}/lila/create_lila_test_set.py +3 -2
  61. {data_management → megadetector/data_management}/lila/create_links_to_md_results_files.py +1 -1
  62. {data_management → megadetector/data_management}/lila/download_lila_subset.py +5 -4
  63. {data_management → megadetector/data_management}/lila/generate_lila_per_image_labels.py +6 -5
  64. {data_management → megadetector/data_management}/lila/get_lila_annotation_counts.py +2 -2
  65. {data_management → megadetector/data_management}/lila/get_lila_image_counts.py +2 -1
  66. {data_management → megadetector/data_management}/lila/lila_common.py +5 -5
  67. {data_management → megadetector/data_management}/lila/test_lila_metadata_urls.py +2 -2
  68. {data_management → megadetector/data_management}/ocr_tools.py +6 -6
  69. {data_management → megadetector/data_management}/read_exif.py +2 -2
  70. {data_management → megadetector/data_management}/remap_coco_categories.py +1 -1
  71. {data_management → megadetector/data_management}/remove_exif.py +1 -1
  72. {data_management → megadetector/data_management}/resize_coco_dataset.py +4 -4
  73. {data_management → megadetector/data_management}/wi_download_csv_to_coco.py +3 -3
  74. {data_management → megadetector/data_management}/yolo_output_to_md_output.py +5 -5
  75. {data_management → megadetector/data_management}/yolo_to_coco.py +9 -9
  76. {detection → megadetector/detection}/process_video.py +9 -10
  77. {detection → megadetector/detection}/pytorch_detector.py +12 -8
  78. {detection → megadetector/detection}/run_detector.py +6 -6
  79. {detection → megadetector/detection}/run_detector_batch.py +12 -12
  80. {detection → megadetector/detection}/run_inference_with_yolov5_val.py +12 -12
  81. {detection → megadetector/detection}/run_tiled_inference.py +8 -9
  82. {detection → megadetector/detection}/tf_detector.py +3 -2
  83. {detection → megadetector/detection}/video_utils.py +2 -2
  84. {api/batch_processing → megadetector}/postprocessing/add_max_conf.py +1 -1
  85. {api/batch_processing → megadetector}/postprocessing/categorize_detections_by_size.py +1 -1
  86. {api/batch_processing → megadetector}/postprocessing/combine_api_outputs.py +1 -1
  87. {api/batch_processing → megadetector}/postprocessing/compare_batch_results.py +5 -5
  88. {api/batch_processing → megadetector}/postprocessing/convert_output_format.py +4 -5
  89. {api/batch_processing → megadetector}/postprocessing/load_api_results.py +1 -1
  90. {api/batch_processing → megadetector}/postprocessing/md_to_coco.py +3 -3
  91. {api/batch_processing → megadetector}/postprocessing/md_to_labelme.py +3 -3
  92. {api/batch_processing → megadetector}/postprocessing/merge_detections.py +1 -1
  93. {api/batch_processing → megadetector}/postprocessing/postprocess_batch_results.py +19 -21
  94. {api/batch_processing → megadetector}/postprocessing/remap_detection_categories.py +1 -1
  95. {api/batch_processing → megadetector}/postprocessing/render_detection_confusion_matrix.py +5 -6
  96. {api/batch_processing → megadetector}/postprocessing/repeat_detection_elimination/find_repeat_detections.py +3 -3
  97. {api/batch_processing → megadetector}/postprocessing/repeat_detection_elimination/remove_repeat_detections.py +3 -2
  98. {api/batch_processing → megadetector}/postprocessing/repeat_detection_elimination/repeat_detections_core.py +11 -11
  99. {api/batch_processing → megadetector}/postprocessing/separate_detections_into_folders.py +3 -4
  100. {api/batch_processing → megadetector}/postprocessing/subset_json_detector_output.py +2 -2
  101. {api/batch_processing → megadetector}/postprocessing/top_folders_to_bottom.py +1 -1
  102. {taxonomy_mapping → megadetector/taxonomy_mapping}/map_lila_taxonomy_to_wi_taxonomy.py +2 -2
  103. {taxonomy_mapping → megadetector/taxonomy_mapping}/map_new_lila_datasets.py +2 -6
  104. {taxonomy_mapping → megadetector/taxonomy_mapping}/preview_lila_taxonomy.py +6 -7
  105. {taxonomy_mapping → megadetector/taxonomy_mapping}/retrieve_sample_image.py +1 -1
  106. {taxonomy_mapping → megadetector/taxonomy_mapping}/simple_image_download.py +2 -1
  107. {taxonomy_mapping → megadetector/taxonomy_mapping}/species_lookup.py +1 -1
  108. {taxonomy_mapping → megadetector/taxonomy_mapping}/taxonomy_csv_checker.py +1 -1
  109. {taxonomy_mapping → megadetector/taxonomy_mapping}/validate_lila_category_mappings.py +1 -1
  110. {md_utils → megadetector/utils}/azure_utils.py +7 -3
  111. {md_utils → megadetector/utils}/directory_listing.py +1 -1
  112. {md_utils → megadetector/utils}/md_tests.py +29 -29
  113. {md_utils → megadetector/utils}/split_locations_into_train_val.py +1 -1
  114. {md_utils → megadetector/utils}/write_html_image_list.py +1 -1
  115. {md_visualization → megadetector/visualization}/render_images_with_thumbnails.py +3 -3
  116. {md_visualization → megadetector/visualization}/visualization_utils.py +6 -7
  117. {md_visualization → megadetector/visualization}/visualize_db.py +3 -4
  118. {md_visualization → megadetector/visualization}/visualize_detector_output.py +9 -10
  119. {megadetector-5.0.10.dist-info → megadetector-5.0.12.dist-info}/LICENSE +0 -0
  120. {megadetector-5.0.10.dist-info → megadetector-5.0.12.dist-info}/METADATA +12 -11
  121. megadetector-5.0.12.dist-info/RECORD +199 -0
  122. megadetector-5.0.12.dist-info/top_level.txt +1 -0
  123. api/batch_processing/data_preparation/manage_local_batch.py +0 -2391
  124. api/batch_processing/data_preparation/manage_video_batch.py +0 -327
  125. api/synchronous/api_core/animal_detection_api/data_management/annotations/annotation_constants.py +0 -47
  126. api/synchronous/api_core/animal_detection_api/detection/detector_training/copy_checkpoints.py +0 -43
  127. api/synchronous/api_core/animal_detection_api/detection/process_video.py +0 -543
  128. api/synchronous/api_core/animal_detection_api/detection/pytorch_detector.py +0 -304
  129. api/synchronous/api_core/animal_detection_api/detection/run_detector.py +0 -627
  130. api/synchronous/api_core/animal_detection_api/detection/run_detector_batch.py +0 -1029
  131. api/synchronous/api_core/animal_detection_api/detection/run_inference_with_yolov5_val.py +0 -581
  132. api/synchronous/api_core/animal_detection_api/detection/run_tiled_inference.py +0 -754
  133. api/synchronous/api_core/animal_detection_api/detection/tf_detector.py +0 -165
  134. api/synchronous/api_core/animal_detection_api/detection/video_utils.py +0 -495
  135. api/synchronous/api_core/animal_detection_api/md_utils/azure_utils.py +0 -174
  136. api/synchronous/api_core/animal_detection_api/md_utils/ct_utils.py +0 -262
  137. api/synchronous/api_core/animal_detection_api/md_utils/directory_listing.py +0 -251
  138. api/synchronous/api_core/animal_detection_api/md_utils/matlab_porting_tools.py +0 -97
  139. api/synchronous/api_core/animal_detection_api/md_utils/path_utils.py +0 -416
  140. api/synchronous/api_core/animal_detection_api/md_utils/process_utils.py +0 -110
  141. api/synchronous/api_core/animal_detection_api/md_utils/sas_blob_utils.py +0 -509
  142. api/synchronous/api_core/animal_detection_api/md_utils/string_utils.py +0 -59
  143. api/synchronous/api_core/animal_detection_api/md_utils/url_utils.py +0 -144
  144. api/synchronous/api_core/animal_detection_api/md_utils/write_html_image_list.py +0 -226
  145. api/synchronous/api_core/animal_detection_api/md_visualization/visualization_utils.py +0 -841
  146. detection/detector_training/model_main_tf2.py +0 -114
  147. docs/source/conf.py +0 -43
  148. megadetector-5.0.10.dist-info/RECORD +0 -224
  149. megadetector-5.0.10.dist-info/top_level.txt +0 -8
  150. {api → megadetector/api}/__init__.py +0 -0
  151. {api → megadetector/api}/batch_processing/__init__.py +0 -0
  152. {api → megadetector/api}/batch_processing/api_core/__init__.py +0 -0
  153. {api → megadetector/api}/batch_processing/api_core/batch_service/__init__.py +0 -0
  154. {api → megadetector/api}/batch_processing/api_core/server.py +0 -0
  155. {api → megadetector/api}/batch_processing/api_core/server_api_config.py +0 -0
  156. {api → megadetector/api}/batch_processing/api_core/server_app_config.py +0 -0
  157. {api → megadetector/api}/batch_processing/api_core/server_batch_job_manager.py +0 -0
  158. {api → megadetector/api}/batch_processing/api_core/server_job_status_table.py +0 -0
  159. {api → megadetector/api}/batch_processing/api_core/server_orchestration.py +0 -0
  160. {api → megadetector/api}/batch_processing/api_core/server_utils.py +0 -0
  161. {api → megadetector/api}/batch_processing/api_core_support/__init__.py +0 -0
  162. {api → megadetector/api}/batch_processing/api_core_support/aggregate_results_manually.py +0 -0
  163. {api → megadetector/api}/batch_processing/api_support/__init__.py +0 -0
  164. {api → megadetector/api}/batch_processing/api_support/summarize_daily_activity.py +0 -0
  165. {api → megadetector/api}/batch_processing/data_preparation/__init__.py +0 -0
  166. {api → megadetector/api}/batch_processing/integration/digiKam/setup.py +0 -0
  167. {api → megadetector/api}/batch_processing/integration/digiKam/xmp_integration.py +0 -0
  168. {api → megadetector/api}/batch_processing/integration/eMammal/test_scripts/config_template.py +0 -0
  169. {api → megadetector/api}/batch_processing/integration/eMammal/test_scripts/push_annotations_to_emammal.py +0 -0
  170. {api → megadetector/api}/batch_processing/integration/eMammal/test_scripts/select_images_for_testing.py +0 -0
  171. {api/batch_processing/postprocessing → megadetector/api/synchronous}/__init__.py +0 -0
  172. {api/synchronous → megadetector/api/synchronous/api_core/animal_detection_api}/__init__.py +0 -0
  173. {api → megadetector/api}/synchronous/api_core/animal_detection_api/config.py +0 -0
  174. {api/synchronous/api_core/animal_detection_api → megadetector/api/synchronous/api_core/tests}/__init__.py +0 -0
  175. {api → megadetector/api}/synchronous/api_core/tests/load_test.py +0 -0
  176. {api/synchronous/api_core/tests → megadetector/classification}/__init__.py +0 -0
  177. {classification → megadetector/classification}/aggregate_classifier_probs.py +0 -0
  178. {classification → megadetector/classification}/csv_to_json.py +0 -0
  179. {classification → megadetector/classification}/efficientnet/__init__.py +0 -0
  180. {classification → megadetector/classification}/efficientnet/model.py +0 -0
  181. {classification → megadetector/classification}/efficientnet/utils.py +0 -0
  182. {classification → megadetector/classification}/identify_mislabeled_candidates.py +0 -0
  183. {classification → megadetector/classification}/prepare_classification_script.py +0 -0
  184. {classification → megadetector/classification}/prepare_classification_script_mc.py +0 -0
  185. {classification → megadetector/classification}/save_mislabeled.py +0 -0
  186. {classification → megadetector/data_management}/__init__.py +0 -0
  187. {data_management → megadetector/data_management/annotations}/__init__.py +0 -0
  188. {data_management → megadetector/data_management}/annotations/annotation_constants.py +0 -0
  189. {data_management → megadetector/data_management}/cct_to_wi.py +0 -0
  190. {data_management/annotations → megadetector/data_management/databases}/__init__.py +0 -0
  191. {data_management → megadetector/data_management}/databases/add_width_and_height_to_db.py +0 -0
  192. {data_management → megadetector/data_management}/databases/combine_coco_camera_traps_files.py +0 -0
  193. {data_management → megadetector/data_management}/databases/subset_json_db.py +0 -0
  194. {data_management → megadetector/data_management}/generate_crops_from_cct.py +0 -0
  195. {data_management → megadetector/data_management}/importers/add_nacti_sizes.py +0 -0
  196. {data_management → megadetector/data_management}/importers/add_timestamps_to_icct.py +0 -0
  197. {data_management → megadetector/data_management}/importers/animl_results_to_md_results.py +0 -0
  198. {data_management → megadetector/data_management}/importers/eMammal/copy_and_unzip_emammal.py +0 -0
  199. {data_management → megadetector/data_management}/importers/eMammal/eMammal_helpers.py +0 -0
  200. {data_management → megadetector/data_management}/importers/eMammal/make_eMammal_json.py +0 -0
  201. {data_management → megadetector/data_management}/importers/mcgill_to_json.py +0 -0
  202. {data_management → megadetector/data_management}/importers/nacti_fieldname_adjustments.py +0 -0
  203. {data_management → megadetector/data_management}/importers/plot_wni_giraffes.py +0 -0
  204. {data_management → megadetector/data_management}/importers/snapshotserengeti/make_full_SS_json.py +0 -0
  205. {data_management → megadetector/data_management}/importers/snapshotserengeti/make_per_season_SS_json.py +0 -0
  206. {data_management → megadetector/data_management}/importers/sulross_get_exif.py +0 -0
  207. {data_management → megadetector/data_management}/importers/zamba_results_to_md_results.py +0 -0
  208. {data_management/databases → megadetector/data_management/lila}/__init__.py +0 -0
  209. {data_management → megadetector/data_management}/lila/add_locations_to_nacti.py +0 -0
  210. {data_management/lila → megadetector/detection}/__init__.py +0 -0
  211. {detection → megadetector/detection/detector_training}/__init__.py +0 -0
  212. {api/synchronous/api_core/animal_detection_api → megadetector}/detection/detector_training/model_main_tf2.py +0 -0
  213. {detection/detector_training → megadetector/postprocessing}/__init__.py +0 -0
  214. {md_utils → megadetector/taxonomy_mapping}/__init__.py +0 -0
  215. {taxonomy_mapping → megadetector/taxonomy_mapping}/prepare_lila_taxonomy_release.py +0 -0
  216. {taxonomy_mapping → megadetector/taxonomy_mapping}/taxonomy_graph.py +0 -0
  217. {md_visualization → megadetector/utils}/__init__.py +0 -0
  218. {md_utils → megadetector/utils}/ct_utils.py +0 -0
  219. {md_utils → megadetector/utils}/path_utils.py +0 -0
  220. {md_utils → megadetector/utils}/process_utils.py +0 -0
  221. {md_utils → megadetector/utils}/sas_blob_utils.py +0 -0
  222. {md_utils → megadetector/utils}/string_utils.py +0 -0
  223. {md_utils → megadetector/utils}/url_utils.py +0 -0
  224. {taxonomy_mapping → megadetector/visualization}/__init__.py +0 -0
  225. {md_visualization → megadetector/visualization}/plot_utils.py +0 -0
  226. {megadetector-5.0.10.dist-info → megadetector-5.0.12.dist-info}/WHEEL +0 -0
@@ -14,11 +14,12 @@ import uuid
14
14
  import time
15
15
  import humanfriendly
16
16
  import numpy as np
17
- from PIL import Image
18
- from tqdm import tqdm
19
17
  import shutil
20
18
  import zipfile
21
19
 
20
+ from PIL import Image
21
+ from tqdm import tqdm
22
+
22
23
  base_directory = r'e:\wildlife_data\ena24'
23
24
  output_file = os.path.join(base_directory,'ena24.json')
24
25
  image_directory = os.path.join(base_directory,'images')
@@ -245,7 +246,7 @@ zipdir(non_human_dir,non_human_zipfile)
245
246
 
246
247
  #%% Validate output
247
248
 
248
- from data_management.databases import integrity_check_json_db
249
+ from megadetector.data_management.databases import integrity_check_json_db
249
250
 
250
251
  fn = output_file
251
252
  options = integrity_check_json_db.IntegrityCheckOptions()
@@ -259,8 +260,8 @@ sortedCategories, data = integrity_check_json_db.integrity_check_json_db(fn,opti
259
260
 
260
261
  #%% Preview labels
261
262
 
262
- from md_visualization import visualize_db
263
- from data_management.databases import integrity_check_json_db
263
+ from megadetector.visualization import visualize_db
264
+ from megadetector.data_management.databases import integrity_check_json_db
264
265
 
265
266
  viz_options = visualize_db.DbVizOptions()
266
267
  viz_options.num_to_visualize = None
@@ -16,9 +16,10 @@ import uuid
16
16
  import csv
17
17
  import warnings
18
18
  import datetime
19
+
19
20
  from PIL import Image
20
21
 
21
- from md_utils.path_utils import find_images
22
+ from megadetector.utils.path_utils import find_images
22
23
 
23
24
  # ignoring all "PIL cannot read EXIF metainfo for the images" warnings
24
25
  warnings.filterwarnings("ignore", "(Possibly )?corrupt EXIF data", UserWarning)
@@ -14,12 +14,13 @@ import uuid
14
14
  import time
15
15
  import humanfriendly
16
16
  import numpy as np
17
- from PIL import Image
18
- from tqdm import tqdm
17
+
19
18
  import pandas as pd
19
+
20
+ from PIL import Image
20
21
  from datetime import datetime
21
22
 
22
- from md_utils.path_utils import find_images
23
+ from megadetector.utils.path_utils import find_images
23
24
 
24
25
  base_directory = r'/mnt/blobfuse/wildlifeblobssc/'
25
26
  output_directory = r'/home/gramener'
@@ -251,7 +252,7 @@ print('Finished writing .json file with {} images, {} annotations, and {} catego
251
252
 
252
253
  #%% Validate output
253
254
 
254
- from data_management.databases import integrity_check_json_db
255
+ from megadetector.data_management.databases import integrity_check_json_db
255
256
 
256
257
  options = integrity_check_json_db.IntegrityCheckOptions()
257
258
  options.baseDir = image_directory
@@ -263,8 +264,8 @@ data = integrity_check_json_db.integrity_check_json_db(output_json_file,options)
263
264
 
264
265
  #%% Preview labels
265
266
 
266
- from md_visualization import visualize_db
267
- from data_management.databases import integrity_check_json_db
267
+ from megadetector.visualization import visualize_db
268
+ from megadetector.data_management.databases import integrity_check_json_db
268
269
 
269
270
  viz_options = visualize_db.DbVizOptions()
270
271
  viz_options.num_to_visualize = None
@@ -837,7 +837,7 @@ if __name__ == "__main__":
837
837
 
838
838
  #%% Validate .json file
839
839
 
840
- from data_management.databases import integrity_check_json_db
840
+ from megadetector.data_management.databases import integrity_check_json_db
841
841
 
842
842
  options = integrity_check_json_db.IntegrityCheckOptions()
843
843
  options.baseDir = input_base
@@ -850,7 +850,7 @@ if __name__ == "__main__":
850
850
 
851
851
  #%% Preview labels
852
852
 
853
- from md_visualization import visualize_db
853
+ from megadetector.visualization import visualize_db
854
854
 
855
855
  viz_options = visualize_db.DbVizOptions()
856
856
  viz_options.num_to_visualize = 1000
@@ -1119,7 +1119,7 @@ if __name__ == "__main__":
1119
1119
 
1120
1120
  #%% Validate .json file (modified strings, original files)
1121
1121
 
1122
- from data_management.databases import integrity_check_json_db
1122
+ from megadetector.data_management.databases import integrity_check_json_db
1123
1123
 
1124
1124
  options = integrity_check_json_db.IntegrityCheckOptions()
1125
1125
  options.baseDir = input_base
@@ -1132,7 +1132,7 @@ if __name__ == "__main__":
1132
1132
 
1133
1133
  #%% Preview labels (original files)
1134
1134
 
1135
- from md_visualization import visualize_db
1135
+ from megadetector.visualization import visualize_db
1136
1136
 
1137
1137
  viz_options = visualize_db.DbVizOptions()
1138
1138
  viz_options.num_to_visualize = 1000
@@ -1252,7 +1252,7 @@ if __name__ == "__main__":
1252
1252
 
1253
1253
  #%% Validate .json file (final filenames)
1254
1254
 
1255
- from data_management.databases import integrity_check_json_db
1255
+ from megadetector.data_management.databases import integrity_check_json_db
1256
1256
 
1257
1257
  options = integrity_check_json_db.IntegrityCheckOptions()
1258
1258
  options.baseDir = input_base
@@ -1265,7 +1265,7 @@ if __name__ == "__main__":
1265
1265
 
1266
1266
  #%% Preview labels (final filenames)
1267
1267
 
1268
- from md_visualization import visualize_db
1268
+ from megadetector.visualization import visualize_db
1269
1269
 
1270
1270
  viz_options = visualize_db.DbVizOptions()
1271
1271
  viz_options.num_to_visualize = 1500
@@ -146,7 +146,7 @@ with open(output_json,'w') as f:
146
146
 
147
147
  #%% Validate .json file
148
148
 
149
- from data_management.databases import integrity_check_json_db
149
+ from megadetector.data_management.databases import integrity_check_json_db
150
150
 
151
151
  options = integrity_check_json_db.IntegrityCheckOptions()
152
152
  options.baseDir = os.path.join(base_folder,'images'); assert os.path.isdir(options.baseDir)
@@ -159,7 +159,7 @@ _, _, _ = integrity_check_json_db.integrity_check_json_db(output_json, options)
159
159
 
160
160
  #%% Preview labels
161
161
 
162
- from md_visualization import visualize_db
162
+ from megadetector.visualization import visualize_db
163
163
 
164
164
  viz_options = visualize_db.DbVizOptions()
165
165
  viz_options.num_to_visualize = 100
@@ -262,7 +262,7 @@ with open(output_json,'w') as f:
262
262
 
263
263
  #%% Validate .json file
264
264
 
265
- from data_management.databases import integrity_check_json_db
265
+ from megadetector.data_management.databases import integrity_check_json_db
266
266
 
267
267
  options = integrity_check_json_db.IntegrityCheckOptions()
268
268
  options.baseDir = remote_image_base_dir
@@ -275,7 +275,7 @@ _, _, _ = integrity_check_json_db.integrity_check_json_db(output_json, options)
275
275
 
276
276
  #%% Preview labels
277
277
 
278
- from md_visualization import visualize_db
278
+ from megadetector.visualization import visualize_db
279
279
 
280
280
  viz_options = visualize_db.DbVizOptions()
281
281
  viz_options.num_to_visualize = 100
@@ -142,7 +142,7 @@ print('Finished writing .json file with {} images, {} annotations, and {} catego
142
142
 
143
143
  #%% Validate
144
144
 
145
- from data_management.databases import integrity_check_json_db
145
+ from megadetector.data_management.databases import integrity_check_json_db
146
146
 
147
147
  options = integrity_check_json_db.IntegrityCheckOptions()
148
148
  sortedCategories,data = integrity_check_json_db.integrity_check_json_db(output_file, options)
@@ -27,6 +27,7 @@ import humanfriendly
27
27
  import warnings
28
28
  import ntpath
29
29
  import datetime
30
+
30
31
  from PIL import Image
31
32
 
32
33
  # ignoring all "PIL cannot read EXIF metainfo for the images" warnings
@@ -458,7 +459,7 @@ print('Finished writing json to {}'.format(outputJsonFilenameSet1))
458
459
 
459
460
  #%% Consistency-check final set 1 .json file
460
461
 
461
- from data_management.databases import integrity_check_json_db
462
+ from megadetector.data_management.databases import integrity_check_json_db
462
463
  options = integrity_check_json_db.IntegrityCheckOptions()
463
464
  options.baseDir = imageDir
464
465
  options.bCheckImageSizes = True
@@ -472,7 +473,7 @@ sortedCategories
472
473
 
473
474
  #%% Generate previews
474
475
 
475
- from md_visualization import visualize_db
476
+ from megadetector.visualization import visualize_db
476
477
 
477
478
  output_dir = os.path.join(baseDir,'preview')
478
479
 
@@ -485,5 +486,5 @@ options.parallelize_rendering = True
485
486
 
486
487
  htmlOutputFile,_ = visualize_db.visualize_db(outputJsonFilenameSet1,output_dir,imageDir,options)
487
488
 
488
- from md_utils.path_utils import open_file
489
+ from megadetector.utils.path_utils import open_file
489
490
  open_file(htmlOutputFile)
@@ -12,8 +12,8 @@ import os
12
12
  import pandas as pd
13
13
  from tqdm import tqdm
14
14
 
15
- from md_utils import url_utils
16
- from md_visualization import visualization_utils
15
+ from megadetector.utils import url_utils
16
+ from megadetector.visualization import visualization_utils
17
17
 
18
18
  # A list of files in the lilablobssc container for this data set
19
19
  container_file_list = r'C:\temp\seals\seal_files.txt'
@@ -20,11 +20,11 @@ import humanfriendly
20
20
  import os
21
21
  import PIL
22
22
 
23
- from data_management.databases import integrity_check_json_db
24
- from data_management.cct_json_utils import IndexedJsonDb
25
- from data_management import cct_json_to_filename_json
26
- from md_visualization import visualize_db
27
- from md_utils import path_utils
23
+ from megadetector.data_management.databases import integrity_check_json_db
24
+ from megadetector.data_management.cct_json_utils import IndexedJsonDb
25
+ from megadetector.data_management import cct_json_to_filename_json
26
+ from megadetector.visualization import visualize_db
27
+ from megadetector.utils import path_utils
28
28
 
29
29
  input_base = r"g:\20190715"
30
30
  output_file = r"D:\wildlife_data\parks_canada\pc_20190715.json"
@@ -11,7 +11,7 @@ import json
11
11
  import uuid
12
12
  import pandas as pd
13
13
 
14
- from md_utils.path_utils import open_file
14
+ from megadetector.utils.path_utils import open_file
15
15
 
16
16
  base_folder = r'G:\temp\noaa'
17
17
  output_json_fn = os.path.join(base_folder,'noaa_estuary_fish.json')
@@ -297,7 +297,7 @@ with open(output_json_fn,'w') as f:
297
297
 
298
298
  #%% Check DB integrity
299
299
 
300
- from data_management.databases import integrity_check_json_db
300
+ from megadetector.data_management.databases import integrity_check_json_db
301
301
 
302
302
  options = integrity_check_json_db.IntegrityCheckOptions()
303
303
  options.baseDir = os.path.join(base_folder,jpeg_image_folder)
@@ -325,7 +325,7 @@ assert 'unknown' not in location_to_count.keys()
325
325
 
326
326
  #%% Preview some images
327
327
 
328
- from md_visualization import visualize_db
328
+ from megadetector.visualization import visualize_db
329
329
 
330
330
  viz_options = visualize_db.DbVizOptions()
331
331
  viz_options.num_to_visualize = 10000
@@ -15,9 +15,9 @@ from tqdm import tqdm
15
15
  from operator import itemgetter
16
16
  from shutil import copyfile
17
17
 
18
- from md_visualization import visualize_db
19
- from data_management.databases import integrity_check_json_db
20
- from data_management.cct_json_utils import IndexedJsonDb
18
+ from megadetector.visualization import visualize_db
19
+ from megadetector.data_management.databases import integrity_check_json_db
20
+ from megadetector.data_management.cct_json_utils import IndexedJsonDb
21
21
 
22
22
  annotation_list_filename = r'd:\wildlife_data\zsl_borneo\all_img_ids_to_bbox.json'
23
23
  image_json = r'd:\wildlife_data\zsl_borneo\201906cameratraps\0.5\zsl_camera_traps_201906.json'
@@ -21,8 +21,8 @@ import ntpath
21
21
  import humanfriendly
22
22
  import PIL
23
23
 
24
- from data_management.databases import integrity_check_json_db
25
- from md_visualization import visualize_db
24
+ from megadetector.data_management.databases import integrity_check_json_db
25
+ from megadetector.visualization import visualize_db
26
26
 
27
27
  # [location] is an obfuscation
28
28
  baseDir = r'e:\wildlife_data\rspb_gola_data'
@@ -18,7 +18,7 @@ import humanfriendly
18
18
  import numpy as np
19
19
  from tqdm import tqdm
20
20
 
21
- from md_utils.path_utils import find_images
21
+ from megadetector.utils.path_utils import find_images
22
22
 
23
23
  input_base = r'z:/ste_2019_08_drop'
24
24
  input_metadata_file = os.path.join(input_base,'SURVEY_A.xlsx')
@@ -277,7 +277,7 @@ print('Finished writing .json file with {} images, {} annotations, and {} catego
277
277
 
278
278
  #%% Validate output
279
279
 
280
- from data_management.databases import integrity_check_json_db
280
+ from megadetector.data_management.databases import integrity_check_json_db
281
281
 
282
282
  options = integrity_check_json_db.IntegrityCheckOptions()
283
283
  options.baseDir = image_directory
@@ -290,8 +290,8 @@ sortedCategories, data = integrity_check_json_db.integrity_check_json_db(output_
290
290
 
291
291
  #%% Preview labels
292
292
 
293
- from md_visualization import visualize_db
294
- from data_management.databases import integrity_check_json_db
293
+ from megadetector.visualization import visualize_db
294
+ from megadetector.data_management.databases import integrity_check_json_db
295
295
 
296
296
  viz_options = visualize_db.DbVizOptions()
297
297
  viz_options.num_to_visualize = 1000
@@ -9,21 +9,18 @@
9
9
 
10
10
  #%% Constants and environment
11
11
 
12
- from md_visualization import visualize_db
13
- from data_management.databases import integrity_check_json_db
14
12
  import pandas as pd
15
13
  import os
16
- import glob
17
14
  import json
18
15
  import uuid
19
16
  import time
20
17
  import humanfriendly
21
- from PIL import Image
22
18
  import numpy as np
23
- import logging
24
19
  from tqdm import tqdm
25
20
 
26
- from md_utils.path_utils import find_images
21
+ from megadetector.utils.path_utils import find_images
22
+ from megadetector.visualization import visualize_db
23
+ from megadetector.data_management.databases import integrity_check_json_db
27
24
 
28
25
  input_base = r'z:/ste_2019_08_drop'
29
26
  # input_base = r'/mnt/blobfuse/wildlifeblobssc/ste_2019_08_drop'
@@ -289,7 +286,7 @@ print('Finished writing .json file with {} images, {} annotations, and {} catego
289
286
 
290
287
  #%% Validate output
291
288
 
292
- from data_management.databases import integrity_check_json_db
289
+ from megadetector.data_management.databases import integrity_check_json_db
293
290
 
294
291
  options = integrity_check_json_db.IntegrityCheckOptions()
295
292
  options.baseDir = image_directory
@@ -302,8 +299,8 @@ sortedCategories, data = integrity_check_json_db.integrity_check_json_db(output_
302
299
 
303
300
  #%% Preview labels
304
301
 
305
- from md_visualization import visualize_db
306
- from data_management.databases import integrity_check_json_db
302
+ from megadetector.visualization import visualize_db
303
+ from megadetector.data_management.databases import integrity_check_json_db
307
304
 
308
305
  viz_options = visualize_db.DbVizOptions()
309
306
  viz_options.num_to_visualize = 1000
@@ -43,8 +43,8 @@ from tqdm import tqdm
43
43
  from zipfile import ZipFile
44
44
  import zipfile
45
45
 
46
- from md_utils import path_utils
47
- from md_visualization import visualize_db
46
+ from megadetector.utils import path_utils
47
+ from megadetector.visualization import visualize_db
48
48
 
49
49
 
50
50
  #%% Constants
@@ -579,7 +579,7 @@ print('\nFinished writing {}, added {} files'.format(zipfilename,n_images_added)
579
579
 
580
580
  #%% Consistency-check-check .json file
581
581
 
582
- from data_management.databases import integrity_check_json_db
582
+ from megadetector.data_management.databases import integrity_check_json_db
583
583
 
584
584
  options = integrity_check_json_db.IntegrityCheckOptions()
585
585
  options.baseDir = output_public_folder
@@ -710,7 +710,7 @@ s = 'This data set contains {} sequences of camera trap images, totaling {} imag
710
710
  n_sequences,n_images,project_friendly_name,n_categories,
711
711
  top_categories[0],top_categories[1],top_categories[2],
712
712
  percent_empty,
713
- 'https://lilablobssc.blob.core.windows.net/snapshot-safari/{}/{}_{}_v{}.species_list.csv'.format(
713
+ 'https://lilawildlife.blob.core.windows.net/lila-wildlife/snapshot-safari/{}/{}_{}_v{}.species_list.csv'.format(
714
714
  project_name,project_friendly_name.replace(' ',''),season_name,json_version))
715
715
  print(s)
716
716
 
@@ -22,7 +22,7 @@ import pandas as pd
22
22
  from tqdm import tqdm
23
23
  from collections import defaultdict
24
24
 
25
- from md_utils import path_utils
25
+ from megadetector.utils import path_utils
26
26
 
27
27
  input_base = '/media/user/Elements'
28
28
  output_base = os.path.expanduser('~/data/snapshot-safari-metadata')
@@ -628,7 +628,7 @@ copy_sampled_images(sampled_vehicle_mismatches,vehicle_mismatch_output_folder)
628
628
 
629
629
  filename_base_to_filename = {}
630
630
 
631
- from md_utils.path_utils import is_image_file
631
+ from megadetector.utils.path_utils import is_image_file
632
632
 
633
633
  # fn = all_files_relative[0]
634
634
  for fn in tqdm(all_files_relative):
@@ -33,7 +33,7 @@ from tqdm import tqdm
33
33
  from zipfile import ZipFile
34
34
  import zipfile
35
35
 
36
- from md_utils import path_utils
36
+ from megadetector.utils import path_utils
37
37
 
38
38
  metadata_base = r'e:\snapshot-serengeti\MetaData\SER'
39
39
  image_base = r'e:\snapshot-serengeti\SER'
@@ -856,7 +856,7 @@ for i_season in seasons_to_zip:
856
856
 
857
857
  # %logstart -o r'E:\snapshot_temp\python.txt'
858
858
 
859
- from data_management.databases import integrity_check_json_db
859
+ from megadetector.data_management.databases import integrity_check_json_db
860
860
 
861
861
  files_to_check = glob.glob(os.path.join(output_base,'*.json'))
862
862
 
@@ -984,7 +984,7 @@ print('{} missing images in {} bounding boxes ({} found)'.format(len(missing_ima
984
984
  #%% Integrity-check a few files to make sure bounding boxes are still sensible
985
985
 
986
986
  # import sys; sys.path.append(r'C:\git\MegaDetector')
987
- from md_visualization import visualize_db
987
+ from megadetector.visualization import visualize_db
988
988
  output_base = r'E:\snapshot_temp'
989
989
 
990
990
  viz_options = visualize_db.DbVizOptions()
@@ -1016,9 +1016,9 @@ n_categories_s10 = len(data_10['categories'])
1016
1016
 
1017
1017
  #%% Summary prep for LILA
1018
1018
 
1019
+ import os
1019
1020
  import json
1020
1021
  from tqdm import tqdm
1021
- import os
1022
1022
 
1023
1023
  json_fn = r"D:\temp\SnapshotSeregeti_v2.0.json"
1024
1024
  with open(json_fn,'r') as f:
@@ -23,9 +23,9 @@ import pandas as pd
23
23
  import numpy as np
24
24
  from tqdm import tqdm
25
25
 
26
- from md_visualization import visualize_db
27
- from data_management.databases import integrity_check_json_db
28
- from md_utils import path_utils
26
+ from megadetector.visualization import visualize_db
27
+ from megadetector.data_management.databases import integrity_check_json_db
28
+ from megadetector.utils import path_utils
29
29
 
30
30
  # Text file with relative paths to all files (images and .csv files)
31
31
  input_relative_file_list = ''
@@ -24,9 +24,9 @@ import shutil
24
24
  from tqdm import tqdm
25
25
  from PIL import Image
26
26
 
27
- from md_visualization import visualize_db
28
- from data_management.databases import integrity_check_json_db
29
- from md_utils.path_utils import find_images
27
+ from megadetector.visualization import visualize_db
28
+ from megadetector.data_management.databases import integrity_check_json_db
29
+ from megadetector.utils.path_utils import find_images
30
30
 
31
31
  input_base = r'e:\ubc'
32
32
  assert(os.path.isdir(input_base))
@@ -292,7 +292,7 @@ import uuid
292
292
  import datetime
293
293
  from tqdm import tqdm
294
294
 
295
- from data_management.databases import integrity_check_json_db
295
+ from megadetector.data_management.databases import integrity_check_json_db
296
296
 
297
297
  output_base = 'f:\orinoquia_camera_traps'
298
298
  output_image_base = os.path.join(output_base,'images')
@@ -486,7 +486,7 @@ else:
486
486
 
487
487
  #%% Preview labels
488
488
 
489
- from md_visualization import visualize_db
489
+ from megadetector.visualization import visualize_db
490
490
 
491
491
  viz_options = visualize_db.DbVizOptions()
492
492
  viz_options.num_to_visualize = 100
@@ -231,7 +231,7 @@ print('Finished writing .json file with {} images, {} annotations, and {} catego
231
231
 
232
232
  #%% Validate .json files
233
233
 
234
- from data_management.databases import integrity_check_json_db
234
+ from megadetector.data_management.databases import integrity_check_json_db
235
235
 
236
236
  options = integrity_check_json_db.IntegrityCheckOptions()
237
237
  options.baseDir = image_directory
@@ -244,7 +244,7 @@ sorted_categories, data, error_info = integrity_check_json_db.integrity_check_js
244
244
 
245
245
  #%% Preview labels
246
246
 
247
- from md_visualization import visualize_db
247
+ from megadetector.visualization import visualize_db
248
248
 
249
249
  viz_options = visualize_db.DbVizOptions()
250
250
  viz_options.num_to_visualize = 2000
@@ -259,5 +259,5 @@ html_output_file, image_db = visualize_db.visualize_db(db_path=output_file,
259
259
  image_base_dir=image_directory,
260
260
  options=viz_options)
261
261
 
262
- from md_utils import path_utils
262
+ from megadetector.utils import path_utils
263
263
  path_utils.open_file(html_output_file)
@@ -23,8 +23,9 @@ import copy
23
23
 
24
24
  from collections import defaultdict
25
25
  from tqdm import tqdm
26
- from md_visualization import visualize_db
27
- from data_management.databases import integrity_check_json_db
26
+
27
+ from megadetector.visualization import visualize_db
28
+ from megadetector.data_management.databases import integrity_check_json_db
28
29
 
29
30
  organization_name = 'organization'
30
31
  input_base = os.path.expanduser('~/data/' + organization_name)
@@ -12,14 +12,13 @@ import json
12
12
  import os
13
13
  import uuid
14
14
 
15
- from md_utils import path_utils
16
- from md_visualization.visualization_utils import open_image
17
-
18
15
  from multiprocessing.pool import Pool, ThreadPool
19
16
  from functools import partial
20
-
21
17
  from tqdm import tqdm
22
18
 
19
+ from megadetector.utils import path_utils
20
+ from megadetector.visualization.visualization_utils import open_image
21
+
23
22
 
24
23
  #%% Support functions
25
24
 
@@ -481,7 +480,7 @@ if False:
481
480
 
482
481
  #%% Validate
483
482
 
484
- from data_management.databases import integrity_check_json_db
483
+ from megadetector.data_management.databases import integrity_check_json_db
485
484
 
486
485
  options = integrity_check_json_db.IntegrityCheckOptions()
487
486
 
@@ -496,7 +495,7 @@ if False:
496
495
 
497
496
  #%% Preview
498
497
 
499
- from md_visualization import visualize_db
498
+ from megadetector.visualization import visualize_db
500
499
  options = visualize_db.DbVizOptions()
501
500
  options.parallelize_rendering = True
502
501
  options.viz_size = (900, -1)
@@ -506,7 +505,7 @@ if False:
506
505
  input_folder,options)
507
506
 
508
507
 
509
- from md_utils import path_utils # noqa
508
+ from megadetector.utils import path_utils # noqa
510
509
  path_utils.open_file(html_file)
511
510
 
512
511
 
@@ -13,10 +13,10 @@ import json
13
13
 
14
14
  from multiprocessing.pool import Pool, ThreadPool
15
15
  from functools import partial
16
-
17
- from md_utils.path_utils import recursive_file_list
18
16
  from tqdm import tqdm
19
17
 
18
+ from megadetector.utils.path_utils import recursive_file_list
19
+
20
20
 
21
21
  #%% Main function
22
22
 
@@ -58,7 +58,7 @@ with open(output_fn,'w') as f:
58
58
 
59
59
  #%% Validate .json files
60
60
 
61
- from data_management.databases import integrity_check_json_db
61
+ from megadetector.data_management.databases import integrity_check_json_db
62
62
 
63
63
  options = integrity_check_json_db.IntegrityCheckOptions()
64
64
  options.baseDir = image_directory
@@ -71,7 +71,7 @@ sorted_categories, data, error_info = integrity_check_json_db.integrity_check_js
71
71
 
72
72
  #%% Preview labels
73
73
 
74
- from md_visualization import visualize_db
74
+ from megadetector.visualization import visualize_db
75
75
 
76
76
  viz_options = visualize_db.DbVizOptions()
77
77
  viz_options.num_to_visualize = 2000
@@ -85,13 +85,13 @@ html_output_file, image_db = visualize_db.visualize_db(db_path=output_fn,
85
85
  image_base_dir=image_directory,
86
86
  options=viz_options)
87
87
 
88
- from md_utils import path_utils
88
+ from megadetector.utils import path_utils
89
89
  path_utils.open_file(html_output_file)
90
90
 
91
91
 
92
92
  #%% Zip output file
93
93
 
94
- from md_utils.path_utils import zip_file
94
+ from megadetector.utils.path_utils import zip_file
95
95
 
96
96
  zip_file(output_fn, verbose=True)
97
97
  assert os.path.isfile(output_fn + '.zip')