Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Pin the ruff version: the action otherwise resolves to the latest
# release, so a new ruff can fail CI on unchanged code (0.16 began
# formatting fenced code blocks in Markdown).
- uses: astral-sh/ruff-action@v3
with:
version: "0.16.0"
args: "check"
src: "."
- uses: astral-sh/ruff-action@v3
with:
version: "0.16.0"
args: "format --check"
src: "."
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ pip install "git+https://github.com/esa/AnomalyMatch.git@v1.3.0"
You can view any saved session using:
```python
import anomaly_match as am
am.print_session('/path/to/session/directory')

am.print_session("/path/to/session/directory")
```

Session tracking is automatic and integrates seamlessly with existing workflows.
Expand Down Expand Up @@ -158,7 +159,7 @@ am.set_log_level("info", cfg)

# Run evaluation
session = am.Session(cfg)
session.load_model() # loads checkpoint and restores normalisation settings
session.load_model() # loads checkpoint and restores normalisation settings
session.evaluate_all_images(top_N=1000)
session.save_session()

Expand Down Expand Up @@ -242,11 +243,12 @@ pip install images_to_zarr
```python
# Convert a directory of images to 150x150 pixel zarr format
import images_to_zarr as i2z

i2z.convert(
output_dir="path/to/output.zarr",
folders="path/to/images",
resize=(150, 150),
chunk_shape=(1000, 4, 150, 150) # 1000 images per chunk
folders="path/to/images",
resize=(150, 150),
chunk_shape=(1000, 4, 150, 150), # 1000 images per chunk
)
```

Expand Down Expand Up @@ -350,11 +352,13 @@ import numpy as np

# 4 FITS extensions → 3 RGB output channels
cfg.normalisation.fits_extension = ["VIS", "NIR-H", "NIR-J", "NIR-Y"]
cfg.normalisation.channel_combination = np.array([
[1, 0, 0, 0], # R = VIS
[0, 0.5, 0.5, 0], # G = average of NIR-H and NIR-J
[0, 0, 0, 1], # B = NIR-Y
])
cfg.normalisation.channel_combination = np.array(
[
[1, 0, 0, 0], # R = VIS
[0, 0.5, 0.5, 0], # G = average of NIR-H and NIR-J
[0, 0, 0, 1], # B = NIR-Y
]
)
```

Each row defines one output channel as a weighted sum of the input extensions. `n_output_channels` is set to the number of rows in the matrix. When `channel_combination` is `None` (default), an identity matrix is created automatically for multi-extension configs.
Expand Down
13 changes: 8 additions & 5 deletions anomaly_match/image_processing/Normalisationreadme.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,14 @@ Each row of the array defines one output channel as a weighted sum of the input

```python
import numpy as np
cfg.normalisation.channel_combination = np.array([
[1, 0, 0, 0], # Channel 0 = extension 0
[0, 0.5, 0.5, 0], # Channel 1 = average of extensions 1 and 2
[0, 0, 0, 1], # Channel 2 = extension 3
])

cfg.normalisation.channel_combination = np.array(
[
[1, 0, 0, 0], # Channel 0 = extension 0
[0, 0.5, 0.5, 0], # Channel 1 = average of extensions 1 and 2
[0, 0, 0, 1], # Channel 2 = extension 3
]
)
```

## Normalisation settings (optional)
Expand Down
6 changes: 3 additions & 3 deletions paper_scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ You will now need to copy the input image files from the galaxyzoo dataset manua
2. **Configure experiments** in `create_results.py` by setting the appropriate flags:
```python
# Toggle which experiment sets to run
RUN_MINIIMAGENET = True # MiniImageNet experiments
RUN_GALAXYMNIST = True # GalaxyMNIST experiments
RUN_MINIIMAGENET = True # MiniImageNet experiments
RUN_GALAXYMNIST = True # GalaxyMNIST experiments
RUN_TRAINING_ITERATIONS_STUDY = True # Different training iterations
RUN_ACTIVE_LEARNING_ABLATION = True # With/without active learning
RUN_ACTIVE_LEARNING_ABLATION = True # With/without active learning
RUN_N_SAMPLES_ABLATION = True # Ablation study with varying sample sizes
```

Expand Down
Loading