OTVision 0.6.4__py3-none-any.whl → 0.6.6__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.
Files changed (54) hide show
  1. OTVision/abstraction/defaults.py +15 -0
  2. OTVision/application/config.py +475 -0
  3. OTVision/application/config_parser.py +280 -0
  4. OTVision/application/configure_logger.py +1 -1
  5. OTVision/application/detect/detected_frame_factory.py +1 -0
  6. OTVision/application/detect/factory.py +1 -1
  7. OTVision/application/detect/update_detect_config_with_cli_args.py +2 -1
  8. OTVision/application/get_config.py +2 -1
  9. OTVision/application/get_current_config.py +1 -1
  10. OTVision/application/track/__init__.py +0 -0
  11. OTVision/application/track/get_track_cli_args.py +20 -0
  12. OTVision/application/track/update_current_track_config.py +42 -0
  13. OTVision/application/track/update_track_config_with_cli_args.py +52 -0
  14. OTVision/application/update_current_config.py +1 -1
  15. OTVision/config.py +61 -668
  16. OTVision/convert/convert.py +3 -3
  17. OTVision/detect/builder.py +27 -20
  18. OTVision/detect/cli.py +3 -3
  19. OTVision/detect/detected_frame_buffer.py +3 -0
  20. OTVision/detect/file_based_detect_builder.py +19 -0
  21. OTVision/detect/otdet.py +54 -1
  22. OTVision/detect/otdet_file_writer.py +4 -3
  23. OTVision/detect/rtsp_based_detect_builder.py +37 -0
  24. OTVision/detect/rtsp_input_source.py +207 -0
  25. OTVision/detect/timestamper.py +2 -1
  26. OTVision/detect/video_input_source.py +9 -5
  27. OTVision/detect/yolo.py +17 -1
  28. OTVision/domain/cli.py +31 -1
  29. OTVision/domain/current_config.py +1 -1
  30. OTVision/domain/frame.py +6 -0
  31. OTVision/domain/object_detection.py +6 -1
  32. OTVision/domain/serialization.py +12 -0
  33. OTVision/domain/time.py +13 -0
  34. OTVision/helpers/files.py +14 -15
  35. OTVision/plugin/__init__.py +0 -0
  36. OTVision/plugin/yaml_serialization.py +20 -0
  37. OTVision/track/builder.py +132 -0
  38. OTVision/track/cli.py +128 -0
  39. OTVision/track/exporter/filebased_exporter.py +2 -1
  40. OTVision/track/id_generator.py +15 -0
  41. OTVision/track/model/track_exporter.py +2 -1
  42. OTVision/track/model/tracking_interfaces.py +6 -6
  43. OTVision/track/parser/chunk_parser_plugins.py +1 -0
  44. OTVision/track/parser/frame_group_parser_plugins.py +35 -5
  45. OTVision/track/track.py +54 -133
  46. OTVision/track/tracker/filebased_tracking.py +8 -7
  47. OTVision/track/tracker/tracker_plugin_iou.py +15 -9
  48. OTVision/transform/transform.py +2 -2
  49. OTVision/version.py +1 -1
  50. otvision-0.6.6.dist-info/METADATA +182 -0
  51. {otvision-0.6.4.dist-info → otvision-0.6.6.dist-info}/RECORD +53 -36
  52. otvision-0.6.4.dist-info/METADATA +0 -49
  53. {otvision-0.6.4.dist-info → otvision-0.6.6.dist-info}/WHEEL +0 -0
  54. {otvision-0.6.4.dist-info → otvision-0.6.6.dist-info}/licenses/LICENSE +0 -0
OTVision/track/track.py CHANGED
@@ -1,144 +1,65 @@
1
1
  import logging
2
- import uuid
3
- from pathlib import Path
4
- from typing import Callable, Iterator
5
2
 
6
3
  from tqdm import tqdm
7
4
 
8
- from OTVision import dataformat
9
- from OTVision.config import (
10
- CONFIG,
11
- DETECT,
12
- FILETYPES,
13
- IOU,
14
- OVERWRITE,
15
- SIGMA_H,
16
- SIGMA_IOU,
17
- SIGMA_L,
18
- T_MIN,
19
- T_MISS_MAX,
20
- TRACK,
21
- )
5
+ from OTVision.application.config import Config
6
+ from OTVision.application.get_current_config import GetCurrentConfig
22
7
  from OTVision.helpers.files import get_files
23
8
  from OTVision.helpers.input_types import check_types
24
9
  from OTVision.helpers.log import LOGGER_NAME
25
- from OTVision.track.exporter.filebased_exporter import FinishedChunkTrackExporter
26
- from OTVision.track.parser.chunk_parser_plugins import JsonChunkParser
27
- from OTVision.track.parser.frame_group_parser_plugins import (
28
- TimeThresholdFrameGroupParser,
29
- )
30
- from OTVision.track.tracker.filebased_tracking import (
31
- GroupedFilesTracker,
32
- UnfinishedChunksBuffer,
33
- )
34
- from OTVision.track.tracker.tracker_plugin_iou import IouParameters, IouTracker
35
-
36
-
37
- def track_id_generator() -> Iterator[int]:
38
- ID: int = 0
39
- while True:
40
- ID += 1
41
- yield ID
42
-
10
+ from OTVision.track.id_generator import StrIdGenerator, tracking_run_uuid_generator
11
+ from OTVision.track.model.track_exporter import FinishedTracksExporter
12
+ from OTVision.track.tracker.filebased_tracking import UnfinishedChunksBuffer
43
13
 
44
14
  log = logging.getLogger(LOGGER_NAME)
45
- STR_ID_GENERATOR = Callable[[], str]
46
-
47
-
48
- def tracker_metadata(
49
- sigma_l: float, sigma_h: float, sigma_iou: float, t_min: float, t_miss_max: float
50
- ) -> dict:
51
- return {
52
- dataformat.NAME: "IOU",
53
- dataformat.SIGMA_L: sigma_l,
54
- dataformat.SIGMA_H: sigma_h,
55
- dataformat.SIGMA_IOU: sigma_iou,
56
- dataformat.T_MIN: t_min,
57
- dataformat.T_MISS_MAX: t_miss_max,
58
- }
59
-
60
-
61
- def main(
62
- paths: list[Path],
63
- sigma_l: float = CONFIG[TRACK][IOU][SIGMA_L],
64
- sigma_h: float = CONFIG[TRACK][IOU][SIGMA_H],
65
- sigma_iou: float = CONFIG[TRACK][IOU][SIGMA_IOU],
66
- t_min: int = CONFIG[TRACK][IOU][T_MIN],
67
- t_miss_max: int = CONFIG[TRACK][IOU][T_MISS_MAX],
68
- overwrite: bool = CONFIG[TRACK][OVERWRITE],
69
- tracking_run_id_generator: STR_ID_GENERATOR = lambda: str(uuid.uuid4()),
70
- ) -> None:
71
- """Read detections from otdet file, perform tracking using iou tracker and
72
- save tracks to ottrk file.
73
-
74
- Args:
75
- paths (list[Path]): List of paths to detection files.
76
- sigma_l (float, optional): Lower confidence threshold. Detections with
77
- confidences below sigma_l are not even considered for tracking.
78
- Defaults to CONFIG["TRACK"]["IOU"]["SIGMA_L"].
79
- sigma_h (float, optional): Upper confidence threshold. Tracks are only
80
- considered as valid if they contain at least one detection with a confidence
81
- above sigma_h.
82
- Defaults to CONFIG["TRACK"]["IOU"]["SIGMA_H"].
83
- sigma_iou (float, optional): Intersection-Over-Union threshold. Two detections
84
- in subsequent frames are considered to belong to the same track if their IOU
85
- value exceeds sigma_iou and this is the highest IOU of all possible
86
- combination of detections.
87
- Defaults to CONFIG["TRACK"]["IOU"]["SIGMA_IOU"].
88
- t_min (int, optional): Minimum number of detections to count as a valid track.
89
- All tracks with less detections will be dissmissed.
90
- Defaults to CONFIG["TRACK"]["IOU"]["T_MIN"].
91
- t_miss_max (int, optional): Maximum number of missed detections before
92
- continuing a track. If more detections are missing, the track will not be
93
- continued.
94
- Defaults to CONFIG["TRACK"]["IOU"]["T_MISS_MAX"].
95
- overwrite (bool, optional): Whether or not to overwrite existing tracks files.
96
- Defaults to CONFIG["TRACK"]["OVERWRITE"].
97
- tracking_run_id_generator (IdGenerator): Generator used to create a unique id
98
- for this tracking run
99
- """
100
-
101
- check_types(sigma_l, sigma_h, sigma_iou, t_min, t_miss_max)
102
-
103
- filetypes = CONFIG[FILETYPES][DETECT]
104
- detections_files = get_files(paths=paths, filetypes=filetypes)
105
-
106
- start_msg = f"Start tracking of {len(detections_files)} detections files"
107
- log.info(start_msg)
108
- print(start_msg)
109
-
110
- if not detections_files:
111
- log.warning(f"No files of type '{filetypes}' found to track!")
112
- return
113
-
114
- iou_tracker: IouTracker = IouTracker(
115
- parameters=IouParameters(sigma_l, sigma_h, sigma_iou, t_min, t_miss_max)
116
- )
117
-
118
- chunk_parser = JsonChunkParser()
119
- group_parser = TimeThresholdFrameGroupParser(
120
- tracker_data=tracker_metadata(sigma_l, sigma_h, sigma_iou, t_min, t_miss_max)
121
- )
122
-
123
- file_tracker = GroupedFilesTracker(
124
- tracker=iou_tracker,
125
- chunk_parser=chunk_parser,
126
- frame_group_parser=group_parser,
127
- id_generator_factory=lambda _: track_id_generator(),
128
- overwrite=True,
129
- )
130
-
131
- buffer = UnfinishedChunksBuffer(
132
- tracker=file_tracker,
133
- keep_discarded=True,
134
- )
135
-
136
- exporter = FinishedChunkTrackExporter()
137
15
 
138
- tracking_run_id = tracking_run_id_generator()
139
- finished_chunk_stream = buffer.group_and_track(detections_files)
140
16
 
141
- finished_chunk_progress = tqdm(
142
- finished_chunk_stream, desc="export FrameChunk", total=len(detections_files)
143
- )
144
- exporter.export(tracking_run_id, iter(finished_chunk_progress), overwrite)
17
+ class OtvisionTrack:
18
+ @property
19
+ def config(self) -> Config:
20
+ return self._get_current_config.get()
21
+
22
+ def __init__(
23
+ self,
24
+ get_current_config: GetCurrentConfig,
25
+ track_exporter: FinishedTracksExporter,
26
+ unfinished_chunks_buffer: UnfinishedChunksBuffer,
27
+ tracking_run_id_generator: StrIdGenerator = tracking_run_uuid_generator,
28
+ ) -> None:
29
+ self._get_current_config = get_current_config
30
+ self._track_exporter = track_exporter
31
+ self._buffer = unfinished_chunks_buffer
32
+ self._tracking_run_id_generator = tracking_run_id_generator
33
+
34
+ def start(self) -> None:
35
+ check_types(
36
+ self.config.track.sigma_l,
37
+ self.config.track.sigma_h,
38
+ self.config.track.sigma_iou,
39
+ self.config.track.t_min,
40
+ self.config.track.t_miss_max,
41
+ )
42
+
43
+ detections_files = get_files(
44
+ paths=self.config.track.paths, filetypes=[self.config.filetypes.detect]
45
+ )
46
+
47
+ start_msg = f"Start tracking of {len(detections_files)} detections files"
48
+ log.info(start_msg)
49
+ print(start_msg)
50
+
51
+ if not detections_files:
52
+ log.warning(
53
+ f"No files of type '{self.config.filetypes.detect}' " "found to track!"
54
+ )
55
+ return
56
+
57
+ tracking_run_id = self._tracking_run_id_generator()
58
+ finished_chunk_stream = self._buffer.group_and_track(detections_files)
59
+
60
+ finished_chunk_progress = tqdm(
61
+ finished_chunk_stream, desc="export FrameChunk", total=len(detections_files)
62
+ )
63
+ self._track_exporter.export(
64
+ tracking_run_id, iter(finished_chunk_progress), self.config.track.overwrite
65
+ )
@@ -5,7 +5,8 @@ from typing import Callable, Iterator
5
5
  from more_itertools import peekable
6
6
  from tqdm import tqdm
7
7
 
8
- from OTVision.config import CONFIG, DEFAULT_FILETYPE, OVERWRITE, TRACK
8
+ from OTVision.application.config import DEFAULT_FILETYPE, OVERWRITE, TRACK
9
+ from OTVision.config import CONFIG
9
10
  from OTVision.domain.detection import TrackId
10
11
  from OTVision.domain.frame import DetectedFrame, FrameNo, IsLastFrame, TrackedFrame
11
12
  from OTVision.helpers.log import LOGGER_NAME
@@ -17,7 +18,7 @@ from OTVision.track.model.filebased.frame_chunk import (
17
18
  )
18
19
  from OTVision.track.model.filebased.frame_group import FrameGroup, FrameGroupParser
19
20
  from OTVision.track.model.tracking_interfaces import (
20
- ID_GENERATOR,
21
+ IdGenerator,
21
22
  Tracker,
22
23
  UnfinishedTracksBuffer,
23
24
  )
@@ -35,7 +36,7 @@ class ChunkBasedTracker(Tracker):
35
36
  def track_frame(
36
37
  self,
37
38
  frames: DetectedFrame,
38
- id_generator: ID_GENERATOR,
39
+ id_generator: IdGenerator,
39
40
  ) -> TrackedFrame:
40
41
  return self._tracker.track_frame(frames, id_generator)
41
42
 
@@ -43,7 +44,7 @@ class ChunkBasedTracker(Tracker):
43
44
  self,
44
45
  chunk: FrameChunk,
45
46
  is_last_chunk: bool,
46
- id_generator: ID_GENERATOR,
47
+ id_generator: IdGenerator,
47
48
  ) -> TrackedChunk:
48
49
  frames_progress = tqdm(
49
50
  chunk.frames, desc="track Frame", total=len(chunk.frames), leave=False
@@ -63,14 +64,14 @@ class ChunkBasedTracker(Tracker):
63
64
  file: Path,
64
65
  frame_group: FrameGroup,
65
66
  is_last_file: bool,
66
- id_generator: ID_GENERATOR,
67
+ id_generator: IdGenerator,
67
68
  frame_offset: int = 0,
68
69
  ) -> TrackedChunk:
69
70
  chunk = self._chunk_parser.parse(file, frame_group, frame_offset)
70
71
  return self.track_chunk(chunk, is_last_file, id_generator)
71
72
 
72
73
 
73
- ID_GENERATOR_FACTORY = Callable[[FrameGroup], ID_GENERATOR]
74
+ IdGeneratorFactory = Callable[[FrameGroup], IdGenerator]
74
75
 
75
76
 
76
77
  class GroupedFilesTracker(ChunkBasedTracker):
@@ -80,7 +81,7 @@ class GroupedFilesTracker(ChunkBasedTracker):
80
81
  tracker: Tracker,
81
82
  chunk_parser: ChunkParser,
82
83
  frame_group_parser: FrameGroupParser,
83
- id_generator_factory: ID_GENERATOR_FACTORY,
84
+ id_generator_factory: IdGeneratorFactory,
84
85
  overwrite: bool = CONFIG[TRACK][OVERWRITE],
85
86
  file_type: str = CONFIG[DEFAULT_FILETYPE][TRACK],
86
87
  ) -> None:
@@ -1,8 +1,10 @@
1
1
  from dataclasses import dataclass
2
2
 
3
+ from OTVision.application.config import TrackConfig
4
+ from OTVision.application.get_current_config import GetCurrentConfig
3
5
  from OTVision.domain.detection import Detection, TrackedDetection, TrackId
4
6
  from OTVision.domain.frame import DetectedFrame, FrameNo, TrackedFrame
5
- from OTVision.track.model.tracking_interfaces import ID_GENERATOR, Tracker
7
+ from OTVision.track.model.tracking_interfaces import IdGenerator, Tracker
6
8
 
7
9
 
8
10
  @dataclass(frozen=True)
@@ -138,34 +140,37 @@ def iou(
138
140
 
139
141
 
140
142
  class IouTracker(Tracker):
143
+ @property
144
+ def config(self) -> TrackConfig:
145
+ return self._get_current_config.get().track
141
146
 
142
- def __init__(self, parameters: IouParameters):
147
+ def __init__(self, get_current_config: GetCurrentConfig):
143
148
  super().__init__()
144
- self.parameters = parameters
149
+ self._get_current_config = get_current_config
145
150
  self.active_tracks: list[ActiveIouTrack] = []
146
151
 
147
152
  @property
148
153
  def sigma_l(self) -> float:
149
- return self.parameters.sigma_l
154
+ return self.config.iou.sigma_l
150
155
 
151
156
  @property
152
157
  def sigma_h(self) -> float:
153
- return self.parameters.sigma_h
158
+ return self.config.iou.sigma_h
154
159
 
155
160
  @property
156
161
  def sigma_iou(self) -> float:
157
- return self.parameters.sigma_iou
162
+ return self.config.iou.sigma_iou
158
163
 
159
164
  @property
160
165
  def t_min(self) -> int:
161
- return self.parameters.t_min
166
+ return self.config.iou.t_min
162
167
 
163
168
  @property
164
169
  def t_miss_max(self) -> int:
165
- return self.parameters.t_miss_max
170
+ return self.config.iou.t_miss_max
166
171
 
167
172
  def track_frame(
168
- self, frame: DetectedFrame, id_generator: ID_GENERATOR
173
+ self, frame: DetectedFrame, id_generator: IdGenerator
169
174
  ) -> TrackedFrame:
170
175
 
171
176
  detections = [d for d in frame.detections if d.conf >= self.sigma_l]
@@ -217,6 +222,7 @@ class IouTracker(Tracker):
217
222
  no=frame.no,
218
223
  occurrence=frame.occurrence,
219
224
  source=frame.source,
225
+ output=frame.output,
220
226
  detections=tracked_detections,
221
227
  image=frame.image,
222
228
  finished_tracks=set(finished_track_ids),
@@ -31,8 +31,7 @@ import numpy as np
31
31
  import pandas as pd
32
32
  from tqdm import tqdm
33
33
 
34
- from OTVision.config import (
35
- CONFIG,
34
+ from OTVision.application.config import (
36
35
  DEFAULT_FILETYPE,
37
36
  FILETYPES,
38
37
  OVERWRITE,
@@ -40,6 +39,7 @@ from OTVision.config import (
40
39
  TRACK,
41
40
  TRANSFORM,
42
41
  )
42
+ from OTVision.config import CONFIG
43
43
  from OTVision.helpers.files import (
44
44
  get_files,
45
45
  get_metadata,
OTVision/version.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "v0.6.4"
1
+ __version__ = "v0.6.6"
2
2
 
3
3
 
4
4
  def otdet_version() -> str:
@@ -0,0 +1,182 @@
1
+ Metadata-Version: 2.4
2
+ Name: OTVision
3
+ Version: 0.6.6
4
+ Summary: OTVision is a core module of the OpenTrafficCam framework to perform object detection and tracking.
5
+ Project-URL: Homepage, https://opentrafficcam.org/
6
+ Project-URL: Documentation, https://opentrafficcam.org/overview/
7
+ Project-URL: Repository, https://github.com/OpenTrafficCam/OTVision
8
+ Project-URL: Issues, https://github.com/OpenTrafficCam/OTVision/issues
9
+ Project-URL: Changelog, https://github.com/OpenTrafficCam/OTVision/releases
10
+ Author-email: OpenTrafficCam contributors <team@opentrafficcam.org>, platomo GmbH <info@platomo.de>
11
+ License-Expression: GPL-3.0-only
12
+ License-File: LICENSE
13
+ Keywords: OpenTrafficCam,Traffic Analysis,Traffic Counting,Trajectories
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Requires-Python: >=3.11
19
+ Requires-Dist: av==13.0.0
20
+ Requires-Dist: fire==0.7.0
21
+ Requires-Dist: geopandas==1.0.1
22
+ Requires-Dist: ijson==3.3.0
23
+ Requires-Dist: more-itertools==10.5.0
24
+ Requires-Dist: moviepy==1.0.3
25
+ Requires-Dist: numpy==1.26.4; sys_platform == 'win32'
26
+ Requires-Dist: numpy==2.1.1; sys_platform != 'win32'
27
+ Requires-Dist: opencv-python==4.10.0.84
28
+ Requires-Dist: pandas==2.2.3
29
+ Requires-Dist: pyyaml==6.0.2
30
+ Requires-Dist: setuptools==74.0.0
31
+ Requires-Dist: torch==2.3.1
32
+ Requires-Dist: torchvision==0.18.1
33
+ Requires-Dist: tqdm==4.67.1
34
+ Requires-Dist: ujson==5.10.0
35
+ Requires-Dist: ultralytics==8.3.94
36
+ Description-Content-Type: text/markdown
37
+
38
+ # OTVision
39
+
40
+ [![PyPI version](https://img.shields.io/pypi/v/OTVision.svg)](https://pypi.org/project/OTVision/)
41
+ [![Tests](https://github.com/OpenTrafficCam/OTVision/actions/workflows/test.yml/badge.svg?tag=latest)](https://github.com/OpenTrafficCam/OTVision/actions/workflows/test.yml?query=tag%3Alatest)
42
+ [![Tests](https://github.com/OpenTrafficCam/OTVision/actions/workflows/build-release.yml/badge.svg)](https://github.com/OpenTrafficCam/OTVision/actions/workflows/build-release.yml)
43
+
44
+ OTVision is a core module of the [OpenTrafficCam framework](https://github.com/OpenTrafficCam) designed to detect and track objects (road users) in videos recorded by [OTCamera](https://github.com/OpenTrafficCam/OTCamera) or other camera systems. The resulting trajectories can be used for traffic analysis using [OTAnalytics](https://github.com/OpenTrafficCam/OTAnalytics).
45
+
46
+ ## Features
47
+
48
+ - **Video Conversion**: Convert video files (h264 to mp4) with options to set frame rate and rotation
49
+ - **Object Detection**: Detect road users in videos using state-of-the-art YOLO models
50
+ - **Object Tracking**: Track detected objects through video frames using IOU-based tracking algorithms
51
+ - **Coordinate Transformation**: Transform pixel coordinates to real-world UTM coordinates
52
+
53
+ ## Requirements
54
+
55
+ ### System Requirements
56
+
57
+ - Python 3.12 or higher
58
+ - CUDA-capable GPU (recommended for faster processing)
59
+ - Dependencies listed in [requirements.txt](requirements.txt)
60
+
61
+ ## Installation
62
+
63
+ ### Installation from GitHub Releases
64
+
65
+ Pre-built releases are available on GitHub for easy installation:
66
+
67
+ 1. Go to the [OTVision Releases page](https://github.com/OpenTrafficCam/OTVision/releases) on GitHub
68
+ 2. Download the appropriate release for your platform:
69
+ - **Windows**: Choose between `otvision-win.zip` (standard) or `otvision-win-cuda.zip` (with CUDA support)
70
+ - **Linux**: Choose between `otvision-linux.zip` (standard) or `otvision-linux-cuda.zip` (with CUDA support)
71
+ - **macOS**: Choose `OTVision-macos.zip`
72
+ 3. Extract the downloaded ZIP file
73
+ 4. Run the installation script:
74
+ - On Windows: Double-click `install.cmd`
75
+ - On Linux: Run `./install.sh`
76
+ - On macOS: Double-click `install.command`
77
+
78
+ ### Manual Installation
79
+
80
+ 1. Clone the repository:
81
+
82
+ ```bash
83
+ git clone https://github.com/OpenTrafficCam/OTVision.git
84
+ cd OTVision
85
+ ```
86
+
87
+ 2. Install the package:
88
+ - On Windows:
89
+ ```cmd
90
+ install.cmd
91
+ ```
92
+ - On Linux/macOS:
93
+ ```bash
94
+ ./install.sh
95
+ ```
96
+
97
+ ### Manual Development Installation
98
+
99
+ For development purposes, if you want to contribute to the project:
100
+
101
+ 1. Clone the repository:
102
+
103
+ ```bash
104
+ git clone https://github.com/OpenTrafficCam/OTVision.git
105
+ cd OTVision
106
+ ```
107
+
108
+ 2. Install the development version:
109
+ - On Windows:
110
+ ```cmd
111
+ install_dev.cmd
112
+ ```
113
+ - On Linux/macOS:
114
+ ```bash
115
+ ./install_dev.sh
116
+ ```
117
+
118
+ ## Usage
119
+
120
+ OTVision provides several command-line scripts for different functionalities:
121
+
122
+ ### Video Conversion
123
+
124
+ Convert video files (e.g., h264 to mp4):
125
+
126
+ ```bash
127
+ python convert.py --paths /path/to/videos/*.h264 --input-fps 20.0 --rotation 0
128
+ ```
129
+
130
+ ### Object Detection
131
+
132
+ Detect objects in videos:
133
+
134
+ ```bash
135
+ python detect.py --paths /path/to/videos/*.mp4 --weights yolov8s
136
+ ```
137
+
138
+ ### Object Tracking
139
+
140
+ Track detected objects:
141
+
142
+ ```bash
143
+ python track.py --paths /path/to/detections/*.otdet
144
+ ```
145
+
146
+ ### Coordinate Transformation
147
+
148
+ Transform pixel coordinates to UTM coordinates:
149
+
150
+ ```bash
151
+ python transform.py --paths /path/to/tracks/*.ottrk --refpts-file /path/to/reference_points.json
152
+ ```
153
+
154
+ ### Configuration
155
+
156
+ OTVision can be configured using a YAML configuration file. A default configuration is provided in `user_config.otvision.yaml`. You can specify a custom configuration file using the `--config` option:
157
+
158
+ ```bash
159
+ python detect.py --config /path/to/custom_config.yaml
160
+ ```
161
+
162
+ ## Documentation
163
+
164
+ For detailed documentation, visit:
165
+
166
+ - [OTVision Documentation](https://opentrafficcam.org/OTVision/)
167
+ - [Getting Started Guide](https://opentrafficcam.org/OTVision/gettingstarted/firstuse/)
168
+ - [Requirements](https://opentrafficcam.org/OTVision/gettingstarted/requirements/)
169
+ - [Installation Guide](https://opentrafficcam.org/OTVision/gettingstarted/installation/)
170
+
171
+ ## Contributing
172
+
173
+ We appreciate your support in the form of both code and comments. Please have a look at the [contribute](https://opentrafficcam.org/contribute) section of the OpenTrafficCam documentation for guidelines on how to contribute to the project.
174
+
175
+ ## License
176
+
177
+ This software is licensed under the [GPL-3.0 License](LICENSE).
178
+
179
+ ## Contact
180
+
181
+ - GitHub: [https://github.com/OpenTrafficCam](https://github.com/OpenTrafficCam)
182
+ - Email: [team@opentrafficcam.org](mailto:team@opentrafficcam.org)