From 38339e20de130127419c5adf942baeae6a274829 Mon Sep 17 00:00:00 2001 From: "matt.grossi" Date: Thu, 1 Oct 2026 16:47:12 -0400 Subject: [PATCH] Fix typos --- content/configuration.qmd | 10 +++++----- content/metadata.qmd | 2 +- content/setup.qmd | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/content/configuration.qmd b/content/configuration.qmd index db2c4af..b1ee012 100644 --- a/content/configuration.qmd +++ b/content/configuration.qmd @@ -69,7 +69,7 @@ For the sake of documenting workflows and facilitating future reproducibility, c ## Options -All user options are contained in a config YAML file (called `configurations.yml` by default, but can be named anything) to allow easier control and greater reproducibility. Settings are entered as `key: value` pairs as described below. The first sets of parameters control the image processing routine (cropping and padding) while the last set controls the age models. Most parameters are optional; if omitted, the default values presented below will be used. Required parameters are: +All user options are controlled using a config YAML file. A template file, called `configurations.yml`, is provided. **Make a copy of this file** rather than modify the the template. Settings are entered as `key: value` pairs as described below. The first sets of parameters control the image processing routine (cropping and padding) while the last set controls the age models. Most parameters are optional; if omitted, the default values presented below will be used. Required parameters are: * **Image processing:** `input_type`, `raw_image_path`, `processed_image_path` * **Image-only model:** `output_csv_file`, `processed_image_path` @@ -88,7 +88,7 @@ Note that specifying `model_pth_file` is not strictly required for running age m | `output_type` | Output image type. Defaults to ".jpg" and should not need to be changed. | | `pad` | Padding for top, left, and right sides of cropped image. Defined as a fraction of the original cropped image size. Bottom padding is controlled by `bottom_pad`. Default: 0.05 | | `processed_image_path` | Path to save the processed images. Best to include the full path in single quotations and to use a dedicated folder. Required. | -| `raw_image_path` | Path to raw images. Best to include the full path in single quotations. Example: 'G:/Shared drives/NMFS SEFSC FATES Advanced Technology/BIOLOGY_LIFE_HISTORY_DATA/2020_Plant_10/Raw_Images' Required for image processing. | +| `raw_image_path` | Path to raw images. Best to include the full path in single quotations. Example: `'G:/Shared drives/NMFS SEFSC FATES Advanced Technology/BIOLOGY_LIFE_HISTORY_DATA/2020_Plant_10/Raw_Images'` Required for image processing. | | `segment` | Scale segmentation method: "binary" for binary thresholding and "sam" for Segment Anything Model (SAM). Binary thresholding should work fine if images are high contrast with light scales on a dark background. SAM is more robust to variable image conditions but requires more processing time and a GPU. Default: "binary" | :Paths and general options {tbl-colwidths="[25,75]"} @@ -104,9 +104,9 @@ Note that specifying `model_pth_file` is not strictly required for running age m | | | |---------------------------|-------------------------------------------------| | `downsample` | Down-sample image size for input to SAM to reduce processing time. Default: 0.5 (*i.e.* reduce image dimensions to 50% of original size) | -| `points_per_side` | Number of points to use for automatic segmentation of scales with SAM. This should be adjusted based on size of object of interest with respect to the entire image. In general, you want number of points to be greater than the ratio of image size/object size for the smallest object of interest. Having too many points though could greatly increase processing time. Default: 8 | +| `points_per_side` | Number of points to use for automatic segmentation of scales with SAM. This should be adjusted based on size of object of interest with respect to the entire image. In general, you want number of points to be greater than the ratio of image size/object size for the smallest object of interest. Having too many points though could greatly increase processing time. Default: 16 | | `sam_model_type` | SAM model type. Options are "vit_b", "vit_l", and "vit_h" in order of increasing size. Default: "vit_b" | -| `sam_weights_path` | Path to SAM model weights. Make sure this matches the model type. Best to use the full path in quotations. Required when `segmment` is set to "sam". | +| `sam_weights_path` | Path to SAM model weights. Make sure this matches the model type. Best to use the full path in quotations. Required when `segment` is set to "sam". | | `stability_score_thresh` | Threshold for whether to include pixels in object mask. If the mask is too large, increase the score threshold and vice versa if the mask is too small. Default: 0.93 | :Segment Anything Model (SAM) parameters {tbl-colwidths="[25,75]"} @@ -122,7 +122,7 @@ The following options control the age inference model. They are entered into the | `fish_length_colname` | Data table column name in `metadata_csv_file` containing the sample length. Required for multimodal model only and ignored otherwise. | | `fish_weight_colname` | Data table column name in `metadata_csv_file` containing the sample weight. Required for multimodal model only and ignored otherwise. | | `metadata_csv_file` | Path and file name of a single CSV file containing the metadata for all images in `processed_image_path`. Best to include the full path in single quotations. Required for multimodal model only and ignored otherwise. | -| `model_pth_file` | Path to model weights (directory and file name of `pth` weights file). Best to include the full path in single quotations. **This parameter is not strictly required, but including it is strongly recommended for the sake of record keeping and reproducibility.** Defaults to `PROJECT_DIR/scripts/weights/image-model-v2025.pth` as the image-only model and `PROJECT_DIR/scripts/weights/multimodal-model-v2025.pth` as the multimodal model, where `PROJECT_DIR` is the parent level project directory [retrieved from GitHub](setup.qmd#clone-the-repository). | +| `model_pth_file` | Path to model weights (directory and file name of `pth` weights file). Best to include the full path in single quotations. **This parameter is not strictly required, but including it is strongly recommended for the sake of record keeping and reproducibility.** Defaults to `'PROJECT_DIR/scripts/weights/image-model-v2025.pth'` as the image-only model and `'PROJECT_DIR/scripts/weights/multimodal-model-v2025.pth'` as the multimodal model, where `PROJECT_DIR` is the parent level project directory [retrieved from GitHub](setup.qmd#clone-the-repository). | | `output_csv_file` | Directory and file name in which to save results. Output file must be a `csv` file. Best to include the full path in single quotations. Required for all ageing models. | :Configuration for age inference model {tbl-colwidths="[27,75]"} diff --git a/content/metadata.qmd b/content/metadata.qmd index aee2edb..16023d4 100644 --- a/content/metadata.qmd +++ b/content/metadata.qmd @@ -6,7 +6,7 @@ metadata-files: order: 4 --- -The multimodal ageing model integrates descriptive metadata for each fish with scale images to predict age. The current version of the model uses fish length, weight, and the month the fish was caught. These variables were found, through trial and error, to be the most helpful attributes for improving age predictions. The model requires this information be stored in a single CSV file with one entry per sample to be processed. This CSV file can be called anything, but for this discussion, we will call it `metadata.csv` for convenience. +The multimodal ageing model integrates descriptive metadata for each fish with scale images to predict age. The current version of the model uses fish length, weight, and the month of catch. These variables were found, through trial and error, to be the most helpful attributes for improving age predictions. The model requires this information be stored in a single CSV file with one entry per sample to be processed. This CSV file can be called anything, but for this discussion, we will call it `metadata.csv` for convenience. Consider three images of scales named `25123.jpg`, `25234.jpg`, and `25345.jpg`, stored in a single directory, for which ages are desired. The accompanying `metadata.csv` file would look like this: diff --git a/content/setup.qmd b/content/setup.qmd index ced9437..ba59458 100644 --- a/content/setup.qmd +++ b/content/setup.qmd @@ -10,7 +10,7 @@ order: 1 The instructions on this page only need to be carried out once. If you have already installed the required dependencies and created a virtual environment, skip ahead to [Using the Model](usage.qmd). ::: -Download and install Python [3.10](https://www.python.org/downloads/release/python-31011/) (recommended) or 3.9, if needed. If this is your first installation of Python on your workstation, check the "Add Python to PATH" box during echo installation. +Download and install Python [3.10](https://www.python.org/downloads/release/python-31011/) (recommended) or 3.9, if needed. If this is your first installation of Python on your workstation, check the "Add Python to PATH" box during the installation. ## Basic Users @@ -81,7 +81,7 @@ A Python virtual environment will automatically be created and configured the fi 1. Check the system for a compatible Python installation. If none is found, the user will be prompted to [install the appropriate version](#getting-started) and directed to the official Python distribution site. 2. Look for a project-specific Python virtual environment (called `.venv`) in the project parent folder. If one is found, it will be activated. Otherwise, one will be created and activated and the required Python packages will be installed in it from the provided `requirements.txt` file. This may take several minutes to complete but only needs to happen once. -::: {.callout-tip title=Windows path limits} +::: {.callout-tip title="Windows path limits"} If package installation fails, it may be due to [Windows path length limitations](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry). The most common culprit of this is PyTorch, which contains thousands of files within nested directories. Try relocating the downloaded or cloned project folder to a higher level directory on your machine. For example, if your project is currently in `C:\Users\user.name\Documents\models\menhaden\ageing\FATES-BLH-ScaleAgeing`, a path that itself contains more than 70 characters out of the allotted 250, consider moving it -- and renaming the project directory to, for example, `C:\Users\user.name\Documents\ageing`. Alternatively, the 250-character limit can be disabled with a Windows registry setting, but this will require administrator privileges.