Skip to content

Commit cd5f06b

Browse files
giovannivolpeBenjaminMidtvedtgithub-actions[bot]JesusPinedaCHenrik-KM
authored
Release 1.5.2 (#164)
* chore: autopublish 2022-07-26T13:54:44Z * Remove create-badges job * Delete test.py * Add multi-head masked attention * Update multi-head gated attention to match parent layer * Update documentation * Test multi-head masked attention * allow gated attention layers to use bias * test bias in gated attention layers * set return_attention_weights to False to avoid multi-outputs Use MultiHeadSelfAttention and MultiHeadGatedSelfAttention if want to return the attention weights * reformat gnns/layers.py This commit adds new message-passing graph layers (MPN) and graph convolutional layers to dt, including vanilla MPN, GRUMPN, Masked-attention FGNN, and GraphTransformer. * Update layers.py * Update test_layers.py * Update models.py * Update test_models.py * Update test_models.py * Fix indexing problems related to tf.gather * Allow multi-inputs in ContinuousGenerator * Fix bad conversion to integer * version bump * Fix phase correction at focus and offset calculation * Fix phase correction in propagation * Fix mie phase out of foucs * Fix mie phase out of foucs * Update README.md * Bm/version 1.4.0 (#137) * Update layers.py * Update convolutional.py Transformer-based models can now be reused and expanded quickly and easily * Update documentation * Update Transformer-based models * Delete classifying_MNIST_vit_tutorial.ipynb * Create classifying_MNIST_vit_tutorial.ipynb * Update datasets.py * Allows kwargs as inputs in single_layer_call * Update embeddings.py * masked transformers * reformat transformer models * Create trajectory_analysis_tutorial.ipynb * Add Variational autoencoders * Add variational autoencoders * Update vae.py * Create MNIST_VAE_tutorial.ipynb * Update MNIST_VAE_tutorial.ipynb * Create folder for course examples * Update README.md * Update README.md * Update examples * Update README.md * Update README.md * Update MNIST VAE examples * Added MLP regression example * Update README.md * Create image_segmentation_Unet.ipynb * Update README.md * Documented and tested cell_counting_tutorial.ipynb * improve dnn example * Shift variant mie * Position mie scatterer correctly * implement set z * implement mnist v1 * implement z dependence * remove logging * Implement flattening methods * Implement pooling and resizing * Implement TensorflowDataset * Finalize MNIST * Implement Malaria classification * alpha0 release * fix batchsize in fit * implement dataset.take * Implement datasets * fix phase in mie * Fix mie positioning and focusing * Commit to new branch * add tensorflow datasets dependence * remove test Co-authored-by: Jesús Pineda <[email protected]> Co-authored-by: Jesús Pineda <[email protected]> Co-authored-by: Benjamin Midtvedt <[email protected]> Co-authored-by: Ccx55 <[email protected]> * Add tensorflow datasets to the list of dependencies. * Read requirements.txt into setup.py * remove sphinx from build * remove create badges * Create CITATION.cff * Create .zenodo.json * Update transformer models * Update pint_definition.py * Update requirements.txt * create TimeDistributed CNN * small fixes to lodestar * Update layers.py * Update test_layers.py * remove direct getter of properties * Update scatterers.py Coherence length fix for MieScatterer * Update scatterers.py Added coherence length to the conversion table * mie phase fix * removed pydeepimagej from deps * Change loss input order of CGAN and PCGAN * Create dmdataset (dataset for graph-level regression tasks) * Update gnns/__init__.py * Add detection_linking_hela dataset * Update dmdataset.py * Create the regression_diffusion_landscape * Update scatterers.py CuPy fix for coherence length * Update test_scatterers.py Added a new method for testing MieSphere when coherence length parameter is provided. * Update augmentations.py * Update test_scatterers.py * Update test_scatterers.py * Create endothelial_vs dataset * Update layers.py * Update utils.py * Update docs link * Update README.md * version bump * version bump * Update README.md Co-authored-by: BenjaminMidtvedt <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jesús Pineda <[email protected]> Co-authored-by: Benjamin Midtvedt <[email protected]> Co-authored-by: Jesús Pineda <[email protected]> Co-authored-by: Ccx55 <[email protected]> Co-authored-by: Harshith Bachimanchi <[email protected]> Co-authored-by: gideon <[email protected]> Co-authored-by: Benjamin Midtvedt <[email protected]>
1 parent 1b5305b commit cd5f06b

31 files changed

+663
-82
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<p align="center">
2-
<img width="350" src=https://github.com/softmatterlab/DeepTrack-2.0/blob/develop/assets/logo.png?raw=true>
2+
<img width="350" src=https://github.com/softmatterlab/DeepTrack2/blob/develop/assets/logo.png?raw=true>
33
</p>
44

55
<h3 align="center">A comprehensive deep learning framework for digital microscopy.</h3>
66
<p align="center">
77
<a href="/LICENSE" alt="licence"><img src="https://img.shields.io/github/license/softmatterlab/DeepTrack-2.0"></a>
88
<a href="https://badge.fury.io/py/deeptrack"><img src="https://badge.fury.io/py/deeptrack.svg" alt="PyPI version"></a>
9-
<a href="https://softmatterlab.github.io/DeepTrack-2.0/deeptrack.html"><img src="https://img.shields.io/badge/docs-passing-green" alt="PyPI version"></a>
9+
<a href="https://softmatterlab.github.io/DeepTrack2/deeptrack.html"><img src="https://img.shields.io/badge/docs-passing-green" alt="PyPI version"></a>
1010
<a href="https://badge.fury.io/py/deeptrack"><img src="https://img.shields.io/badge/python-3.6%20%7C%203.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue" alt="Python version"></a>
1111
<a href="https://doi.org/10.1063/5.0034891" alt="DOI">
1212
<img src="https://img.shields.io/badge/DOI-10.1063%2F5.0034891-blue">
@@ -54,8 +54,8 @@ DeepTrack is a general purpose deep learning framework for microscopy, meaning y
5454
<br/>
5555
<a href="https://colab.research.google.com/github/softmatterlab/DeepTrack-2.0/blob/master/examples/paper-examples/2-single_particle_tracking.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg"> Training a CNN-based single particle tracker using simulated data </a>
5656
<br/>
57-
<a href="https://doi.org/10.48550/arXiv.2202.13546" alt="DOI lodestar">
58-
<img src="https://img.shields.io/badge/DOI-10.48550%2FarXiv.2202.13546-blue">
57+
<a href="https://doi.org/10.1038/s41467-022-35004-y" alt="DOI lodestar">
58+
<img src="https://img.shields.io/badge/DOI-10.1038%2Fs41467--022--35004--y-blue">
5959
</a>
6060
<a href="https://colab.research.google.com/github/softmatterlab/DeepTrack-2.0/blob/master/examples/LodeSTAR/02.%20tracking_particles_of_various_shapes.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg"> Unsupervised training of a single particle tracker using LodeSTAR </a>
6161

@@ -67,8 +67,8 @@ DeepTrack is a general purpose deep learning framework for microscopy, meaning y
6767
<p align="left">
6868
<img width="600" src=/assets/MPT-packed.gif?raw=true>
6969
<br/>
70-
<a href="https://doi.org/10.48550/arXiv.2202.13546" alt="DOI lodestar">
71-
<img src="https://img.shields.io/badge/DOI-10.48550%2FarXiv.2202.13546-blue">
70+
<a href="https://doi.org/10.1038/s41467-022-35004-y" alt="DOI lodestar">
71+
<img src="https://img.shields.io/badge/DOI-10.1038%2Fs41467--022--35004--y-blue">
7272
</a> <a href="https://colab.research.google.com/github/softmatterlab/DeepTrack-2.0/blob/master/examples/LodeSTAR/03.track_BF-C2DL-HSC.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg"> Training LodeSTAR to detect multiple cells from a single image </a>
7373
<br/>
7474
<a href="https://colab.research.google.com/github/softmatterlab/DeepTrack-2.0/blob/master/examples/paper-examples/4-multi-molecule-tracking.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg"> Training a UNet-based multi-particle tracker using simulated data </a>
@@ -144,6 +144,13 @@ https://doi.org/10.1063/5.0034891
144144

145145
See also:
146146

147+
<https://www.nature.com/articles/s41467-022-35004-y>:
148+
```
149+
Midtvedt, B., Pineda, J., Skärberg, F. et al.
150+
"Single-shot self-supervised object detection in microscopy."
151+
Nat Commun 13, 7492 (2022).
152+
```
153+
147154
<https://arxiv.org/abs/2202.06355>:
148155
```
149156
Jesús Pineda, Benjamin Midtvedt, Harshith Bachimanchi, Sergio Noé, Daniel Midtvedt, Giovanni Volpe,1 and Carlo Manzo

deeptrack/datasets/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44
regression_holography_nanoparticles,
55
segmentation_fluorescence_u2os,
66
detection_holography_nanoparticles,
7+
detection_linking_hela,
8+
dmdataset,
9+
regression_diffusion_landscape,
10+
endothelial_vs,
711
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""detection_linking_hela dataset."""
2+
3+
from .detection_linking_hela import DetectionLinkingHela
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TODO(detection_linking_hela): If your dataset downloads files, then the checksums
2+
# will be automatically added here when running
3+
# `tfds build --register_checksums`.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import tensorflow as tf
2+
import tensorflow_datasets as tfds
3+
4+
import numpy as np
5+
import pandas as pd
6+
7+
_DESCRIPTION = """
8+
This dataset includes tracking data from DIC-C2DH-HELA (provided by the sixth edition of the Cell Tracking Challenge).
9+
It consists of two dataframes: ``nodes`` and ``parenthood``. ``nodes`` contains information about the individual
10+
cells, while "parenthood" includes information on the lineage of the cells.
11+
"""
12+
13+
_CITATION = """
14+
@article{pineda2022geometric,
15+
title={Geometric deep learning reveals the spatiotemporal fingerprint of microscopic motion},
16+
author={Pineda, Jes{\'u}s and Midtvedt, Benjamin and Bachimanchi, Harshith and No{\'e}, Sergio and Midtvedt, Daniel and Volpe, Giovanni and Manzo, Carlo},
17+
journal={arXiv preprint arXiv:2202.06355},
18+
year={2022}
19+
}
20+
"""
21+
22+
23+
class DetectionLinkingHela(tfds.core.GeneratorBasedBuilder):
24+
"""DatasetBuilder for detection_linking_Hela dataset."""
25+
26+
VERSION = tfds.core.Version("1.0.0")
27+
RELEASE_NOTES = {
28+
"1.0.0": "Initial release.",
29+
}
30+
31+
def _info(self) -> tfds.core.DatasetInfo:
32+
"""Returns the dataset metadata."""
33+
NODE_FEATURES = self.get_node_features()
34+
return tfds.core.DatasetInfo(
35+
builder=self,
36+
description=_DESCRIPTION,
37+
features=tfds.features.FeaturesDict(
38+
{
39+
"nodes": tfds.features.FeaturesDict(
40+
{
41+
**{
42+
key: tfds.features.Tensor(
43+
shape=(None,), dtype=NODE_FEATURES[key]
44+
)
45+
for key in NODE_FEATURES.keys()
46+
},
47+
}
48+
),
49+
"parenthood": tfds.features.FeaturesDict(
50+
{
51+
"child": tfds.features.Tensor(
52+
shape=(None,), dtype=tf.int32
53+
),
54+
"parent": tfds.features.Tensor(
55+
shape=(None,), dtype=tf.int32
56+
),
57+
}
58+
),
59+
"images": tfds.features.Tensor(
60+
shape=(84, 512, 512, 1), dtype=tf.float64
61+
),
62+
"masks": tfds.features.Tensor(
63+
shape=(84, 512, 512, 1), dtype=tf.float64
64+
),
65+
}
66+
),
67+
supervised_keys=None,
68+
homepage="https://dataset-homepage/",
69+
citation=_CITATION,
70+
)
71+
72+
def _split_generators(self, dl_manager: tfds.download.DownloadManager):
73+
"""Returns SplitGenerators."""
74+
# Downloads the data and defines the splits
75+
path = dl_manager.download_and_extract(
76+
"https://drive.google.com/u/1/uc?id=1itHz4KmrUqDCKpGNyHUiHE4AFhwiJ5XR&export=download"
77+
)
78+
79+
# Returns the Dict[split names, Iterator[Key, Example]]
80+
return {
81+
"train": self._generate_examples(
82+
path / "detection_linking_hela", "train"
83+
),
84+
"test": self._generate_examples(
85+
path / "detection_linking_hela", "test"
86+
),
87+
}
88+
89+
def _generate_examples(self, path, split):
90+
"""Yields examples."""
91+
92+
# Load data
93+
nodes, parenthood, images, masks = (
94+
pd.read_csv(path / split / "nodesdf.csv"),
95+
pd.read_csv(path / split / "parenthood.csv"),
96+
np.load(path / split / "images.npy"),
97+
np.load(path / split / "masks.npy"),
98+
)
99+
100+
yield "_", {
101+
"nodes": {**nodes.to_dict("list")},
102+
"parenthood": {**parenthood.to_dict("list")},
103+
"images": images * 1.0,
104+
"masks": masks * 1.0,
105+
}
106+
107+
def get_node_features(self):
108+
return {
109+
"frame": tf.int32,
110+
"label": tf.int32,
111+
"centroid-0": tf.float32,
112+
"centroid-1": tf.float32,
113+
"area": tf.float32,
114+
"mean_intensity": tf.float32,
115+
"perimeter": tf.float32,
116+
"eccentricity": tf.float32,
117+
"solidity": tf.float32,
118+
"set": tf.float32,
119+
"parent": tf.int32,
120+
"solution": tf.float32,
121+
}

deeptrack/datasets/detection_linking_hela/dummy_data/TODO-add_fake_data_in_this_directory.txt

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""dmdataset dataset."""
2+
3+
from .dmdataset import Dmdataset
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TODO(dmdataset): If your dataset downloads files, then the checksums
2+
# will be automatically added here when running
3+
# `tfds build --register_checksums`.
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
"""dmdataset dataset."""
2+
3+
import tensorflow_datasets as tfds
4+
import tensorflow as tf
5+
6+
import os
7+
import scipy
8+
9+
_DESCRIPTION = """
10+
"""
11+
12+
_CITATION = """
13+
"""
14+
15+
16+
class Dmdataset(tfds.core.GeneratorBasedBuilder):
17+
"""DatasetBuilder for dmdataset dataset."""
18+
19+
VERSION = tfds.core.Version("1.0.0")
20+
RELEASE_NOTES = {
21+
"1.0.0": "Initial release.",
22+
}
23+
24+
def _info(self) -> tfds.core.DatasetInfo:
25+
"""Returns the dataset metadata."""
26+
27+
NODE_FEATURES = self.get_features()
28+
29+
return tfds.core.DatasetInfo(
30+
builder=self,
31+
description=_DESCRIPTION,
32+
features=tfds.features.FeaturesDict(
33+
{
34+
"graph": tfds.features.FeaturesDict(
35+
{
36+
**{
37+
key: tfds.features.Tensor(
38+
shape=feature[0],
39+
dtype=feature[1],
40+
)
41+
for key, feature in NODE_FEATURES[
42+
"graph"
43+
].items()
44+
},
45+
}
46+
),
47+
"labels": tfds.features.FeaturesDict(
48+
{
49+
**{
50+
key: tfds.features.Tensor(
51+
shape=feature[0],
52+
dtype=feature[1],
53+
)
54+
for key, feature in NODE_FEATURES[
55+
"labels"
56+
].items()
57+
},
58+
}
59+
),
60+
"sets": tfds.features.FeaturesDict(
61+
{
62+
**{
63+
key: tfds.features.Tensor(
64+
shape=feature[0],
65+
dtype=feature[1],
66+
)
67+
for key, feature in NODE_FEATURES[
68+
"sets"
69+
].items()
70+
},
71+
}
72+
),
73+
}
74+
),
75+
supervised_keys=None,
76+
homepage="https://dataset-homepage/",
77+
citation=_CITATION,
78+
)
79+
80+
def _split_generators(self, dl_manager: tfds.download.DownloadManager):
81+
"""Returns SplitGenerators."""
82+
path = dl_manager.download_and_extract(
83+
"https://drive.google.com/u/1/uc?id=19vplN2lbKo4KAmv4NRU2qr3NSlzxFzrx&export=download"
84+
)
85+
86+
return {
87+
"train": self._generate_examples(
88+
os.path.join(path, "dmdataset", "training")
89+
),
90+
"test": self._generate_examples(
91+
os.path.join(path, "dmdataset", "validation")
92+
),
93+
}
94+
95+
def _generate_examples(self, path):
96+
"""Yields examples."""
97+
data = [{}, {}, {}]
98+
for i, subdict in enumerate(self.get_features().values()):
99+
files = (*subdict.keys(),)
100+
101+
for file in files:
102+
data_elem = scipy.sparse.load_npz(
103+
os.path.join(path, file + ".npz")
104+
).toarray()
105+
data_elem = (
106+
data_elem[0] if data_elem.shape[0] == 1 else data_elem
107+
)
108+
109+
data[i][file] = data_elem
110+
111+
yield "key", {
112+
"graph": data[0],
113+
"labels": data[1],
114+
"sets": data[2],
115+
}
116+
117+
def get_features(self):
118+
return {
119+
"graph": {
120+
"frame": [(None, 1), tf.float64],
121+
"node_features": [(None, 3), tf.float64],
122+
"edge_features": [(None, 1), tf.float64],
123+
"edge_indices": [(None, 2), tf.int64],
124+
"edge_dropouts": [(None, 2), tf.float64],
125+
},
126+
"labels": {
127+
"node_labels": [(None,), tf.float64],
128+
"edge_labels": [(None,), tf.float64],
129+
"global_labels": [(None, 3), tf.float64],
130+
},
131+
"sets": {
132+
"node_sets": [(None, 2), tf.int64],
133+
"edge_sets": [(None, 3), tf.int64],
134+
},
135+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""endothelial_vs dataset."""
2+
3+
from .endothelial_vs import EndothelialVs

0 commit comments

Comments
 (0)