How nasa-impact/marine_debris_ml works
This repository supports a marine-debris detection workflow: select Planet imagery, label and prepare tiled training data, train and export an object detector, then request tiles, run predictions, store detections and produce geospatial results. The TensorFlow Object Detection API supplies model, training, inference and evaluation capabilities. Major data-preparation, evaluation and Planet-query utilities are shown alongside that main path. Some deployment steps are documented rather than evidenced in sampled implementation; those relationships cite the README.
Main entry points: trainer.py Model training · meta_architectures Detection architecture · handler.py Inference handler · get_planet_scenes_coverage.py Planet scene search
Components 34
Imagery and data
- Planet scene search
inference_utils/get_planet_scenes_coverage.py - Scene labeling
data_utils/S32ImageLabeler.py - Scene data preparation
data_utils/label_maker_get_training_data_from_S3_IL.py - Tile processing
data_utils/process_analytic_images_from_S3.py - TFRecord conversion
data_utils/utils_convert_tfrecords.py - TFRecord datasets
- API dataset tools
object_detection_api/dataset_tools - TFExample decoding
object_detection_api/data_decoders/tf_example_decoder.py
Detection model
- Training configuration
object_detection_api/protos/pipeline.proto - Model builders
object_detection_api/builders - Detection architecture
object_detection_api/meta_architectures - Feature extractors
object_detection_api/models - Box predictors
object_detection_api/predictors - Input preprocessing
object_detection_api/core/preprocessor.py - Model training
object_detection_api/legacy/trainer.py - Model export
object_detection_api/export_inference_graph.py - Detection inference
object_detection_api/inference/detection_inference.py - API core and anchors
object_detection_api/core - API configuration protos
object_detection_api/protos - Training orchestration
object_detection_api/model_lib.py
Inference pipeline
- Prediction endpoint
- Planet tile service
- SQS tile queue
- Inference handler
inference_utils/handler.py - Download and predict
inference_utils/base.py - Prediction database
- GeoJSON results
inference_utils/tf_od_predict_image_aug_to_geo_corrected.py - Online dashboard
Evaluation
- Detection evaluation
object_detection_api/eval_util.py - COCO metrics
object_detection_api/metrics/coco_evaluation.py - Project scoring
evaluation_utils/eval_cmatrix_f1_map.py - Per-class mAP
evaluation_utils/calculate_map_score_per_class.py
Other components
- Imagery analyst
- Area and time requester
Connections 31
- Imagery analyst → Planet scene search: selects scenes
- Planet scene search → Scene labeling: finds imagery
- Scene labeling → Scene data preparation: provides annotations
- Scene data preparation → Tile processing: prepares tiles
- Tile processing → TFRecord conversion: supplies tiles
- TFRecord conversion → TFRecord datasets: writes records
- TFRecord datasets → Model training: trains on
- Training configuration → Model training: configures
object_detection_api/protos/pipeline.proto - Model builders → Detection architecture: builds models
- Feature extractors → Detection architecture: extracts features
- Box predictors → Detection architecture: predicts boxes
- Input preprocessing → Model training: prepares inputs
- Training orchestration → Model training: orchestrates
- Model training → Model export: exports checkpoint
- Model export → Prediction endpoint: deploys model
- Area and time requester → Planet tile service: requests tiles
- Planet tile service → SQS tile queue: returns tile list
- SQS tile queue → Inference handler: dispatches tiles
- Inference handler → Download and predict: delegates workflow
inference_utils/handler.py - Inference handler → Prediction endpoint: sends predictions
inference_utils/handler.py - Inference handler → Prediction database: saves detections
inference_utils/handler.py - Prediction database → GeoJSON results: exports predictions
- GeoJSON results → Online dashboard: feeds display
- Detection inference → Detection architecture: runs detection
- Detection evaluation → COCO metrics: evaluates detections
- Model training → Detection evaluation: evaluates model
- Project scoring → Per-class mAP: scores classes
- API dataset tools → TFRecord datasets: creates records
- TFExample decoding → TFRecord datasets: decodes records
- API core and anchors → Detection architecture: supports detection
- API configuration protos → Model builders: configures builders