Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test coverage imporovement #218

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9c352aa
changed paths in configs
Jan 10, 2024
073f5c1
fix albumentations test
Jan 10, 2024
0fc3b94
added tests for datamodules
Jan 10, 2024
829cf20
added classification lighting module
Jan 22, 2024
a57af2e
adding CT_hemorrhage_contrast preprocessing test
Jan 22, 2024
c5f51f7
adding lighting_modules tests for biobert and chemistry_vae
Jan 24, 2024
66659e1
fixed model call bug
Jan 24, 2024
3eed746
added dicom segmentation lightning modul test and test data
Jan 29, 2024
3bde0c6
added test for onvif stream
Feb 6, 2024
49fffa9
added test for old pipline datasets and fixed bugs
Feb 9, 2024
284566a
dolg tests
QazyBi Feb 9, 2024
333f2f0
removed some tests
QazyBi Feb 14, 2024
ab41add
skip biobert test
QazyBi Feb 14, 2024
a8123c1
added yamls
QazyBi Feb 14, 2024
030ebfc
added tests and data for old pipline
Feb 14, 2024
9604556
fixed bugs in tests
QazyBi Feb 14, 2024
4067fe2
base learner tests commented
QazyBi Feb 16, 2024
8416888
added import
QazyBi Feb 16, 2024
a290a53
changed input dimentions. NOTICE! Test doesnt work for channel first …
QazyBi Feb 21, 2024
6bb5167
Merge branch 'main' into test_coverage
LoaferCH Feb 21, 2024
9b5abc3
deleted old pipline scheduler
Feb 21, 2024
7701353
tests
QazyBi Feb 28, 2024
a02047d
fix
QazyBi Feb 28, 2024
17d8f4a
fix
QazyBi Feb 28, 2024
45c1efc
redundant code refactoring
KGallyamov Mar 4, 2024
2dd3c3d
fixed config bugs
Mar 5, 2024
953f873
added tests for old pipline losses
Mar 5, 2024
2f73c0c
added onvif camera mover test
Mar 5, 2024
69aed4e
error fix in refactoring
KGallyamov Mar 5, 2024
7499214
chenged existed tests to increase test coverage
Mar 13, 2024
4117df3
refactor resource-intensive tests
KGallyamov Mar 20, 2024
04aae00
temporary solution for space occupation reduction
KGallyamov Mar 21, 2024
cad1af3
temporary solution for space occupation reduction
KGallyamov Mar 22, 2024
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
9 changes: 9 additions & 0 deletions config/augmentations_test/linear-roads-bin-seg-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defaults:
- /augmentations/preprocessing:
- standard_images
- /augmentations/combined:
- none
- /augmentations/position:
- none
- /augmentations/color:
- /augmentations/postprocessing:
15 changes: 15 additions & 0 deletions config/augmentations_train/linear-roads-bin-seg-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
defaults:
- /augmentations/preprocessing:
- standard_images
- /augmentations/combined:
- none
- /augmentations/position:
- flip
- rotate90
- transpose
- grid_distortion
- /augmentations/color:
- random_gamma
- blur
- /augmentations/postprocessing:
- to_tensor
9 changes: 9 additions & 0 deletions config/augmentations_val/linear-roads-bin-seg-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defaults:
- /augmentations/preprocessing:
- standard_images
- /augmentations/combined:
- none
- /augmentations/position:
- none
- /augmentations/color:
- /augmentations/postprocessing:
1 change: 1 addition & 0 deletions config/datasets/regression/table_regression.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_target_: innofw.core.datamodules.pandas_datamodules.RegressionPandasDataModule
target_col: Index
train:
source: tests/data/tabular/bmi/bmi_prep.csv
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_target_: innofw.core.datamodules.lightning_datamodules.segmentation_dir.DirSegmentationLightningDataModule
task:
- image-segmentation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_target_: innofw.core.datamodules.lightning_datamodules.segmentation_dir.DicomDirSegmentationLightningDataModule
task:
- image-segmentation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_target_: innofw.core.datamodules.lightning_datamodules.HDF5LightningDataModule
task:
- image-segmentation

Expand Down
2 changes: 1 addition & 1 deletion config/datasets/token_classification_drugprot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
task:
task:
- text-ner

name: Drugprot
Expand Down
1 change: 1 addition & 0 deletions config/datasets/water_erosion_segmentation.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_target_: innofw.core.datamodules.lightning_datamodules.semantic_segmentation.tiff.SegmentationDM
task:
- image-segmentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ models:
project: "ucmerced_classification"
task: "image-classification"
random_seed: 42
original_work_dir: ${hydra:runtime.cwd}
# original_work_dir: ${hydra:runtime.cwd}
weights_freq: 1
batch_size: 256
epochs: 30
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# @package _global_
defaults:
- /datasets@_dataset_dict.classification_mnist1: classification/classification_mnist
- /datasets@_dataset_dict.classification_mnist2: classification/classification_mnist
- override /models: resnet.yaml
# - /datasets@_dataset_dict.classification_mnist1: classification/classification_mnist
# - /datasets@_dataset_dict.classification_mnist2: classification/classification_mnist
- override /datasets: classification/classification_mnist
- override /models: classification/resnet.yaml
- override /augmentations_train: none #classification.yaml
- override /augmentations_val: none
- override /augmentations_test: none
Expand All @@ -12,7 +13,7 @@ defaults:
project: "mnist_classification"
task: "image-classification"
random_seed: 42
original_work_dir: ${hydra:runtime.cwd}
# original_work_dir: ${hydra:runtime.cwd}
weights_freq: 1
batch_size: 8
stop_param: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:
project: "mnist_classification"
task: "image-classification"
random_seed: 42
original_work_dir: ${hydra:runtime.cwd}
# original_work_dir: ${hydra:runtime.cwd}
weights_freq: 1
batch_size: 8
stop_param: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @package _global_
defaults:
- override /models: linear_regression
- override /models: regression/linear_regression
- override /datasets: osl_faces


Expand Down
3 changes: 2 additions & 1 deletion config/experiments/detection/KA_120722_8adfcdaa_yolov5.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# @package _global_
batch_size: 32
defaults:
- override /models: detection/yolov5
- override /datasets: detection_lep
- override /optimizers: sgd
- override /models: detection/yolov5x.yaml

epochs: 500
project: lep
random_seed: 42
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
batch_size: 2
ckpt_path: /home/qazybek/pmi_tatneft/innofw/dui/logs/something/20240122-082640/weights/best.pt
defaults:
- override /models: detection/yolov5
- override /datasets: detection_lep.yaml
- override /initializations: random
epochs: 5
project: lep
- override /models: detection/yolov5
- override /datasets: detection_lep
- override /initializations: random

project: "lep"
task: "image-detection"

random_seed: 42
task: image-detection
weights_freq: 1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_
defaults:
- override /models: detection/yolov5
- override /datasets: detection/lep
- override /datasets: detection_lep


project: "lep"
Expand Down
2 changes: 1 addition & 1 deletion config/experiments/detection/KG_190124_wpiig1_ttpla.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_
defaults:
- override /models: detection/yolov5
- override /datasets: detection/detection_ttpla
- override /datasets: detection/ttpla
- override /optimizers: sgd

project: "ttpla"
Expand Down
3 changes: 2 additions & 1 deletion config/experiments/detection/NP_210523_yolov8_insects.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @package _global_
defaults:
- override /models: ultralytics
# - override /models: ultralytics
- override /models: detection/yolov8
- override /datasets: detection/detection_ar_tax_or
- override /loggers: wandb
- override /optimizers: sgd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ defaults:
project: "mcl1"
task: "qsar-regression"
random_seed: 42
original_work_dir: ${hydra:runtime.cwd}
# original_work_dir: ${hydra:runtime.cwd}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# @package _global_
defaults:
- override /datasets: regression_house_prices
- override /datasets: regression/regression_house_prices
- override /models: regression/linear_regression

project: "check_defaults"
task: "table-regression"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_
defaults:
- override /models: regression/catboost_regression
- override /datasets: regression_house_prices
- override /datasets: regression/regression_house_prices
# - override /callbacks: regression


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @package _global_
defaults:
- override /models: regression/linear_regression
- override /datasets: regression_house_prices
- override /datasets: regression/regression_house_prices

project: "house_prices"
ckpt_path:
Expand Down
14 changes: 6 additions & 8 deletions config/experiments/semantic-segmentation/AS_151123_oks.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# @package _global_
accelerator: gpu
batch_size: 20
datasets:
- batch_size: 20
- num_workers: 42
defaults:
- override /models: semantic-segmentation/deeplabv3plus
- override /datasets: semantic-segmentation/oks_151123
Expand All @@ -13,11 +11,11 @@ defaults:
devices: 1
epochs: 1
models:
- in_channels: 3
- classes: 1
- encoder_name: resnet101
- encoder_depth: 5
- decoder_channels: 256
in_channels: 3
classes: 1
encoder_name: resnet101
encoder_depth: 5
decoder_channels: 256
num_workers: 42
project: oks
random_seed: 42
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ weights_freq: 1
batch_size: 16
epochs: 50
accelerator: gpu
gpus: [2]
gpus: 2 #[2]
models:
in_channels: 4
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ accelerator: gpu
random_seed: 42
epochs: 50
batch_size: 64
original_work_dir: ${hydra:runtime.cwd}
# original_work_dir: ${hydra:runtime.cwd}
weights_freq: 1
override hydra/job_logging: stdout
metrics:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# @package _global_
defaults:
- override /models: semantic-segmentation/deeplabv3plus.yaml
- override /datasets: segmentation_arable_full.yaml
- override /datasets: semantic-segmentation/segmentation_arable_full.yaml
- override /optimizers: adam.yaml
- override /losses: segmentation_losses # triple_segmentation_loss
- override /augmentations: segmentation_satellite_imagery
- override /augmentations_train: none #segmentation_satellite_imagery
# - override /initializations: he
- override /callbacks: segmentation_2
- override /wandb: qb
- override /wandb: default

optimizers:
implementations:
Expand All @@ -24,8 +24,7 @@ models:

accelerator: gpu
devices: 1
gpus:
- 1 # use second gpu
gpus: 1 # use second gpu


wandb:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @package _global_
defaults:
- override /models: semantic-segmentation/yolov5_segmentation
- override /models: detection/yolov5_segmentation
- override /datasets: detection/detection_lungs


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defaults:
- override /datasets: semantic-segmentation/landslides-kanopus/270223-hdf5
- override /losses: semantic-segmentation/triple_loss_old_pipe
- override /optimizers: adam
- override /schedulers: custom_old_pipeline
- override /schedulers: cosine_annealing
- override /augmentations_train: landslides-kanopus
- override /augmentations_val: landslides-kanopus
# - override /metrics: basic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# @package _global_
defaults:
- _self_
- override /models: semantic-segmentationdeeplabv3plus
- override /models: semantic-segmentation/deeplabv3plus
- override /datasets: semantic-segmentation/water-erosion-kanopus/220223-hdf5
- override /losses: semantic-segmentation/triple_loss_old_pipe
- override /optimizers: adam
- override /schedulers: custom_old_pipeline
- override /schedulers: cosine_annealing
- override /augmentations_train: water-erosion-bin-seg
- override /augmentations_val: water-erosion-bin-seg
# - override /metrics: basic
Expand Down
15 changes: 0 additions & 15 deletions config/schedulers/custom.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions config/schedulers/custom_old_pipeline.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion config/ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ accelerator: gpu
#devices: 1
gpus: 1

original_work_dir: ${hydra:runtime.cwd}
# original_work_dir: ${hydra:runtime.cwd}
2 changes: 1 addition & 1 deletion examples/infer_contrasting_ct_dicom_brain.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python3 /innofw/utils/data_utils/preprocessing/CT_hemorrhage_contrast.py
python3 ./innofw/utils/data_utils/preprocessing/CT_hemorrhage_contrast.py
14 changes: 8 additions & 6 deletions innofw/core/active_learning/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import numpy as np
import pandas as pd
from abc import abstractmethod



class DataContainer(TypedDict):
Expand Down Expand Up @@ -34,14 +36,14 @@ class DataModuleI(Protocol):
setup():
returns Nothing.
"""

def test_dataloader(self) -> DataContainer:
@abstractmethod
def test_dataloader(self) -> DataContainer: # pragma: no cover
...

def train_dataloader(self) -> DataContainer:
@abstractmethod
def train_dataloader(self) -> DataContainer: # pragma: no cover
...

def setup(self) -> None:
@abstractmethod
def setup(self) -> None: # pragma: no cover
...


Expand Down
Loading
Loading