Skip to content

Commit

Permalink
Create a core submodule (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioangatop authored Mar 18, 2024
1 parent dbcbb94 commit 879b51e
Show file tree
Hide file tree
Showing 153 changed files with 389 additions and 306 deletions.
6 changes: 3 additions & 3 deletions configs/core/tests/offline/embeddings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: ${oc.env:TESTS_ROOT, tests/eva}/assets/core/datasets/embeddings
manifest_file: manifest.csv
split: train
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
test:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: test
Expand Down
6 changes: 3 additions & 3 deletions configs/vision/dino_vit/offline/bach.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trainer:
0: train
1: val
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down Expand Up @@ -74,13 +74,13 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *DATASET_EMBEDDINGS_ROOT
manifest_file: manifest.csv
split: train
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
Expand Down
6 changes: 3 additions & 3 deletions configs/vision/dino_vit/offline/crc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trainer:
0: train
1: val
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down Expand Up @@ -74,13 +74,13 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *DATASET_EMBEDDINGS_ROOT
manifest_file: manifest.csv
split: train
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
Expand Down
8 changes: 4 additions & 4 deletions configs/vision/dino_vit/offline/mhist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trainer:
0: train
1: test
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down Expand Up @@ -72,15 +72,15 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *DATASET_EMBEDDINGS_ROOT
manifest_file: manifest.csv
split: train
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: test
Expand Down
10 changes: 5 additions & 5 deletions configs/vision/dino_vit/offline/patch_camelyon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trainer:
1: val
2: test
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down Expand Up @@ -73,20 +73,20 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *DATASET_EMBEDDINGS_ROOT
manifest_file: manifest.csv
split: train
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
test:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: test
Expand Down
2 changes: 1 addition & 1 deletion configs/vision/dino_vit/online/bach.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ model:
class_path: eva.HeadModule
init_args:
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down
2 changes: 1 addition & 1 deletion configs/vision/dino_vit/online/crc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ model:
class_path: eva.HeadModule
init_args:
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down
4 changes: 2 additions & 2 deletions configs/vision/dino_vit/online/mhist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ model:
class_path: eva.HeadModule
init_args:
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down Expand Up @@ -76,7 +76,7 @@ data:
mean: ${oc.env:NORMALIZE_MEAN, [0.485, 0.456, 0.406]}
std: ${oc.env:NORMALIZE_STD, [0.229, 0.224, 0.225]}
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.vision.datasets.MHIST
init_args:
Expand Down
4 changes: 2 additions & 2 deletions configs/vision/dino_vit/online/patch_camelyon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ model:
class_path: eva.HeadModule
init_args:
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.models.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down Expand Up @@ -81,7 +81,7 @@ data:
mean: ${oc.env:NORMALIZE_MEAN, [0.485, 0.456, 0.406]}
std: ${oc.env:NORMALIZE_STD, [0.229, 0.224, 0.225]}
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.vision.datasets.PatchCamelyon
init_args:
Expand Down
8 changes: 4 additions & 4 deletions configs/vision/owkin/phikon/offline/bach.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ trainer:
0: train
1: val
backbone:
class_path: eva.models.networks.wrappers.HuggingFaceModel
class_path: eva.models.HuggingFaceModel
init_args:
model_name_or_path: owkin/phikon
tensor_transforms:
class_path: eva.models.networks.transforms.ExtractCLSFeatures
class_path: eva.core.models.networks.transforms.ExtractCLSFeatures
logger:
- class_path: pytorch_lightning.loggers.TensorBoardLogger
init_args:
Expand Down Expand Up @@ -70,15 +70,15 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *EMBEDDINGS_DIR
manifest_file: manifest.csv
split: train
column_mapping:
path: embedding
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
Expand Down
8 changes: 4 additions & 4 deletions configs/vision/owkin/phikon/offline/crc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ trainer:
0: train
1: val
backbone:
class_path: eva.models.networks.wrappers.HuggingFaceModel
class_path: eva.models.HuggingFaceModel
init_args:
model_name_or_path: owkin/phikon
tensor_transforms:
class_path: eva.models.networks.transforms.ExtractCLSFeatures
class_path: eva.core.models.networks.transforms.ExtractCLSFeatures
logger:
- class_path: pytorch_lightning.loggers.TensorBoardLogger
init_args:
Expand Down Expand Up @@ -70,15 +70,15 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *EMBEDDINGS_DIR
manifest_file: manifest.csv
split: train
column_mapping:
path: embedding
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
Expand Down
10 changes: 5 additions & 5 deletions configs/vision/owkin/phikon/offline/mhist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ trainer:
0: train
1: test
backbone:
class_path: eva.models.networks.wrappers.HuggingFaceModel
class_path: eva.models.HuggingFaceModel
init_args:
model_name_or_path: owkin/phikon
tensor_transforms:
class_path: eva.models.networks.transforms.ExtractCLSFeatures
class_path: eva.core.models.networks.transforms.ExtractCLSFeatures
logger:
- class_path: pytorch_lightning.loggers.TensorBoardLogger
init_args:
Expand Down Expand Up @@ -68,17 +68,17 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *EMBEDDINGS_DIR
manifest_file: manifest.csv
split: train
column_mapping:
path: embedding
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: test
Expand Down
12 changes: 6 additions & 6 deletions configs/vision/owkin/phikon/offline/patch_camelyon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ trainer:
1: val
2: test
backbone:
class_path: eva.models.networks.wrappers.HuggingFaceModel
class_path: eva.models.HuggingFaceModel
init_args:
model_name_or_path: owkin/phikon
tensor_transforms:
class_path: eva.models.networks.transforms.ExtractCLSFeatures
class_path: eva.core.models.networks.transforms.ExtractCLSFeatures
logger:
- class_path: pytorch_lightning.loggers.TensorBoardLogger
init_args:
Expand Down Expand Up @@ -69,22 +69,22 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *EMBEDDINGS_DIR
manifest_file: manifest.csv
split: train
column_mapping:
path: embedding
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
test:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: test
Expand Down
8 changes: 4 additions & 4 deletions configs/vision/tests/offline/patch_camelyon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trainer:
1: val
2: test
backbone:
class_path: eva.models.networks.wrappers.ModelFromFunction
class_path: eva.core.models.networks.wrappers.ModelFromFunction
init_args:
path: torch.hub.load
arguments:
Expand Down Expand Up @@ -65,15 +65,15 @@ data:
init_args:
datasets:
train:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args: &DATASET_ARGS
root: *DATASET_EMBEDDINGS_ROOT
manifest_file: manifest.csv
split: train
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.data.datasets.classification.EmbeddingsDataset
class_path: eva.datasets.EmbeddingsClassificationDataset
init_args:
<<: *DATASET_ARGS
split: val
Expand Down
2 changes: 1 addition & 1 deletion configs/vision/tests/online/patch_camelyon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ data:
mean: ${oc.env:NORMALIZE_MEAN, [0.485, 0.456, 0.406]}
std: ${oc.env:NORMALIZE_STD, [0.229, 0.224, 0.225]}
target_transforms:
class_path: eva.vision.data.transforms.common.ArrayToFloatTensor
class_path: eva.core.data.transforms.ArrayToFloatTensor
val:
class_path: eva.vision.datasets.PatchCamelyon
init_args:
Expand Down
Loading

0 comments on commit 879b51e

Please sign in to comment.