Skip to content

Commit

Permalink
Pipeline filenames - bugfix (#63)
Browse files Browse the repository at this point in the history
* rename decollage -> flowcam, separate out filename parsing

* infer experiment name from directory, or supply, and passthru

* some debugging changes left over from last year

* back-incompatible ruff format pickiness, sigh
  • Loading branch information
metazool authored Jan 15, 2025
1 parent cececc7 commit b9d9ebb
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/params.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cluster:
n_clusters: 5

collection: untagged-images-lana
collection: untagged-images-lana
41 changes: 41 additions & 0 deletions scripts/run_luigi_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,52 @@
from cyto_ml.pipeline.pipeline_decollage import FlowCamPipeline
from cyto_ml.data.flowcam import parse_filename
import logging
<<<<<<< HEAD

=======
>>>>>>> main
logging.basicConfig(level=logging.INFO)


if __name__ == "__main__":

parser = argparse.ArgumentParser(
<<<<<<< HEAD
prog="Luigi FlowCam pipeline",
description="Triggers the process of decollaging images, embedding spatio-temporal metadata in headers, and uploading to s3 storage",
)

parser.add_argument(
"-o",
"--output_directory",
type=str,
default="./data/images_decollage",
help="directory for intermediate data",
)
parser.add_argument(
"-d",
"--directory",
type=str,
default="./tests/fixtures/MicrobialMethane_MESO_Tank10_54.0143_-2.7770_04052023_1",
help="Enable verbose mode",
)
parser.add_argument("-s", "--s3_bucket", type=str, default="untagged-images-lana")
parser.add_argument("-e", "--experiment_name", type=str)
args = parser.parse_args()

experiment = args.experiment_name
if not experiment or experiment == "":
try:
prefix, _, _, date, _ = parse_filename(args.directory)
experiment = "".join([prefix, date])
except ValueError as err:
logging.info(
"Could't figure out experiment name and date from {args.directory} - please call this with --experiment_name to set this"
)
logging.debug(err)
# TODO this properly
experiment = str(args.directory).split("/")[-2]
=======
prog='Luigi FlowCam pipeline',
description='Triggers the process of decollaging images, embedding spatio-temporal metadata in headers, and uploading to s3 storage',
)
Expand All @@ -28,6 +68,7 @@
logging.info("Could't figure out experiment name and date from {args.directory} - please call this with --experiment_name to set this")
logging.debug(err)
exit
>>>>>>> main

luigi.build(
[
Expand Down
2 changes: 1 addition & 1 deletion src/cyto_ml/visualisation/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def main() -> None:
st.set_page_config(layout="wide", page_title="Plankton image embeddings")

st.title("Image embeddings")
st.write(f"{len(image_ids(st.session_state['collection']))} images in {st.session_state["collection"]}")
st.write(f"{len(image_ids(st.session_state['collection']))} images in {st.session_state['collection']}")
# the generated HTML is not lovely at all

st.selectbox(
Expand Down

0 comments on commit b9d9ebb

Please sign in to comment.