OTVision 0.6.12__py3-none-any.whl → 0.6.13__py3-none-any.whl
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.
- OTVision/application/track/ottrk.py +3 -2
- OTVision/detect/builder.py +12 -1
- OTVision/track/stream_ottrk_file_writer.py +17 -4
- OTVision/version.py +1 -1
- {otvision-0.6.12.dist-info → otvision-0.6.13.dist-info}/METADATA +1 -1
- {otvision-0.6.12.dist-info → otvision-0.6.13.dist-info}/RECORD +8 -8
- {otvision-0.6.12.dist-info → otvision-0.6.13.dist-info}/WHEEL +0 -0
- {otvision-0.6.12.dist-info → otvision-0.6.13.dist-info}/licenses/LICENSE +0 -0
|
@@ -76,8 +76,9 @@ class OttrkBuilder:
|
|
|
76
76
|
t_min=self.config.t_min,
|
|
77
77
|
t_miss_max=self.config.t_miss_max,
|
|
78
78
|
)
|
|
79
|
-
result[dataformat.
|
|
80
|
-
|
|
79
|
+
tracking_metadata = result[dataformat.TRACKING]
|
|
80
|
+
tracking_metadata[dataformat.TRACKING_RUN_ID] = self.config.tracking_run_id
|
|
81
|
+
tracking_metadata[dataformat.FRAME_GROUP] = self.config.frame_group
|
|
81
82
|
return result
|
|
82
83
|
|
|
83
84
|
def _build_data(self) -> list[dict]:
|
OTVision/detect/builder.py
CHANGED
|
@@ -68,6 +68,8 @@ class DetectBuilder(ABC):
|
|
|
68
68
|
|
|
69
69
|
@cached_property
|
|
70
70
|
def configure_logger(self) -> ConfigureLogger:
|
|
71
|
+
if self._configure_logger is not None:
|
|
72
|
+
return self._configure_logger
|
|
71
73
|
return ConfigureLogger()
|
|
72
74
|
|
|
73
75
|
@cached_property
|
|
@@ -94,6 +96,8 @@ class DetectBuilder(ABC):
|
|
|
94
96
|
|
|
95
97
|
@cached_property
|
|
96
98
|
def current_config(self) -> CurrentConfig:
|
|
99
|
+
if self.__current_config is not None:
|
|
100
|
+
return self.__current_config
|
|
97
101
|
return CurrentConfig(Config())
|
|
98
102
|
|
|
99
103
|
@cached_property
|
|
@@ -173,8 +177,15 @@ class DetectBuilder(ABC):
|
|
|
173
177
|
def detect_config(self) -> DetectConfig:
|
|
174
178
|
return self.current_config.get().detect
|
|
175
179
|
|
|
176
|
-
def __init__(
|
|
180
|
+
def __init__(
|
|
181
|
+
self,
|
|
182
|
+
argv: list[str] | None = None,
|
|
183
|
+
current_config: CurrentConfig | None = None,
|
|
184
|
+
configure_logger: ConfigureLogger | None = None,
|
|
185
|
+
) -> None:
|
|
177
186
|
self.argv = argv
|
|
187
|
+
self.__current_config = current_config
|
|
188
|
+
self._configure_logger = configure_logger
|
|
178
189
|
|
|
179
190
|
@property
|
|
180
191
|
@abstractmethod
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
+
from typing import Any
|
|
2
3
|
|
|
3
4
|
from OTVision.application.buffer import Buffer
|
|
4
5
|
from OTVision.application.config import Config, TrackConfig
|
|
@@ -66,7 +67,7 @@ class StreamOttrkFileWriter(Buffer[TrackedFrame, OtdetFileWrittenEvent]):
|
|
|
66
67
|
)
|
|
67
68
|
self._builder.set_config(builder_config)
|
|
68
69
|
last_frame = tracked_frames[-1]
|
|
69
|
-
self._builder.add_tracked_frames(
|
|
70
|
+
self._builder.add_tracked_frames(tracked_frames)
|
|
70
71
|
self._ottrk_unfinished_tracks = last_frame.unfinished_tracks
|
|
71
72
|
self.reset()
|
|
72
73
|
|
|
@@ -103,9 +104,18 @@ class StreamOttrkFileWriter(Buffer[TrackedFrame, OtdetFileWrittenEvent]):
|
|
|
103
104
|
)
|
|
104
105
|
logger().warning(f"Unfinished tracks: {self._ottrk_unfinished_tracks}")
|
|
105
106
|
if self.build_condition_fulfilled:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
self._create_ottrk()
|
|
108
|
+
|
|
109
|
+
def _create_ottrk(self) -> None:
|
|
110
|
+
ottrk_data = self._builder.build()
|
|
111
|
+
self.write(ottrk_data)
|
|
112
|
+
self.full_reset()
|
|
113
|
+
|
|
114
|
+
def full_reset(self) -> None:
|
|
115
|
+
self._in_writing_state = False
|
|
116
|
+
self._builder.reset()
|
|
117
|
+
self._ottrk_unfinished_tracks = set()
|
|
118
|
+
self._current_output_file = None
|
|
109
119
|
|
|
110
120
|
def write(self, ottrk: dict) -> None:
|
|
111
121
|
write_json(
|
|
@@ -114,3 +124,6 @@ class StreamOttrkFileWriter(Buffer[TrackedFrame, OtdetFileWrittenEvent]):
|
|
|
114
124
|
filetype=self.config.filetypes.track,
|
|
115
125
|
overwrite=True,
|
|
116
126
|
)
|
|
127
|
+
|
|
128
|
+
def force_flush(self, _: Any) -> None:
|
|
129
|
+
self._create_ottrk()
|
OTVision/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: OTVision
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.13
|
|
4
4
|
Summary: OTVision is a core module of the OpenTrafficCam framework to perform object detection and tracking.
|
|
5
5
|
Project-URL: Homepage, https://opentrafficcam.org/
|
|
6
6
|
Project-URL: Documentation, https://opentrafficcam.org/overview/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
OTVision/__init__.py,sha256=CLnfgTlVHM4_nzDacvy06Z_Crc3hU6usd0mUyEvBf24,781
|
|
2
2
|
OTVision/config.py,sha256=D4NIio27JG9hZk7yHI6kNKiMxKeKa_MGfrKNDdEH370,5389
|
|
3
3
|
OTVision/dataformat.py,sha256=BHF7qHzyNb80hI1EKfwcdJ9bgG_X4bp_hCXzdg7_MSA,1941
|
|
4
|
-
OTVision/version.py,sha256=
|
|
4
|
+
OTVision/version.py,sha256=t4XRU5FuVuapP20T04ET8T9jvyZRnq6E2-O-wkyzqt4,176
|
|
5
5
|
OTVision/abstraction/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
OTVision/abstraction/defaults.py,sha256=ftETDe25gmr563RPSbG6flcEiNiHnRb0iXK1Zj_zdNg,442
|
|
7
7
|
OTVision/abstraction/observer.py,sha256=ZFGxUUjI3wUpf5ogXg2yDe-QjCcXre6SxH5zOogOx2U,1350
|
|
@@ -29,7 +29,7 @@ OTVision/application/event/new_otvision_config.py,sha256=Xt2YcuPfn57VUYW1nYrH1-o
|
|
|
29
29
|
OTVision/application/event/new_video_start.py,sha256=Ydkao4v3fagJUvXASkvxgmplRb7PYY88cmj-bSxmzfk,148
|
|
30
30
|
OTVision/application/track/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
31
|
OTVision/application/track/get_track_cli_args.py,sha256=uebHGDB6xzttak_Z4Nos08Ay69QKT2JypfHwn1dLpIM,553
|
|
32
|
-
OTVision/application/track/ottrk.py,sha256=
|
|
32
|
+
OTVision/application/track/ottrk.py,sha256=OfFLZbChOB5WJIdZdyINMpBQYdOvf10q_8bVooo5Sjk,6789
|
|
33
33
|
OTVision/application/track/tracking_run_id.py,sha256=9_RgQSHR-IMgAM4LawtJWxNcVyw_E6qkZdVes3JVV0g,961
|
|
34
34
|
OTVision/application/track/update_current_track_config.py,sha256=pCFNuGl6rqpsUUGm2i1kjLSuuITVXv2R79Xf81n45as,1667
|
|
35
35
|
OTVision/application/track/update_track_config_with_cli_args.py,sha256=5MDr2ih4xHzZ0kI6TSQ2C4mcWsPXW2PB80kA22-M_5I,2273
|
|
@@ -38,7 +38,7 @@ OTVision/application/video/generate_video.py,sha256=4zazQoRdwefF_R-sUcnbP-23NTWg
|
|
|
38
38
|
OTVision/convert/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
OTVision/convert/convert.py,sha256=UUfzpbtMlxlJgKE6XeT5nyNqK26-K02bQDhq3o7KrXE,11050
|
|
40
40
|
OTVision/detect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
OTVision/detect/builder.py,sha256=
|
|
41
|
+
OTVision/detect/builder.py,sha256=uHiAfPjQLtedkSdBe7J3mxjcefr3OIItUNq-TKCeWX8,8047
|
|
42
42
|
OTVision/detect/cli.py,sha256=3yf0G_B9cVm2CAz7AFzG10Cctv4ogMOxRHWEg8SZHss,7562
|
|
43
43
|
OTVision/detect/detect.py,sha256=YaVS-DJXdEmh-OzwE31UPNl2uk7mcFyO_CKKTgMeiuM,1328
|
|
44
44
|
OTVision/detect/detected_frame_buffer.py,sha256=zZZZBcpNcKApPMX4xoLeq7xszDCvxA3eOF_umrwo0N4,1931
|
|
@@ -82,7 +82,7 @@ OTVision/track/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
82
82
|
OTVision/track/builder.py,sha256=iDq9-QxU8c3CQQd5HDPzT2qkXWIyFl0fk658KQ7Soh0,4905
|
|
83
83
|
OTVision/track/cli.py,sha256=Lzmij9vMuaArB8MerDcGlaefwKMgRWNWov1YLGWA6SI,4294
|
|
84
84
|
OTVision/track/id_generator.py,sha256=2Lkegjhz8T2FXiK1HaiS_FbNZrJjIWzHi407-IoKAHg,241
|
|
85
|
-
OTVision/track/stream_ottrk_file_writer.py,sha256=
|
|
85
|
+
OTVision/track/stream_ottrk_file_writer.py,sha256=TvJVumOTYUa10tC9_0-wUon1FKC0uJoh2wctRPX1aXg,4836
|
|
86
86
|
OTVision/track/track.py,sha256=iMOaukcHnPhRiU1eEccaeGEKLzBQoilaUPRVmkmt0rk,2357
|
|
87
87
|
OTVision/track/exporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
88
88
|
OTVision/track/exporter/filebased_exporter.py,sha256=sdaWY4CxjawyeEKG329T92Bodf1E8wjnXuXocv0Ppgo,986
|
|
@@ -110,7 +110,7 @@ OTVision/view/view_helpers.py,sha256=a5yV_6ZxO5bxsSymOmxdHqzOEv0VFq4wFBopVRGuVRo
|
|
|
110
110
|
OTVision/view/view_track.py,sha256=vmfMqpbUfnzg_EsWiL-IIKNOApVF09dzSojHpUfYY6M,5393
|
|
111
111
|
OTVision/view/view_transform.py,sha256=HvRd8g8geKRy0OoiZUDn_oC3SJC5nuXhZf3uZelfGKg,5473
|
|
112
112
|
OTVision/view/helpers/OTC.ico,sha256=G9kwlDtgBXmXO3yxW6Z-xVFV2q4nUGuz9E1VPHSu_I8,21662
|
|
113
|
-
otvision-0.6.
|
|
114
|
-
otvision-0.6.
|
|
115
|
-
otvision-0.6.
|
|
116
|
-
otvision-0.6.
|
|
113
|
+
otvision-0.6.13.dist-info/METADATA,sha256=FgCDRqpz_yjT_vcvXX4Fg7ABwOlW1KxN9P2znJH5O_M,6944
|
|
114
|
+
otvision-0.6.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
115
|
+
otvision-0.6.13.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
116
|
+
otvision-0.6.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|