dsa-helpers 1.1.5.dev2__tar.gz → 1.1.5.dev3__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.dev3}/PKG-INFO +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/__init__.py +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/datasets/SegFormerSegmentationDataset.py +5 -2
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/datasets/utils.py +3 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/segformer_semantic_segmentation/train.py +9 -8
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3/dsa_helpers.egg-info}/PKG-INFO +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/pyproject.toml +1 -1
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/.gitignore +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/.readthedocs.yaml +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/LICENSE +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/README.md +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/app.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dev.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/docs/requirements.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/docs/source/conf.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/docs/source/index.rst +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/cli_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/dash/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/dash/dash_paperdragon_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/dash/header.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/dash/header_callbacks.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/girder_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/gpd_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/image_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/imread.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/imwrite.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/callbacks.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/datasets/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/evaluate.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/metrics.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/object_detection/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/object_detection/get_pearce_roi_images.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/object_detection/tile_image.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/object_detection/utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/segformer_semantic_segmentation/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/segformer_semantic_segmentation/inference.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/transforms/__init__.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/ml/transforms/segformer_transforms.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/mongo_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/tile_utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/tiling.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers/utils.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers.egg-info/SOURCES.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers.egg-info/dependency_links.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers.egg-info/requires.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/dsa_helpers.egg-info/top_level.txt +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/setup.cfg +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/tests/app/Dockerfile +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/tests/app/app.py +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/tests/docker-compose.yaml +0 -0
- {dsa_helpers-1.1.5.dev2 → dsa_helpers-1.1.5.dev3}/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.dev3
|
|
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>
|
|
@@ -19,7 +19,7 @@ class SegFormerSegmentationDataset(Dataset):
|
|
|
19
19
|
"""
|
|
20
20
|
self.image_files = df["fp"].tolist()
|
|
21
21
|
self.mask_files = df["mask_fp"].tolist()
|
|
22
|
-
self.df = df # store potential metadata
|
|
22
|
+
self.df = df.copy() # store potential metadata
|
|
23
23
|
|
|
24
24
|
def __len__(self):
|
|
25
25
|
return len(self.image_files)
|
|
@@ -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
|
+
}
|
|
@@ -28,8 +28,10 @@ def create_segformer_segmentation_dataset(
|
|
|
28
28
|
"""
|
|
29
29
|
if isinstance(df, str):
|
|
30
30
|
df = pd.read_csv(df, low_memory=low_memory)
|
|
31
|
+
else:
|
|
32
|
+
df = df.copy()
|
|
31
33
|
|
|
32
|
-
dataset = SegFormerSegmentationDataset(df
|
|
34
|
+
dataset = SegFormerSegmentationDataset(df)
|
|
33
35
|
|
|
34
36
|
dataset = Dataset.from_generator(
|
|
35
37
|
generator=lambda: dataset_generator(dataset),
|
|
@@ -127,16 +127,14 @@ def train_segformer_semantic_segmentation_model(
|
|
|
127
127
|
|
|
128
128
|
# Create datasets for the model.
|
|
129
129
|
train_dataset = create_segformer_segmentation_dataset(
|
|
130
|
-
train_data
|
|
130
|
+
train_data, transforms=train_transforms
|
|
131
131
|
)
|
|
132
132
|
|
|
133
133
|
val_dataset = create_segformer_segmentation_dataset(
|
|
134
134
|
(
|
|
135
|
-
val_data
|
|
135
|
+
val_data
|
|
136
136
|
if max_val_size is None
|
|
137
|
-
else val_data.sample(
|
|
138
|
-
n=max_val_size, random_state=random_state
|
|
139
|
-
).copy()
|
|
137
|
+
else val_data.sample(n=max_val_size, random_state=random_state)
|
|
140
138
|
),
|
|
141
139
|
transforms=val_transforms,
|
|
142
140
|
)
|
|
@@ -242,8 +240,11 @@ def train_segformer_semantic_segmentation_model(
|
|
|
242
240
|
# For each of the datasets provided, get the metrics.
|
|
243
241
|
model = trainer.model
|
|
244
242
|
|
|
243
|
+
del train_dataset
|
|
244
|
+
del val_dataset
|
|
245
|
+
|
|
245
246
|
dataset = create_segformer_segmentation_dataset(
|
|
246
|
-
train_data
|
|
247
|
+
train_data, transforms=val_transforms
|
|
247
248
|
)
|
|
248
249
|
results["train"]["metrics"] = per_class_dice_on_dataset(
|
|
249
250
|
model,
|
|
@@ -256,7 +257,7 @@ def train_segformer_semantic_segmentation_model(
|
|
|
256
257
|
)
|
|
257
258
|
|
|
258
259
|
dataset = create_segformer_segmentation_dataset(
|
|
259
|
-
val_data
|
|
260
|
+
val_data, transforms=val_transforms
|
|
260
261
|
)
|
|
261
262
|
results["val"]["metrics"] = per_class_dice_on_dataset(
|
|
262
263
|
model,
|
|
@@ -272,7 +273,7 @@ def train_segformer_semantic_segmentation_model(
|
|
|
272
273
|
results["test"] = {}
|
|
273
274
|
|
|
274
275
|
dataset = create_segformer_segmentation_dataset(
|
|
275
|
-
test_data
|
|
276
|
+
test_data, transforms=val_transforms
|
|
276
277
|
)
|
|
277
278
|
results["test"]["metrics"] = per_class_dice_on_dataset(
|
|
278
279
|
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.dev3
|
|
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.dev3}/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.dev3}/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.dev3}/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.dev3}/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
|