From b64ab97d4ad4625987d358b1a2afe88c45256137 Mon Sep 17 00:00:00 2001 From: yawenzzzz Date: Fri, 18 Oct 2024 15:57:49 +0000 Subject: [PATCH] minor changes --- Dockerfile | 2 +- rslp/landsat_vessels/example_request.py | 1 + rslp/landsat_vessels/predict_pipeline.py | 14 -------------- rslp/utils/rslearn.py | 2 -- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index d0d0cfe5..3a11b397 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN pip install -r /opt/rslearn_projects/rslearn/extra_requirements.txt COPY requirements.txt /opt/rslearn_projects/requirements.txt RUN pip install -r /opt/rslearn_projects/requirements.txt -# We can use `pip install rslearn[extra]` now +# Not sure if we want to replace to `pip install rslearn[extra]` now, the current setup always import the latest version of rslearn # We need rslp to be pip installed as well ENV PYTHONPATH="${PYTHONPATH}:/opt/rslearn_projects/rslearn:." diff --git a/rslp/landsat_vessels/example_request.py b/rslp/landsat_vessels/example_request.py index 1cfefcd5..4e71c69d 100644 --- a/rslp/landsat_vessels/example_request.py +++ b/rslp/landsat_vessels/example_request.py @@ -9,6 +9,7 @@ LANDSAT_ENDPOINT = f"http://localhost:{PORT}/detections" TIMEOUT_SECONDS = 60000 SCENE_ID = "LC09_L1GT_106084_20241002_20241002_02_T2" +# TODO: change the paths CROP_PATH = "/home/yawenz/rslearn_projects/rslp/landsat_vessels/temp_crops" SCRATCH_PATH = "/home/yawenz/rslearn_projects/rslp/landsat_vessels/temp_scratch" JSON_PATH = "/home/yawenz/rslearn_projects/rslp/landsat_vessels/vessels.json" diff --git a/rslp/landsat_vessels/predict_pipeline.py b/rslp/landsat_vessels/predict_pipeline.py index 09d0d305..9ea80227 100644 --- a/rslp/landsat_vessels/predict_pipeline.py +++ b/rslp/landsat_vessels/predict_pipeline.py @@ -204,18 +204,6 @@ def predict_pipeline( scene_id: Landsat scene ID. Exactly one of image_files or scene_id should be specified. """ - # if not scratch_path: - # tmp_dir = TemporaryDirectory() - # scratch_path = tmp_dir.name - # else: - # tmp_dir = None - - print(f"scratch_path: {scratch_path}") - print(f"crop_path: {crop_path}") - print(f"json_path: {json_path}") - print(f"image_files: {image_files}") - print(f"scene_id: {scene_id}") - start_time = time.time() # Start the timer ds_path = UPath(scratch_path) @@ -344,8 +332,6 @@ def predict_pipeline( ) ) - # if tmp_dir: - # tmp_dir.cleanup() elapsed_time = time.time() - start_time # Calculate elapsed time print(f"Prediction pipeline completed in {elapsed_time:.2f} seconds") diff --git a/rslp/utils/rslearn.py b/rslp/utils/rslearn.py index caf4a212..555bb254 100644 --- a/rslp/utils/rslearn.py +++ b/rslp/utils/rslearn.py @@ -34,14 +34,12 @@ def materialize_dataset(ds_path: UPath, group: str | None = None, workers: int = dataset, workers=workers, group=group, - use_initial_job=False, ) apply_on_windows( MaterializeHandler(), dataset, workers=workers, group=group, - use_initial_job=False, )