-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
3,935 additions
and
736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from deeptrack.datasets import ( | ||
detection_QuantumDots, | ||
segmentation_ssTEM_drosophila, | ||
regression_holography_nanoparticles, | ||
segmentation_fluorescence_u2os, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""detection_QuantumDots dataset.""" | ||
|
||
from .detection_QuantumDots import DetectionQuantumdots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
https://drive.google.com/file/d/1naaoxIaAU1F_rBaI-I1pB1K4Sp6pq_Jv/view?usp=sharing 67850 95f52b3bbfbf1b2fe7f213021fbd63bdf5040a4dc099ef6903243feb849f06c6 view | ||
https://drive.google.com/u/1/uc?id=1naaoxIaAU1F_rBaI-I1pB1K4Sp6pq_Jv&export=download 543855765 375476e7a70fa3c1a8f91f2e4035b896b8d8acb1800dae2e1e028c2db485a030 QuantumDots.zip |
24 changes: 24 additions & 0 deletions
24
deeptrack/datasets/detection_QuantumDots/detection_QuantomDuts_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""detection_QuantumDots dataset.""" | ||
|
||
import tensorflow_datasets as tfds | ||
from . import detection_QuantumDots | ||
|
||
|
||
class DetectionQuantumdotsTest(tfds.testing.DatasetBuilderTestCase): | ||
"""Tests for detection_QuantumDots dataset.""" | ||
# TODO(detection_QuantumDots): | ||
DATASET_CLASS = detection_QuantumDots.DetectionQuantumdots | ||
SPLITS = { | ||
'train': 3, # Number of fake train example | ||
'test': 1, # Number of fake test example | ||
} | ||
|
||
# If you are calling `download/download_and_extract` with a dict, like: | ||
# dl_manager.download({'some_key': 'http://a.org/out.txt', ...}) | ||
# then the tests needs to provide the fake output paths relative to the | ||
# fake data directory | ||
# DL_EXTRACT_RESULT = {'some_key': 'output_file1.txt', ...} | ||
|
||
|
||
if __name__ == '__main__': | ||
tfds.testing.test_main() |
69 changes: 69 additions & 0 deletions
69
deeptrack/datasets/detection_QuantumDots/detection_QuantumDots.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
"""detection_QuantumDots dataset.""" | ||
|
||
import tensorflow_datasets as tfds | ||
import tensorflow as tf | ||
import numpy as np | ||
|
||
# TODO(detection_QuantumDots): Markdown description that will appear on the catalog page. | ||
_DESCRIPTION = """ | ||
Sequential images of quantum dots in a fluorescent microscope. The dataset is unlabeled. | ||
""" | ||
|
||
# TODO(detection_QuantumDots): BibTeX citation | ||
_CITATION = """ | ||
""" | ||
|
||
|
||
class DetectionQuantumdots(tfds.core.GeneratorBasedBuilder): | ||
"""DatasetBuilder for detection_QuantumDots dataset.""" | ||
|
||
VERSION = tfds.core.Version("1.0.0") | ||
RELEASE_NOTES = { | ||
"1.0.0": "Initial release.", | ||
} | ||
|
||
def _info(self) -> tfds.core.DatasetInfo: | ||
"""Returns the dataset metadata.""" | ||
# TODO(detection_QuantumDots): Specifies the tfds.core.DatasetInfo object | ||
return tfds.core.DatasetInfo( | ||
builder=self, | ||
description=_DESCRIPTION, | ||
features=tfds.features.FeaturesDict( | ||
{ | ||
# These are the features of your dataset like images, labels ... | ||
"image": tfds.features.Image( | ||
shape=(1200, 1200, 1), | ||
dtype=tf.uint16, | ||
), | ||
} | ||
), | ||
# If there's a common (input, target) tuple from the | ||
# features, specify them here. They'll be used if | ||
# `as_supervised=True` in `builder.as_dataset`. | ||
supervised_keys=None, # Set to `None` to disable | ||
homepage="https://dataset-homepage/", | ||
citation=_CITATION, | ||
) | ||
|
||
def _split_generators(self, dl_manager: tfds.download.DownloadManager): | ||
"""Returns SplitGenerators.""" | ||
# TODO(detection_QuantumDots): Downloads the data and defines the splits | ||
path = dl_manager.download_and_extract( | ||
"https://drive.google.com/u/1/uc?id=1naaoxIaAU1F_rBaI-I1pB1K4Sp6pq_Jv&export=download" | ||
) | ||
|
||
# TODO(detection_QuantumDots): Returns the Dict[split names, Iterator[Key, Example]] | ||
return { | ||
"train": self._generate_examples(path / "QuantumDots"), | ||
} | ||
|
||
def _generate_examples(self, path): | ||
"""Yields examples.""" | ||
tifpath = path / "Qdots.tif" | ||
|
||
image_stack = tfds.core.lazy_imports.tifffile.imread(tifpath) | ||
image_stack = np.expand_dims(image_stack, axis=-1) | ||
for i, image in enumerate(image_stack): | ||
yield str(i), { | ||
"image": image, | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
deeptrack/datasets/regression_holography_nanoparticles/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""regression_holography_nanoparticles dataset.""" | ||
|
||
from .regression_holography_nanoparticles import RegressionHolographyNanoparticles |
3 changes: 3 additions & 0 deletions
3
deeptrack/datasets/regression_holography_nanoparticles/checksums.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# TODO(regression_holography_nanoparticles): If your dataset downloads files, then the checksums | ||
# will be automatically added here when running | ||
# `tfds build --register_checksums`. |
Empty file.
83 changes: 83 additions & 0 deletions
83
...track/datasets/regression_holography_nanoparticles/regression_holography_nanoparticles.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
"""regression_holography_nanoparticles dataset.""" | ||
|
||
import tensorflow_datasets as tfds | ||
import tensorflow as tf | ||
import numpy as np | ||
|
||
# TODO(regression_holography_nanoparticles): Markdown description that will appear on the catalog page. | ||
_DESCRIPTION = """ | ||
""" | ||
|
||
# TODO(regression_holography_nanoparticles): BibTeX citation | ||
_CITATION = """ | ||
""" | ||
|
||
|
||
class RegressionHolographyNanoparticles(tfds.core.GeneratorBasedBuilder): | ||
"""DatasetBuilder for regression_holography_nanoparticles dataset.""" | ||
|
||
VERSION = tfds.core.Version("1.0.0") | ||
RELEASE_NOTES = { | ||
"1.0.0": "Initial release.", | ||
} | ||
|
||
def _info(self) -> tfds.core.DatasetInfo: | ||
"""Returns the dataset metadata.""" | ||
# TODO(regression_holography_nanoparticles): Specifies the tfds.core.DatasetInfo object | ||
return tfds.core.DatasetInfo( | ||
builder=self, | ||
description=_DESCRIPTION, | ||
features=tfds.features.FeaturesDict( | ||
{ | ||
# These are the features of your dataset like images, labels ... | ||
"image": tfds.features.Tensor(shape=(64, 64, 2), dtype=tf.float64), | ||
"radius": tfds.features.Scalar(tf.float64), | ||
"refractive_index": tfds.features.Scalar(tf.float64), | ||
} | ||
), | ||
# If there's a common (input, target) tuple from the | ||
# features, specify them here. They'll be used if | ||
# `as_supervised=True` in `builder.as_dataset`. | ||
supervised_keys=( | ||
"image", | ||
"radius", | ||
"refractive_index", | ||
), # Set to `None` to disable | ||
homepage="https://dataset-homepage/", | ||
citation=_CITATION, | ||
) | ||
|
||
def _split_generators(self, dl_manager: tfds.download.DownloadManager): | ||
"""Returns SplitGenerators.""" | ||
# TODO(regression_holography_nanoparticles): Downloads the data and defines the splits | ||
path = dl_manager.download_and_extract( | ||
"https://drive.google.com/u/1/uc?id=1LJqWYmLj93WYLKaLm_yQFmiR1FZHhf1r&export=download" | ||
) | ||
|
||
# TODO(regression_holography_nanoparticles): Returns the Dict[split names, Iterator[Key, Example]] | ||
return { | ||
"train": self._generate_examples(path, "train"), | ||
"test": self._generate_examples(path, "test"), | ||
} | ||
|
||
def _generate_examples(self, path, split): | ||
"""Yields examples.""" | ||
# TODO(regression_holography_nanoparticles): Yields (key, example) tuples from the dataset | ||
|
||
if split == "train": | ||
data = np.load(path / "training_set.npy") | ||
radius = np.load(path / "training_radius.npy") | ||
refractive_index = np.load(path / "training_n.npy") | ||
elif split == "test": | ||
data = np.load(path / "validation_set.npy") | ||
radius = np.load(path / "validation_radius.npy") | ||
refractive_index = np.load(path / "validation_n.npy") | ||
else: | ||
raise ValueError("Split not recognized:", split) | ||
|
||
for idx in range(data.shape[0]): | ||
yield str(idx), { | ||
"image": data[idx], | ||
"radius": radius[idx], | ||
"refractive_index": refractive_index[idx], | ||
} |
24 changes: 24 additions & 0 deletions
24
.../datasets/regression_holography_nanoparticles/regression_holography_nanoparticles_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""regression_holography_nanoparticles dataset.""" | ||
|
||
import tensorflow_datasets as tfds | ||
from . import regression_holography_nanoparticles | ||
|
||
|
||
class RegressionHolographyNanoparticlesTest(tfds.testing.DatasetBuilderTestCase): | ||
"""Tests for regression_holography_nanoparticles dataset.""" | ||
# TODO(regression_holography_nanoparticles): | ||
DATASET_CLASS = regression_holography_nanoparticles.RegressionHolographyNanoparticles | ||
SPLITS = { | ||
'train': 3, # Number of fake train example | ||
'test': 1, # Number of fake test example | ||
} | ||
|
||
# If you are calling `download/download_and_extract` with a dict, like: | ||
# dl_manager.download({'some_key': 'http://a.org/out.txt', ...}) | ||
# then the tests needs to provide the fake output paths relative to the | ||
# fake data directory | ||
# DL_EXTRACT_RESULT = {'some_key': 'output_file1.txt', ...} | ||
|
||
|
||
if __name__ == '__main__': | ||
tfds.testing.test_main() |
3 changes: 3 additions & 0 deletions
3
deeptrack/datasets/segmentation_fluorescence_u2os/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""segmentation_fluorescence_u2os dataset.""" | ||
|
||
from .segmentation_fluorescence_u2os import SegmentationFluorescenceU2os |
3 changes: 3 additions & 0 deletions
3
deeptrack/datasets/segmentation_fluorescence_u2os/checksums.tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# TODO(segmentation_fluorescence_u2os): If your dataset downloads files, then the checksums | ||
# will be automatically added here when running | ||
# `tfds build --register_checksums`. |
Empty file.
Oops, something went wrong.