dsa-helpers 1.1.5.dev2__tar.gz → 1.1.5.dev4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dsa_helpers-1.1.5.dev2/dsa_helpers.egg-info → dsa_helpers-1.1.5.dev4}/PKG-INFO +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/__init__.py +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/datasets/SegFormerSegmentationDataset.py +4 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/datasets/utils.py +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/segformer_semantic_segmentation/train.py +11 -7
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4/dsa_helpers.egg-info}/PKG-INFO +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/pyproject.toml +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/.gitignore +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/.readthedocs.yaml +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/LICENSE +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/README.md +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/app.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dev.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/docs/requirements.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/docs/source/conf.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/docs/source/index.rst +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/cli_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/dash/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/dash/dash_paperdragon_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/dash/header.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/dash/header_callbacks.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/girder_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/gpd_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/image_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/imread.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/imwrite.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/callbacks.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/datasets/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/evaluate.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/metrics.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/object_detection/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/object_detection/get_pearce_roi_images.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/object_detection/tile_image.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/object_detection/utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/segformer_semantic_segmentation/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/segformer_semantic_segmentation/inference.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/transforms/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/transforms/segformer_transforms.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/mongo_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/tile_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/tiling.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers.egg-info/SOURCES.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers.egg-info/dependency_links.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers.egg-info/requires.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers.egg-info/top_level.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/setup.cfg +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/tests/app/Dockerfile +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/tests/app/app.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/tests/docker-compose.yaml +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/tests/test.ipynb +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dsa_helpers
|
|
3
|
-
Version: 1.1.5.
|
|
3
|
+
Version: 1.1.5.dev4
|
|
4
4
|
Summary: Utility functions for working with the DSA girder client.
|
|
5
5
|
Author-email: "Juan C. Vizcarra" <jvizcar@emory.edu>
|
|
6
6
|
Maintainer-email: "Juan C. Vizcarra" <jvizcar@emory.edu>
|
|
@@ -30,4 +30,7 @@ class SegFormerSegmentationDataset(Dataset):
|
|
|
30
30
|
mask_path = self.mask_files[idx]
|
|
31
31
|
|
|
32
32
|
# Return image & mask as PIL images in a dictionary.
|
|
33
|
-
return {
|
|
33
|
+
return {
|
|
34
|
+
"pixel_values": Image.open(image_path),
|
|
35
|
+
"label": Image.open(mask_path),
|
|
36
|
+
}
|
|
@@ -29,7 +29,7 @@ def create_segformer_segmentation_dataset(
|
|
|
29
29
|
if isinstance(df, str):
|
|
30
30
|
df = pd.read_csv(df, low_memory=low_memory)
|
|
31
31
|
|
|
32
|
-
dataset = SegFormerSegmentationDataset(df
|
|
32
|
+
dataset = SegFormerSegmentationDataset(df)
|
|
33
33
|
|
|
34
34
|
dataset = Dataset.from_generator(
|
|
35
35
|
generator=lambda: dataset_generator(dataset),
|
|
@@ -71,6 +71,7 @@ def train_segformer_semantic_segmentation_model(
|
|
|
71
71
|
will be used. Defaults to None. Note that there is a bug
|
|
72
72
|
that this value must be kept short otherwise a cuda memory
|
|
73
73
|
error will occur.
|
|
74
|
+
|
|
74
75
|
random_state (int, optional): Random state for the validation
|
|
75
76
|
split. Defaults to 42.
|
|
76
77
|
tile_size (int, optional): Size of the tiles to use for the model.
|
|
@@ -90,6 +91,9 @@ def train_segformer_semantic_segmentation_model(
|
|
|
90
91
|
if test_data is not None and isinstance(test_data, str):
|
|
91
92
|
test_data = pd.read_csv(test_data)
|
|
92
93
|
|
|
94
|
+
train_data_copy = train_data.copy()
|
|
95
|
+
val_data_copy = val_data.copy()
|
|
96
|
+
|
|
93
97
|
if device is None:
|
|
94
98
|
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
95
99
|
|
|
@@ -127,16 +131,16 @@ def train_segformer_semantic_segmentation_model(
|
|
|
127
131
|
|
|
128
132
|
# Create datasets for the model.
|
|
129
133
|
train_dataset = create_segformer_segmentation_dataset(
|
|
130
|
-
|
|
134
|
+
train_data_copy, transforms=train_transforms
|
|
131
135
|
)
|
|
132
136
|
|
|
133
137
|
val_dataset = create_segformer_segmentation_dataset(
|
|
134
138
|
(
|
|
135
|
-
|
|
139
|
+
val_data_copy
|
|
136
140
|
if max_val_size is None
|
|
137
|
-
else
|
|
141
|
+
else val_data_copy.sample(
|
|
138
142
|
n=max_val_size, random_state=random_state
|
|
139
|
-
)
|
|
143
|
+
)
|
|
140
144
|
),
|
|
141
145
|
transforms=val_transforms,
|
|
142
146
|
)
|
|
@@ -243,7 +247,7 @@ def train_segformer_semantic_segmentation_model(
|
|
|
243
247
|
model = trainer.model
|
|
244
248
|
|
|
245
249
|
dataset = create_segformer_segmentation_dataset(
|
|
246
|
-
train_data
|
|
250
|
+
train_data, transforms=val_transforms
|
|
247
251
|
)
|
|
248
252
|
results["train"]["metrics"] = per_class_dice_on_dataset(
|
|
249
253
|
model,
|
|
@@ -256,7 +260,7 @@ def train_segformer_semantic_segmentation_model(
|
|
|
256
260
|
)
|
|
257
261
|
|
|
258
262
|
dataset = create_segformer_segmentation_dataset(
|
|
259
|
-
val_data
|
|
263
|
+
val_data, transforms=val_transforms
|
|
260
264
|
)
|
|
261
265
|
results["val"]["metrics"] = per_class_dice_on_dataset(
|
|
262
266
|
model,
|
|
@@ -272,7 +276,7 @@ def train_segformer_semantic_segmentation_model(
|
|
|
272
276
|
results["test"] = {}
|
|
273
277
|
|
|
274
278
|
dataset = create_segformer_segmentation_dataset(
|
|
275
|
-
test_data
|
|
279
|
+
test_data, transforms=val_transforms
|
|
276
280
|
)
|
|
277
281
|
results["test"]["metrics"] = per_class_dice_on_dataset(
|
|
278
282
|
model,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dsa_helpers
|
|
3
|
-
Version: 1.1.5.
|
|
3
|
+
Version: 1.1.5.dev4
|
|
4
4
|
Summary: Utility functions for working with the DSA girder client.
|
|
5
5
|
Author-email: "Juan C. Vizcarra" <jvizcar@emory.edu>
|
|
6
6
|
Maintainer-email: "Juan C. Vizcarra" <jvizcar@emory.edu>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/dash/dash_paperdragon_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/object_detection/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/object_detection/tile_image.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev4}/dsa_helpers/ml/transforms/segformer_transforms.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|