Simple-Track 2.0.2__tar.gz → 2.0.4__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.
- {simple_track-2.0.2 → simple_track-2.0.4}/PKG-INFO +4 -4
- {simple_track-2.0.2 → simple_track-2.0.4}/pyproject.toml +4 -4
- {simple_track-2.0.2 → simple_track-2.0.4}/src/Simple_Track.egg-info/PKG-INFO +4 -4
- {simple_track-2.0.2 → simple_track-2.0.4}/src/Simple_Track.egg-info/requires.txt +2 -2
- simple_track-2.0.4/src/run_simple_track.py +20 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/feature.py +1 -2
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/flow_solver.py +2 -3
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/frame.py +1 -2
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/frame_output.py +1 -2
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/frame_tracker.py +2 -4
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/load.py +1 -2
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/track.py +2 -3
- simple_track-2.0.2/src/run_simple_track.py +0 -17
- {simple_track-2.0.2 → simple_track-2.0.4}/LICENSE +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/README.md +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/setup.cfg +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/Simple_Track.egg-info/SOURCES.txt +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/Simple_Track.egg-info/dependency_links.txt +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/Simple_Track.egg-info/entry_points.txt +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/Simple_Track.egg-info/top_level.txt +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/__init__.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/exceptions.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/src/simpletrack/utils.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/tests/test_feature.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/tests/test_flow_solver.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/tests/test_frame.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/tests/test_frame_tracker.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/tests/test_mwe_output.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/tests/test_simple_track_and_load.py +0 -0
- {simple_track-2.0.2 → simple_track-2.0.4}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Simple-Track
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: Threshold-based object tracking algorithm for 2D data
|
|
5
5
|
Author-email: Adam Gainford <adam.gainford@reading.ac.uk>, Thorwald Stein <t.h.m.stein@reading.ac.uk>
|
|
6
6
|
License-Expression: MPL-2.0
|
|
@@ -8,15 +8,15 @@ Project-URL: Homepage, https://github.com/ParaChute-UK/simple-track/
|
|
|
8
8
|
Project-URL: Issues, https://github.com/ParaChute-UK/simple-track/issues
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: numpy>=2.
|
|
14
|
+
Requires-Dist: numpy>=2.2.0
|
|
15
15
|
Requires-Dist: pytest>=9.0
|
|
16
16
|
Requires-Dist: pytest-cov
|
|
17
17
|
Requires-Dist: pytest-xdist
|
|
18
18
|
Requires-Dist: pyyaml
|
|
19
|
-
Requires-Dist: scipy>=1.
|
|
19
|
+
Requires-Dist: scipy>=1.15.0
|
|
20
20
|
Requires-Dist: scikit-image>=0.25.2
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "Simple-Track"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.4"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Adam Gainford", email="adam.gainford@reading.ac.uk" },
|
|
10
10
|
{ name="Thorwald Stein", email="t.h.m.stein@reading.ac.uk"}
|
|
11
11
|
]
|
|
12
12
|
description = "Threshold-based object tracking algorithm for 2D data "
|
|
13
13
|
readme = "README.md"
|
|
14
|
-
requires-python = ">=3.
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
15
|
classifiers = [
|
|
16
16
|
"Programming Language :: Python :: 3",
|
|
17
17
|
"Operating System :: OS Independent",
|
|
@@ -19,12 +19,12 @@ classifiers = [
|
|
|
19
19
|
license = "MPL-2.0"
|
|
20
20
|
license-files = ["LICEN[CS]E*"]
|
|
21
21
|
dependencies = [
|
|
22
|
-
"numpy >= 2.
|
|
22
|
+
"numpy >= 2.2.0",
|
|
23
23
|
"pytest >= 9.0",
|
|
24
24
|
"pytest-cov",
|
|
25
25
|
"pytest-xdist",
|
|
26
26
|
"pyyaml",
|
|
27
|
-
"scipy >= 1.
|
|
27
|
+
"scipy >= 1.15.0",
|
|
28
28
|
"scikit-image >= 0.25.2"
|
|
29
29
|
]
|
|
30
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Simple-Track
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: Threshold-based object tracking algorithm for 2D data
|
|
5
5
|
Author-email: Adam Gainford <adam.gainford@reading.ac.uk>, Thorwald Stein <t.h.m.stein@reading.ac.uk>
|
|
6
6
|
License-Expression: MPL-2.0
|
|
@@ -8,15 +8,15 @@ Project-URL: Homepage, https://github.com/ParaChute-UK/simple-track/
|
|
|
8
8
|
Project-URL: Issues, https://github.com/ParaChute-UK/simple-track/issues
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Requires-Dist: numpy>=2.
|
|
14
|
+
Requires-Dist: numpy>=2.2.0
|
|
15
15
|
Requires-Dist: pytest>=9.0
|
|
16
16
|
Requires-Dist: pytest-cov
|
|
17
17
|
Requires-Dist: pytest-xdist
|
|
18
18
|
Requires-Dist: pyyaml
|
|
19
|
-
Requires-Dist: scipy>=1.
|
|
19
|
+
Requires-Dist: scipy>=1.15.0
|
|
20
20
|
Requires-Dist: scikit-image>=0.25.2
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
|
|
3
|
+
from simpletrack import Tracker
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def run_tracking():
|
|
7
|
+
# TODO: make argparser default way of handling inputs, including configs and loaders
|
|
8
|
+
# Need to make sure that changes don't affect pyproject.toml entry points
|
|
9
|
+
# easiest just to pass the parser in to run_tracking.
|
|
10
|
+
parser = argparse.ArgumentParser(description="Run Simple-Track")
|
|
11
|
+
parser.add_argument("configs", help="Path to one or more yaml config files.")
|
|
12
|
+
args = parser.parse_args()
|
|
13
|
+
|
|
14
|
+
for config_path in args.configs:
|
|
15
|
+
# With None passed into run method, uses input path in config
|
|
16
|
+
Tracker(config_path).run()
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
if __name__ == "__main__":
|
|
20
|
+
run_tracking()
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import Union
|
|
3
2
|
|
|
4
3
|
import numpy as np
|
|
5
4
|
from numpy.typing import NDArray
|
|
@@ -261,7 +260,7 @@ class Feature:
|
|
|
261
260
|
|
|
262
261
|
def summarise(
|
|
263
262
|
self, output_type: str = "str", headers_only: bool = False
|
|
264
|
-
) ->
|
|
263
|
+
) -> str | dict | list:
|
|
265
264
|
"""
|
|
266
265
|
Return a summary of the Feature properties
|
|
267
266
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import itertools
|
|
2
2
|
import warnings
|
|
3
3
|
from collections.abc import Iterable
|
|
4
|
-
from typing import Union
|
|
5
4
|
|
|
6
5
|
import numpy as np
|
|
7
6
|
import scipy.ndimage as ndimage
|
|
@@ -69,7 +68,7 @@ class FlowSolver:
|
|
|
69
68
|
self.apply_tukey_filtering = apply_tukey_filtering
|
|
70
69
|
|
|
71
70
|
def analyse_flow(
|
|
72
|
-
self, prev_field:
|
|
71
|
+
self, prev_field: Frame | NDArray, current_field: Frame | NDArray
|
|
73
72
|
) -> list[NDArray, NDArray]:
|
|
74
73
|
"""
|
|
75
74
|
Analyses previous field and current field to identify flow field. Uses phase
|
|
@@ -330,7 +329,7 @@ class FlowSolver:
|
|
|
330
329
|
|
|
331
330
|
subdomain_check = [
|
|
332
331
|
dim % sd_shape / 2
|
|
333
|
-
for dim, sd_shape in zip(feature_field_shape, subdomain_shape)
|
|
332
|
+
for dim, sd_shape in zip(feature_field_shape, subdomain_shape, strict=True)
|
|
334
333
|
]
|
|
335
334
|
return not any([remainder != 0 for remainder in subdomain_check])
|
|
336
335
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import Union
|
|
3
2
|
|
|
4
3
|
import numpy as np
|
|
5
4
|
import scipy.ndimage as ndimage
|
|
@@ -123,7 +122,7 @@ class Frame:
|
|
|
123
122
|
else:
|
|
124
123
|
return None
|
|
125
124
|
|
|
126
|
-
def get_flow(self) ->
|
|
125
|
+
def get_flow(self) -> NDArray | None:
|
|
127
126
|
"""
|
|
128
127
|
Get a list of the y-flow and x-flow fields derived by comparing features between
|
|
129
128
|
this frame and a frame from a previous timestep. Flow fields are both numpy
|
|
@@ -2,7 +2,6 @@ import csv
|
|
|
2
2
|
import datetime
|
|
3
3
|
from ast import literal_eval
|
|
4
4
|
from pathlib import Path
|
|
5
|
-
from typing import Union
|
|
6
5
|
|
|
7
6
|
import numpy as np
|
|
8
7
|
|
|
@@ -152,7 +151,7 @@ class LoadOutput:
|
|
|
152
151
|
(contanining Frames of field and Feature data) for further inspection and analysis.
|
|
153
152
|
"""
|
|
154
153
|
|
|
155
|
-
def __init__(self, st_data_path:
|
|
154
|
+
def __init__(self, st_data_path: str | Path):
|
|
156
155
|
self.path = Path(st_data_path)
|
|
157
156
|
self.strftime = "%Y%m%d_%H%M"
|
|
158
157
|
# Links field type names in outputs to attribute names in Frame
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Union
|
|
2
|
-
|
|
3
1
|
import numpy as np
|
|
4
2
|
from numpy.typing import NDArray
|
|
5
3
|
|
|
@@ -493,7 +491,7 @@ class FrameTracker:
|
|
|
493
491
|
advected_feature_field: NDArray,
|
|
494
492
|
current_feature_field: NDArray,
|
|
495
493
|
current_feature_id: int,
|
|
496
|
-
) -> list[
|
|
494
|
+
) -> list[int | None, NDArray | None]:
|
|
497
495
|
"""
|
|
498
496
|
Use overlap histogram to find the closest matching feature id in the advected
|
|
499
497
|
field for the current_feature_id in the current_field. Any other ids that are
|
|
@@ -865,7 +863,7 @@ def advect_field_using_motion_vectors(
|
|
|
865
863
|
dx = np.mean(x_flow[feature_mask], dtype=int)
|
|
866
864
|
|
|
867
865
|
# Now, advect the feature to the new position
|
|
868
|
-
for y_coord, x_coord in zip(*feature_mask):
|
|
866
|
+
for y_coord, x_coord in zip(*feature_mask, strict=True):
|
|
869
867
|
advected_y_coord = y_coord + dy
|
|
870
868
|
advected_x_coord = x_coord + dx
|
|
871
869
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import datetime as dt
|
|
2
|
-
from typing import Union
|
|
3
2
|
|
|
4
3
|
from numpy.typing import NDArray
|
|
5
4
|
|
|
@@ -39,7 +38,7 @@ class BaseLoader:
|
|
|
39
38
|
Loaders should be
|
|
40
39
|
"""
|
|
41
40
|
|
|
42
|
-
def __init__(self, input_data:
|
|
41
|
+
def __init__(self, input_data: list[str] | dict) -> None:
|
|
43
42
|
self.domain_shape = None
|
|
44
43
|
self.input_data = input_data
|
|
45
44
|
# Set the iterating list
|
|
@@ -3,7 +3,6 @@ Run the SimpleTrack algorithm to track objects through a sequence of images
|
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Union
|
|
7
6
|
|
|
8
7
|
from yaml import safe_load
|
|
9
8
|
|
|
@@ -19,7 +18,7 @@ class Tracker:
|
|
|
19
18
|
Simple-Track manager controlling inputs, processing, outputs
|
|
20
19
|
"""
|
|
21
20
|
|
|
22
|
-
def __init__(self, config_input:
|
|
21
|
+
def __init__(self, config_input: str | dict) -> None:
|
|
23
22
|
"""
|
|
24
23
|
Initialize SimpleTrack with configuration file
|
|
25
24
|
|
|
@@ -80,7 +79,7 @@ class Tracker:
|
|
|
80
79
|
config_path,
|
|
81
80
|
)
|
|
82
81
|
|
|
83
|
-
def run(self, input_data:
|
|
82
|
+
def run(self, input_data: list[str] | dict = None) -> Timeline:
|
|
84
83
|
"""
|
|
85
84
|
Runs SimpleTrack using the designated config options.
|
|
86
85
|
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import sys
|
|
2
|
-
|
|
3
|
-
from simpletrack import Tracker
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def run_tracking():
|
|
7
|
-
if len(sys.argv) < 2:
|
|
8
|
-
raise Exception("Running SimpleTrack requires path to at least one config")
|
|
9
|
-
|
|
10
|
-
config_paths = sys.argv[1:]
|
|
11
|
-
for config_path in config_paths:
|
|
12
|
-
# With None passed into run method, uses input path in config
|
|
13
|
-
Tracker(config_path).run()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if __name__ == "__main__":
|
|
17
|
-
run_tracking()
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|