Skip to content
Merged

1.5.0 #148

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
eecd48d
Merge a8c66ebb98565c20f576bbf5b2fda4c8a57eec44 into 8a58cc19e838d683b…
BenjaminMidtvedt Jul 26, 2022
51c87f1
chore: autopublish 2022-07-26T13:54:44Z
github-actions[bot] Jul 26, 2022
b30c265
Remove create-badges job
BenjaminMidtvedt Jul 26, 2022
085b0e5
Delete test.py
BenjaminMidtvedt Jul 26, 2022
74b37b4
Add multi-head masked attention
JesusPinedaC Jul 26, 2022
b4debf5
Update multi-head gated attention to match parent layer
JesusPinedaC Jul 26, 2022
3ecb423
Update documentation
JesusPinedaC Jul 26, 2022
bbf7f4b
Test multi-head masked attention
JesusPinedaC Jul 27, 2022
5df728a
allow gated attention layers to use bias
JesusPinedaC Jul 27, 2022
337152e
test bias in gated attention layers
JesusPinedaC Jul 27, 2022
4eb3e10
set return_attention_weights to False to avoid multi-outputs
JesusPinedaC Jul 27, 2022
2affe63
reformat gnns/layers.py
JesusPinedaC Jul 29, 2022
26d064c
Update layers.py
JesusPinedaC Jul 29, 2022
c65f49d
Update test_layers.py
JesusPinedaC Jul 29, 2022
2ca0590
Update models.py
JesusPinedaC Jul 30, 2022
1d99b6b
Update test_models.py
JesusPinedaC Jul 30, 2022
49cf7ed
Update test_models.py
JesusPinedaC Jul 30, 2022
f455fa1
Merge pull request #129 from softmatterlab/jp/rev-MAGIK
BenjaminMidtvedt Aug 1, 2022
e73d5ed
Fix indexing problems related to tf.gather
JesusPinedaC Aug 2, 2022
71e67ff
Merge pull request #130 from softmatterlab/jp/fix-idx-gather
BenjaminMidtvedt Aug 3, 2022
790e8e2
Allow multi-inputs in ContinuousGenerator
JesusPinedaC Aug 15, 2022
d4e17c1
Fix bad conversion to integer
BenjaminMidtvedt Aug 22, 2022
ad2a95e
version bump
BenjaminMidtvedt Aug 22, 2022
fffe6b6
Merge pull request #131 from softmatterlab/jp/multi-input-generator
BenjaminMidtvedt Aug 22, 2022
af29362
Fix phase correction at focus and offset calculation
BenjaminMidtvedt Aug 26, 2022
d055d1a
Fix phase correction in propagation
BenjaminMidtvedt Aug 26, 2022
30d1489
Merge pull request #134 from softmatterlab/bm/fix-mie-phase
BenjaminMidtvedt Aug 26, 2022
277db0b
Fix mie phase out of foucs
BenjaminMidtvedt Sep 1, 2022
a6f4ba0
Fix mie phase out of foucs
BenjaminMidtvedt Sep 9, 2022
39e4c6d
Merge branch 'develop' of https://github.com/softmatterlab/DeepTrack-…
BenjaminMidtvedt Sep 9, 2022
4806835
Update README.md
giovannivolpe Sep 22, 2022
ff2aca1
Bm/version 1.4.0 (#137)
giovannivolpe Oct 4, 2022
d68fca4
Merge branch 'develop'
BenjaminMidtvedt Oct 4, 2022
5aa410b
Add tensorflow datasets to the list of dependencies.
BenjaminMidtvedt Oct 6, 2022
bfb0e03
Read requirements.txt into setup.py
BenjaminMidtvedt Oct 6, 2022
ecc509f
remove sphinx from build
BenjaminMidtvedt Oct 6, 2022
1886c67
remove create badges
BenjaminMidtvedt Oct 6, 2022
c0accf1
Create CITATION.cff
giovannivolpe Oct 24, 2022
eb04f0c
Create .zenodo.json
giovannivolpe Oct 24, 2022
0be3ef9
Update transformer models
JesusPinedaC Oct 26, 2022
d355352
Update pint_definition.py
JesusPinedaC Oct 26, 2022
6ea9326
Update requirements.txt
JesusPinedaC Oct 26, 2022
b079b69
Merge pull request #140 from softmatterlab/bm/tfd
BenjaminMidtvedt Oct 26, 2022
79da3c8
Merge pull request #145 from softmatterlab/jp/transformers
BenjaminMidtvedt Oct 26, 2022
6ef979d
create TimeDistributed CNN
JesusPinedaC Oct 28, 2022
64667cc
small fixes to lodestar
BenjaminMidtvedt Oct 30, 2022
dedcaa7
Merge pull request #146 from softmatterlab/jp/time-distributed
BenjaminMidtvedt Oct 30, 2022
af0babc
Merge pull request #147 from softmatterlab/bm/add-holo-data
BenjaminMidtvedt Oct 31, 2022
54df12a
Merge branch 'master' into develop
BenjaminMidtvedt Nov 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"creators": [
{
"orcid": "0000-0001-9386-4753",
"affiliation": "Gothenburg University",
"name": "Midtvedt, Benjamin"
},
{
"orcid": "0000-0002-9197-3451",
"affiliation": "Gothenburg University",
"name": "Pineda, Jesus"
},
{
"orcid": "0000-0001-7275-6921",
"affiliation": "Chalmers University of Technology",
"name": "Klein Morberg, Henrik"
},
{
"orcid": "0000-0002-8625-0996",
"affiliation": "University of Vic",
"name": "Manzo, Carlo"
},
{
"orcid": "0000-0001-5057-1846",
"affiliation": "Gothenburg University",
"name": "Volpe, Giovanni"
}
],

"title": "DeepTrack2",

"related_identifiers": [
{
"scheme": "doi",
"identifier": "10.1063/5.0034891",
"relation": "isDocumentedBy",
"resource_type": "publication-article"
}
],

"description": "A Python software platform for microscopy enhanced by deep learning." ,

"keywords": ["Deep Learning", "Software", "Microscopy", "Particle Tracking", "Python"],

"upload_type": "software",

"communities": [
{"identifier": "www.deeptrack.org"},
{"identifier": "https://github.com/softmatterlab/DeepTrack2"}
]
}
30 changes: 30 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: DeepTrack2
message: >-
If you use this software, please cite it through
this publication: Benjamin Midtvedt, Saga
Helgadottir, Aykut Argun, Jesús Pineda, Daniel
Midtvedt, Giovanni Volpe. "Quantitative Digital
Microscopy with Deep Learning." Applied Physics
Reviews 8 (2021), 011310.
https://doi.org/10.1063/5.0034891
type: software
authors:
- given-names: Benjamin
family-names: Midtvedt
orcid: 'https://orcid.org/0000-0001-9386-4753'
- given-names: Jesus
family-names: Pineda
orcid: 'https://orcid.org/0000-0002-9197-3451'
- given-names: Henrik
family-names: Klein Morberg
orcid: 'https://orcid.org/0000-0001-7275-6921'
- given-names: Carlo
family-names: Manzo
orcid: 'https://orcid.org/0000-0002-8625-0996'
- given-names: Giovanni
family-names: Volpe
orcid: 'https://orcid.org/0000-0001-5057-1846'
3 changes: 2 additions & 1 deletion deeptrack/backend/pint_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@
reciprocal_centimeter = 1 / cm = cm_1 = kayser

# Velocity
[velocity] = [length] / [time] = [speed]
[velocity] = [length] / [time]
[speed] = [velocity]
knot = nautical_mile / hour = kt = knot_international = international_knot
mile_per_hour = mile / hour = mph = MPH
kilometer_per_hour = kilometer / hour = kph = KPH
Expand Down
1 change: 1 addition & 0 deletions deeptrack/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
segmentation_ssTEM_drosophila,
regression_holography_nanoparticles,
segmentation_fluorescence_u2os,
detection_holography_nanoparticles,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""detection_holography_nanoparticles dataset."""

from .detection_holography_nanoparticles import DetectionHolographyNanoparticles
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TODO(detection_holography_nanoparticles): If your dataset downloads files, then the checksums
# will be automatically added here when running
# `tfds build --register_checksums`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
"""detection_holography_nanoparticles dataset."""

import tensorflow_datasets as tfds
import tensorflow as tf
import numpy as np

# TODO(detection_holography_nanoparticles): Markdown description that will appear on the catalog page.
_DESCRIPTION = """
"""

# TODO(detection_holography_nanoparticles): BibTeX citation
_CITATION = """
"""


class DetectionHolographyNanoparticles(tfds.core.GeneratorBasedBuilder):
"""DatasetBuilder for detection_holography_nanoparticles dataset."""

VERSION = tfds.core.Version("1.0.2")
RELEASE_NOTES = {
"1.0.0": "Initial release.",
}

def _info(self) -> tfds.core.DatasetInfo:
"""Returns the dataset metadata."""
# TODO(detection_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=(972, 729, 2), dtype=tf.float64
),
"label": tfds.features.Tensor(shape=(None, 7), dtype=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", "label"), # Set to `None` to disable
homepage="https://dataset-homepage/",
citation=_CITATION,
disable_shuffling=True,
)

def _split_generators(self, dl_manager: tfds.download.DownloadManager):
"""Returns SplitGenerators."""
# TODO(detection_holography_nanoparticles): Downloads the data and defines the splits
path = dl_manager.download_and_extract(
"https://drive.google.com/u/1/uc?id=1uAZVr9bldhZhxuXAXvdd1-Ks4m9HPRtM&export=download"
)

# TODO(detection_holography_nanoparticles): Returns the Dict[split names, Iterator[Key, Example]]
return {
"train": self._generate_examples(path),
}

def _generate_examples(self, path):
"""Yields examples."""
# TODO(detection_holography_nanoparticles): Yields (key, example) tuples from the dataset

fields = path.glob("f*.npy")
labels = path.glob("d*.npy")

# sort the files
fields = sorted(fields, key=lambda x: int(x.stem[1:]))
labels = sorted(labels, key=lambda x: int(x.stem[1:]))

for field, label in zip(fields, labels):
field_data = np.load(field)
field_data = np.stack((field_data.real, field_data.imag), axis=-1)
yield field.stem, {
"image": field_data,
"label": np.load(label),
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""detection_holography_nanoparticles dataset."""

import tensorflow_datasets as tfds
from . import detection_holography_nanoparticles


class DetectionHolographyNanoparticlesTest(tfds.testing.DatasetBuilderTestCase):
"""Tests for detection_holography_nanoparticles dataset."""
# TODO(detection_holography_nanoparticles):
DATASET_CLASS = detection_holography_nanoparticles.DetectionHolographyNanoparticles
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()
15 changes: 12 additions & 3 deletions deeptrack/extras/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
"CellData": ("1CJW7msDiI7xq7oMce4l9tRkNN6O5eKtj", "CellData", ""),
"CellMigData": ("1vRsWcxjbTz6rffCkrwOfs_ezPvUjPwGw", "CellMigData", ""),
"BFC2Cells": ("1lHgJdG5I3vRnU_DRFwTr_c69nx1Xkd3X", "BFC2Cells", ""),
"STrajCh": ("1wXCSzvHuLwz1dywxUu2aQXlqbgf2V8r3", "STrajCh", "")
"STrajCh": ("1wXCSzvHuLwz1dywxUu2aQXlqbgf2V8r3", "STrajCh", ""),
"TrajectoryDiffusion": (
"1YhECLQrWPZgc_TVY2Sl2OwDcNxmA_jR5",
"TrajectoryDiffusion",
"",
),
}


Expand Down Expand Up @@ -109,7 +114,9 @@ def load(key):

# If the extracted folder is another folder with the same name, move it.
if os.path.isdir(f"datasets/{folder_name}/{folder_name}"):
os.rename(f"datasets/{folder_name}/{folder_name}", f"datasets/{folder_name}")
os.rename(
f"datasets/{folder_name}/{folder_name}", f"datasets/{folder_name}"
)


def load_model(key):
Expand Down Expand Up @@ -171,7 +178,9 @@ def load_model(key):

# If the extracted folder is another folder with the same name, move it.
if os.path.isdir(f"models/{folder_name}/{folder_name}"):
os.rename(f"models/{folder_name}/{folder_name}", f"models/{folder_name}")
os.rename(
f"models/{folder_name}/{folder_name}", f"models/{folder_name}"
)

return f"models/{folder_name}"

Expand Down
Loading