Skip to content

Commit

Permalink
Merge branch 'f/bayer_transform_fix' into 'main'
Browse files Browse the repository at this point in the history
Minor bug fixes in ri_capsule

See merge request es/ai/hannah/hannah!412
  • Loading branch information
cgerum committed Oct 21, 2024
2 parents 0d56760 + 8d9c993 commit ba4488a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
5 changes: 3 additions & 2 deletions doc/applications/viterbi_decoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ For each combination of transition probabilities, the Viterbi Decoding is perfor
Below, for three patients exemplarily (one of each of the integrated datasets) the predictions of the CNN only vs the combinatorial approach of CNN and HMM/Viterbi decoding are visualized.

### Galar and Rhode Island dataset (VCE - images as input)
<img src="../assets/VCE_single_patient_Gal.png" alt="Single patient of Galar dataset" width="500"/> <img src="../assets/VCE_single_patient_RI.png" alt="Single patient of Rhode Island dataset" width="500"/>
<img src="/../assets/VCE_single_patient_Gal.png" alt="Single patient of Galar dataset" width="500"/> <img src="/../assets/VCE_single_patient_RI.png" alt="Single patient of Rhode Island dataset" width="500"/>

### CHBMIT dataset (EEG data as input)
<img src="../assets/CHBMIT_single_patient_HMM.png" alt="Single patient of EEG dataset" width="500"/>
<img src="/../assets/CHBMIT_single_patient_HMM.png" alt="Single patient of EEG dataset" width="500"/>



# References
Expand Down
32 changes: 17 additions & 15 deletions hannah/datasets/vision/ri_capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,24 @@ def splits(cls, config):
)
X_test, y_test, metadata_test = read_official_test(study_folder, DATA_PATH / "path_test.csv")

train_transform = A.Compose(
[
A.RandomCrop(config.sensor.resolution[0], config.sensor.resolution[1]),
A.Lambda(image=partial(rgb_to_bayer, pattern="RGGB")),
A.GaussNoise(),
ToTensorV2(),
]
)

test_transform = A.Compose(
[
A.CenterCrop(config.sensor.resolution[0], config.sensor.resolution[1]),
A.Lambda(image=partial(rgb_to_bayer, pattern="RGGB")),
ToTensorV2(),
]
)
train_transforms = [
A.RandomCrop(config.sensor.resolution[0], config.sensor.resolution[1]),
]
test_transforms = [
A.RandomCrop(config.sensor.resolution[0], config.sensor.resolution[1]),
]

if 'pattern' in config.sensor:
train_transforms.append(A.Lambda(image=partial(rgb_to_bayer, pattern=config.sensor.pattern)))
test_transforms.append(A.Lambda(image=partial(rgb_to_bayer, pattern=config.sensor.pattern)))

train_transforms.append(ToTensorV2())
test_transforms.append(ToTensorV2())

train_transform = A.Compose(train_transforms)
test_transform = A.Compose(test_transforms)


train_set = cls(
X_train, y_train, list(LABELS.keys()), transform=train_transform, metadata=metadata_train)
Expand Down
5 changes: 4 additions & 1 deletion pydoc-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ renderer:
- title: "Evaluation"
name: eval
source: doc/eval.md
- title: "Specific applications"
- title: "applications"
children:
- title: Seizure Detection
name: applications/seizure_detection
source: doc/applications/seizure_detection.md
- title: Viterbi Decoding
name: applications/viterbi_decoding
source: doc/applications/viterbi_decoding.md
- title: Development
children:
- title: Overview
Expand Down

0 comments on commit ba4488a

Please sign in to comment.