Skip to content

Commit 59c92c1

Browse files
authored
Merge pull request #20 from wli51/dev-fix-multi-gpu-update-trainer
PR integrating engine into new trainers and finalizing the multi-gpu fix
2 parents edf5e19 + c34ce22 commit 59c92c1

22 files changed

+1757
-1503
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
---
99

10+
## [0.4.2] - 2025-11-17
11+
12+
### Added
13+
14+
#### training infrastructure (`virtual_stain_flow/engine/...`)
15+
- Abstract away the forward pass and multiple loss accumulation from trainers
16+
#### logging trainer (`virutal_stain_flow/trainers/logging_trainer.py`)
17+
- New logging trainer for single generator model training using `engine`
18+
19+
### Refactors
20+
21+
#### abstract trainer (`virutal_stain_flow/trainers/AbstractTrainer.py`)
22+
- Add progress bar
23+
24+
### Removes
25+
26+
#### Obselete trainer classes (`virutal_stain_flow/trainers/logging_trainers/...`)
27+
28+
---
29+
1030
## [0.4.1] - 2025-10-16
1131

1232
### Added

examples/0.download_data.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
"""
2+
Download JUMP pilot plate data from AWS S3 bucket.
3+
4+
This script downloads high-resolution cell imaging data from the JUMP (JCP
5+
Understanding Morphology & Plasticity) public dataset. The data includes
6+
multiple channels of brightfield and fluorescence microscopy images.
7+
8+
Data Source:
9+
S3 bucket: s3://cellpainting-gallery/cpg0000-jump-pilot/
10+
Access: Public (no AWS credentials required with --no-sign-request)
11+
Reference: https://github.com/jump-cellpainting/2024_Chandrasekaran_NatureMethods_CPJUMP1
12+
13+
Defaults:
14+
Batch: 2020_11_04_CPJUMP1
15+
Plate: BR00117010__2020-11-08T18_18_00-Measurement1
16+
Output: ./jump_pilot_subset/
17+
18+
Usage:
19+
# Download with defaults
20+
python 0.download_data.py
21+
22+
# Download to custom directory
23+
python 0.download_data.py --outdir /path/to/data
24+
25+
# Download different plate
26+
python 0.download_data.py --batch 2020_11_04_CPJUMP1 --plate PLATE_ID
27+
28+
Requirements:
29+
- AWS CLI installed: https://aws.amazon.com/cli/
30+
- Internet connection
31+
- Sufficient disk space (~10GB for full plate)
32+
33+
Note: Initial download may take minutes to hours depending on internet speed.
34+
"""
35+
36+
import subprocess
37+
from pathlib import Path
38+
39+
BASE = "s3://cellpainting-gallery/cpg0000-jump-pilot/source_4/images"
40+
41+
def download_jump_plate(batch, plate, outdir="jump_pilot_subset"):
42+
out = Path(outdir) / batch / plate
43+
out.mkdir(parents=True, exist_ok=True)
44+
45+
s3_prefix = f"{BASE}/{batch}/images/{plate}/Images/"
46+
print("Downloading from:", s3_prefix)
47+
48+
subprocess.run(
49+
[
50+
"aws", "s3", "cp", "--recursive",
51+
s3_prefix, str(out),
52+
"--no-sign-request",
53+
],
54+
check=True,
55+
)
56+
57+
58+
def main():
59+
import argparse
60+
parser = argparse.ArgumentParser(
61+
description="Download JUMP pilot plate data from AWS S3",
62+
formatter_class=argparse.RawDescriptionHelpFormatter,
63+
epilog="""
64+
Examples:
65+
python 0.download_data.py
66+
python 0.download_data.py --outdir ~/data/jump
67+
python 0.download_data.py --batch 2020_11_04_CPJUMP1 --plate BR00117010__2020-11-08T18_18_00-Measurement1
68+
"""
69+
)
70+
parser.add_argument(
71+
"--batch",
72+
type=str,
73+
default='2020_11_04_CPJUMP1',
74+
help="JUMP batch ID (default: 2020_11_04_CPJUMP1)"
75+
)
76+
parser.add_argument(
77+
"--plate",
78+
type=str,
79+
default='BR00117010__2020-11-08T18_18_00-Measurement1',
80+
help="Plate ID within batch (default: BR00117010__2020-11-08T18_18_00-Measurement1)"
81+
)
82+
parser.add_argument(
83+
"--outdir",
84+
type=str,
85+
default="jump_pilot_subset",
86+
help="Output directory for downloaded data (default: ./jump_pilot_subset)"
87+
)
88+
args = parser.parse_args()
89+
download_jump_plate(args.batch, args.plate, outdir=args.outdir)
90+
91+
92+
if __name__ == "__main__":
93+
main()

0 commit comments

Comments
 (0)