mapillary-tools 0.13.3a1__py3-none-any.whl → 0.14.0a2__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.
- mapillary_tools/__init__.py +1 -1
- mapillary_tools/api_v4.py +237 -16
- mapillary_tools/authenticate.py +325 -64
- mapillary_tools/{geotag/blackvue_parser.py → blackvue_parser.py} +74 -54
- mapillary_tools/camm/camm_builder.py +55 -97
- mapillary_tools/camm/camm_parser.py +429 -181
- mapillary_tools/commands/__main__.py +12 -6
- mapillary_tools/commands/authenticate.py +8 -1
- mapillary_tools/commands/process.py +27 -51
- mapillary_tools/commands/process_and_upload.py +19 -5
- mapillary_tools/commands/sample_video.py +2 -3
- mapillary_tools/commands/upload.py +18 -9
- mapillary_tools/commands/video_process_and_upload.py +19 -5
- mapillary_tools/config.py +31 -13
- mapillary_tools/constants.py +47 -6
- mapillary_tools/exceptions.py +34 -35
- mapillary_tools/exif_read.py +221 -116
- mapillary_tools/exif_write.py +7 -7
- mapillary_tools/exiftool_read.py +33 -42
- mapillary_tools/exiftool_read_video.py +46 -33
- mapillary_tools/exiftool_runner.py +77 -0
- mapillary_tools/ffmpeg.py +24 -23
- mapillary_tools/geo.py +144 -120
- mapillary_tools/geotag/base.py +147 -0
- mapillary_tools/geotag/factory.py +291 -0
- mapillary_tools/geotag/geotag_images_from_exif.py +14 -131
- mapillary_tools/geotag/geotag_images_from_exiftool.py +126 -82
- mapillary_tools/geotag/geotag_images_from_gpx.py +53 -118
- mapillary_tools/geotag/geotag_images_from_gpx_file.py +13 -126
- mapillary_tools/geotag/geotag_images_from_nmea_file.py +4 -5
- mapillary_tools/geotag/geotag_images_from_video.py +53 -51
- mapillary_tools/geotag/geotag_videos_from_exiftool.py +97 -0
- mapillary_tools/geotag/geotag_videos_from_gpx.py +39 -0
- mapillary_tools/geotag/geotag_videos_from_video.py +20 -185
- mapillary_tools/geotag/image_extractors/base.py +18 -0
- mapillary_tools/geotag/image_extractors/exif.py +60 -0
- mapillary_tools/geotag/image_extractors/exiftool.py +18 -0
- mapillary_tools/geotag/options.py +160 -0
- mapillary_tools/geotag/utils.py +52 -16
- mapillary_tools/geotag/video_extractors/base.py +18 -0
- mapillary_tools/geotag/video_extractors/exiftool.py +70 -0
- mapillary_tools/{video_data_extraction/extractors/gpx_parser.py → geotag/video_extractors/gpx.py} +57 -39
- mapillary_tools/geotag/video_extractors/native.py +157 -0
- mapillary_tools/{geotag → gpmf}/gpmf_parser.py +205 -182
- mapillary_tools/{geotag → gpmf}/gps_filter.py +5 -3
- mapillary_tools/history.py +7 -13
- mapillary_tools/mp4/construct_mp4_parser.py +9 -8
- mapillary_tools/mp4/io_utils.py +0 -1
- mapillary_tools/mp4/mp4_sample_parser.py +36 -28
- mapillary_tools/mp4/simple_mp4_builder.py +10 -9
- mapillary_tools/mp4/simple_mp4_parser.py +13 -22
- mapillary_tools/process_geotag_properties.py +155 -392
- mapillary_tools/process_sequence_properties.py +562 -208
- mapillary_tools/sample_video.py +13 -20
- mapillary_tools/telemetry.py +26 -13
- mapillary_tools/types.py +111 -58
- mapillary_tools/upload.py +316 -298
- mapillary_tools/upload_api_v4.py +55 -122
- mapillary_tools/uploader.py +396 -254
- mapillary_tools/utils.py +42 -18
- {mapillary_tools-0.13.3a1.dist-info → mapillary_tools-0.14.0a2.dist-info}/METADATA +3 -2
- mapillary_tools-0.14.0a2.dist-info/RECORD +72 -0
- {mapillary_tools-0.13.3a1.dist-info → mapillary_tools-0.14.0a2.dist-info}/WHEEL +1 -1
- mapillary_tools/geotag/__init__.py +0 -1
- mapillary_tools/geotag/geotag_from_generic.py +0 -22
- mapillary_tools/geotag/geotag_images_from_exiftool_both_image_and_video.py +0 -93
- mapillary_tools/geotag/geotag_videos_from_exiftool_video.py +0 -145
- mapillary_tools/video_data_extraction/cli_options.py +0 -22
- mapillary_tools/video_data_extraction/extract_video_data.py +0 -176
- mapillary_tools/video_data_extraction/extractors/base_parser.py +0 -75
- mapillary_tools/video_data_extraction/extractors/blackvue_parser.py +0 -34
- mapillary_tools/video_data_extraction/extractors/camm_parser.py +0 -38
- mapillary_tools/video_data_extraction/extractors/exiftool_runtime_parser.py +0 -71
- mapillary_tools/video_data_extraction/extractors/exiftool_xml_parser.py +0 -53
- mapillary_tools/video_data_extraction/extractors/generic_video_parser.py +0 -52
- mapillary_tools/video_data_extraction/extractors/gopro_parser.py +0 -43
- mapillary_tools/video_data_extraction/extractors/nmea_parser.py +0 -24
- mapillary_tools/video_data_extraction/video_data_parser_factory.py +0 -39
- mapillary_tools-0.13.3a1.dist-info/RECORD +0 -75
- /mapillary_tools/{geotag → gpmf}/gpmf_gps_filter.py +0 -0
- {mapillary_tools-0.13.3a1.dist-info → mapillary_tools-0.14.0a2.dist-info}/entry_points.txt +0 -0
- {mapillary_tools-0.13.3a1.dist-info → mapillary_tools-0.14.0a2.dist-info/licenses}/LICENSE +0 -0
- {mapillary_tools-0.13.3a1.dist-info → mapillary_tools-0.14.0a2.dist-info}/top_level.txt +0 -0
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import abc
|
|
2
|
-
import functools
|
|
3
|
-
import logging
|
|
4
|
-
import os
|
|
5
|
-
import typing as T
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
from ... import geo
|
|
9
|
-
from ..cli_options import CliOptions, CliParserOptions
|
|
10
|
-
|
|
11
|
-
LOG = logging.getLogger(__name__)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class BaseParser(metaclass=abc.ABCMeta):
|
|
15
|
-
videoPath: Path
|
|
16
|
-
options: CliOptions
|
|
17
|
-
parserOptions: CliParserOptions
|
|
18
|
-
|
|
19
|
-
def __init__(
|
|
20
|
-
self, video_path: Path, options: CliOptions, parser_options: CliParserOptions
|
|
21
|
-
) -> None:
|
|
22
|
-
self.videoPath = video_path
|
|
23
|
-
self.options = options
|
|
24
|
-
self.parserOptions = parser_options
|
|
25
|
-
|
|
26
|
-
@property
|
|
27
|
-
@abc.abstractmethod
|
|
28
|
-
def default_source_pattern(self) -> str:
|
|
29
|
-
raise NotImplementedError
|
|
30
|
-
|
|
31
|
-
@property
|
|
32
|
-
@abc.abstractmethod
|
|
33
|
-
def parser_label(self) -> str:
|
|
34
|
-
raise NotImplementedError
|
|
35
|
-
|
|
36
|
-
@abc.abstractmethod
|
|
37
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
38
|
-
raise NotImplementedError
|
|
39
|
-
|
|
40
|
-
@abc.abstractmethod
|
|
41
|
-
def extract_make(self) -> T.Optional[str]:
|
|
42
|
-
raise NotImplementedError
|
|
43
|
-
|
|
44
|
-
@abc.abstractmethod
|
|
45
|
-
def extract_model(self) -> T.Optional[str]:
|
|
46
|
-
raise NotImplementedError
|
|
47
|
-
|
|
48
|
-
@functools.cached_property
|
|
49
|
-
def geotag_source_path(self) -> T.Optional[Path]:
|
|
50
|
-
video_dir = self.videoPath.parent.resolve()
|
|
51
|
-
video_filename = self.videoPath.name
|
|
52
|
-
video_basename, video_ext = os.path.splitext(video_filename)
|
|
53
|
-
pattern = self.parserOptions.get("pattern") or self.default_source_pattern
|
|
54
|
-
|
|
55
|
-
replaced = Path(
|
|
56
|
-
pattern.replace("%f", video_filename)
|
|
57
|
-
.replace("%g", video_basename)
|
|
58
|
-
.replace("%e", video_ext)
|
|
59
|
-
)
|
|
60
|
-
abs_path = (
|
|
61
|
-
replaced if replaced.is_absolute() else Path.joinpath(video_dir, replaced)
|
|
62
|
-
).resolve()
|
|
63
|
-
|
|
64
|
-
return abs_path if abs_path.is_file() else None
|
|
65
|
-
|
|
66
|
-
@staticmethod
|
|
67
|
-
def _rebase_times(points: T.Sequence[geo.Point], offset: float = 0.0):
|
|
68
|
-
"""
|
|
69
|
-
Make point times start from 0
|
|
70
|
-
"""
|
|
71
|
-
if points:
|
|
72
|
-
first_timestamp = points[0].time
|
|
73
|
-
for p in points:
|
|
74
|
-
p.time = (p.time - first_timestamp) + offset
|
|
75
|
-
return points
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import typing as T
|
|
2
|
-
|
|
3
|
-
from ... import geo
|
|
4
|
-
from ...geotag import blackvue_parser
|
|
5
|
-
from ...mp4 import simple_mp4_parser as sparser
|
|
6
|
-
from .base_parser import BaseParser
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class BlackVueParser(BaseParser):
|
|
10
|
-
default_source_pattern = "%f"
|
|
11
|
-
must_rebase_times_to_zero = False
|
|
12
|
-
parser_label = "blackvue"
|
|
13
|
-
|
|
14
|
-
pointsFound: bool = False
|
|
15
|
-
|
|
16
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
17
|
-
source_path = self.geotag_source_path
|
|
18
|
-
if not source_path:
|
|
19
|
-
return []
|
|
20
|
-
with source_path.open("rb") as fp:
|
|
21
|
-
try:
|
|
22
|
-
points = blackvue_parser.extract_points(fp) or []
|
|
23
|
-
self.pointsFound = len(points) > 0
|
|
24
|
-
return points
|
|
25
|
-
except sparser.ParsingError:
|
|
26
|
-
return []
|
|
27
|
-
|
|
28
|
-
def extract_make(self) -> T.Optional[str]:
|
|
29
|
-
# If no points were found, assume this is not a BlackVue
|
|
30
|
-
return "Blackvue" if self.pointsFound else None
|
|
31
|
-
|
|
32
|
-
def extract_model(self) -> T.Optional[str]:
|
|
33
|
-
with self.videoPath.open("rb") as fp:
|
|
34
|
-
return blackvue_parser.extract_camera_model(fp) or None
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import functools
|
|
2
|
-
import typing as T
|
|
3
|
-
|
|
4
|
-
from ... import geo
|
|
5
|
-
from ...camm import camm_parser
|
|
6
|
-
from ...mp4 import simple_mp4_parser as sparser
|
|
7
|
-
from .base_parser import BaseParser
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class CammParser(BaseParser):
|
|
11
|
-
default_source_pattern = "%f"
|
|
12
|
-
must_rebase_times_to_zero = False
|
|
13
|
-
parser_label = "camm"
|
|
14
|
-
|
|
15
|
-
@functools.cached_property
|
|
16
|
-
def _camera_info(self) -> T.Tuple[str, str]:
|
|
17
|
-
source_path = self.geotag_source_path
|
|
18
|
-
if not source_path:
|
|
19
|
-
return "", ""
|
|
20
|
-
|
|
21
|
-
with source_path.open("rb") as fp:
|
|
22
|
-
return camm_parser.extract_camera_make_and_model(fp)
|
|
23
|
-
|
|
24
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
25
|
-
source_path = self.geotag_source_path
|
|
26
|
-
if not source_path:
|
|
27
|
-
return []
|
|
28
|
-
with source_path.open("rb") as fp:
|
|
29
|
-
try:
|
|
30
|
-
return camm_parser.extract_points(fp) or []
|
|
31
|
-
except sparser.ParsingError:
|
|
32
|
-
return []
|
|
33
|
-
|
|
34
|
-
def extract_make(self) -> T.Optional[str]:
|
|
35
|
-
return self._camera_info[0] or None
|
|
36
|
-
|
|
37
|
-
def extract_model(self) -> T.Optional[str]:
|
|
38
|
-
return self._camera_info[1] or None
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import shutil
|
|
2
|
-
import subprocess
|
|
3
|
-
import typing as T
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
|
|
6
|
-
from ... import constants, exceptions, geo
|
|
7
|
-
from ..cli_options import CliOptions, CliParserOptions
|
|
8
|
-
from .base_parser import BaseParser
|
|
9
|
-
from .exiftool_xml_parser import ExiftoolXmlParser
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ExiftoolRuntimeParser(BaseParser):
|
|
13
|
-
"""
|
|
14
|
-
Wrapper around ExiftoolRdfParser that executes exiftool
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
exiftoolXmlParser: ExiftoolXmlParser
|
|
18
|
-
|
|
19
|
-
default_source_pattern = "%f"
|
|
20
|
-
must_rebase_times_to_zero = True
|
|
21
|
-
parser_label = "exiftool_runtime"
|
|
22
|
-
|
|
23
|
-
def __init__(
|
|
24
|
-
self, video_path: Path, options: CliOptions, parser_options: CliParserOptions
|
|
25
|
-
):
|
|
26
|
-
super().__init__(video_path, options, parser_options)
|
|
27
|
-
exiftool_path = shutil.which(constants.EXIFTOOL_PATH)
|
|
28
|
-
|
|
29
|
-
if not exiftool_path:
|
|
30
|
-
raise exceptions.MapillaryExiftoolNotFoundError(
|
|
31
|
-
"Cannot execute exiftool. Please install it from https://exiftool.org/ or you package manager, or set the environment variable MAPILLARY_TOOLS_EXIFTOOL_PATH"
|
|
32
|
-
)
|
|
33
|
-
if not self.geotag_source_path:
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
# To handle non-latin1 filenames under Windows, we pass the path
|
|
37
|
-
# via stdin. See https://exiftool.org/faq.html#Q18
|
|
38
|
-
stdin = str(self.geotag_source_path)
|
|
39
|
-
args = [
|
|
40
|
-
exiftool_path,
|
|
41
|
-
"-q",
|
|
42
|
-
"-r",
|
|
43
|
-
"-n",
|
|
44
|
-
"-ee",
|
|
45
|
-
"-api",
|
|
46
|
-
"LargeFileSupport=1",
|
|
47
|
-
"-X",
|
|
48
|
-
"-charset",
|
|
49
|
-
"filename=utf8",
|
|
50
|
-
"-@",
|
|
51
|
-
"-",
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
process = subprocess.run(
|
|
55
|
-
args, capture_output=True, text=True, input=stdin, encoding="utf-8"
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
self.exiftoolXmlParser = ExiftoolXmlParser(
|
|
59
|
-
video_path, options, parser_options, process.stdout
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
63
|
-
return self.exiftoolXmlParser.extract_points() if self.exiftoolXmlParser else []
|
|
64
|
-
|
|
65
|
-
def extract_make(self) -> T.Optional[str]:
|
|
66
|
-
return self.exiftoolXmlParser.extract_make() if self.exiftoolXmlParser else None
|
|
67
|
-
|
|
68
|
-
def extract_model(self) -> T.Optional[str]:
|
|
69
|
-
return (
|
|
70
|
-
self.exiftoolXmlParser.extract_model() if self.exiftoolXmlParser else None
|
|
71
|
-
)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import typing as T
|
|
2
|
-
import xml.etree.ElementTree as ET
|
|
3
|
-
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
|
|
6
|
-
from ... import geo
|
|
7
|
-
from ...exiftool_read import EXIFTOOL_NAMESPACES
|
|
8
|
-
from ...exiftool_read_video import ExifToolReadVideo
|
|
9
|
-
from ...geotag.geotag_videos_from_exiftool_video import _DESCRIPTION_TAG
|
|
10
|
-
from ..cli_options import CliOptions, CliParserOptions
|
|
11
|
-
from .base_parser import BaseParser
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class ExiftoolXmlParser(BaseParser):
|
|
15
|
-
default_source_pattern = "%g.xml"
|
|
16
|
-
parser_label = "exiftool_xml"
|
|
17
|
-
|
|
18
|
-
exifToolReadVideo: T.Optional[ExifToolReadVideo] = None
|
|
19
|
-
|
|
20
|
-
def __init__(
|
|
21
|
-
self,
|
|
22
|
-
video_path: Path,
|
|
23
|
-
options: CliOptions,
|
|
24
|
-
parser_options: CliParserOptions,
|
|
25
|
-
xml_content: T.Optional[str] = None,
|
|
26
|
-
) -> None:
|
|
27
|
-
super().__init__(video_path, options, parser_options)
|
|
28
|
-
|
|
29
|
-
if xml_content:
|
|
30
|
-
etree = ET.fromstring(xml_content)
|
|
31
|
-
else:
|
|
32
|
-
xml_path = self.geotag_source_path
|
|
33
|
-
if not xml_path:
|
|
34
|
-
return
|
|
35
|
-
etree = ET.parse(xml_path).getroot()
|
|
36
|
-
|
|
37
|
-
element = next(etree.iterfind(_DESCRIPTION_TAG, namespaces=EXIFTOOL_NAMESPACES))
|
|
38
|
-
self.exifToolReadVideo = ExifToolReadVideo(ET.ElementTree(element))
|
|
39
|
-
|
|
40
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
41
|
-
gps_points = (
|
|
42
|
-
self.exifToolReadVideo.extract_gps_track() if self.exifToolReadVideo else []
|
|
43
|
-
)
|
|
44
|
-
self._rebase_times(gps_points)
|
|
45
|
-
return gps_points
|
|
46
|
-
|
|
47
|
-
def extract_make(self) -> T.Optional[str]:
|
|
48
|
-
return self.exifToolReadVideo.extract_make() if self.exifToolReadVideo else None
|
|
49
|
-
|
|
50
|
-
def extract_model(self) -> T.Optional[str]:
|
|
51
|
-
return (
|
|
52
|
-
self.exifToolReadVideo.extract_model() if self.exifToolReadVideo else None
|
|
53
|
-
)
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import typing as T
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
from ... import geo
|
|
5
|
-
from ..cli_options import CliOptions, CliParserOptions
|
|
6
|
-
from .base_parser import BaseParser
|
|
7
|
-
from .blackvue_parser import BlackVueParser
|
|
8
|
-
from .camm_parser import CammParser
|
|
9
|
-
from .gopro_parser import GoProParser
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class GenericVideoParser(BaseParser):
|
|
13
|
-
"""
|
|
14
|
-
Wrapper around the three native video parsers. It will try to execute them
|
|
15
|
-
in the order camm-gopro-blackvue, like the previous implementation
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
parsers: T.Sequence[BaseParser] = []
|
|
19
|
-
|
|
20
|
-
default_source_pattern = "%f"
|
|
21
|
-
must_rebase_times_to_zero = False
|
|
22
|
-
parser_label = "video"
|
|
23
|
-
|
|
24
|
-
def __init__(
|
|
25
|
-
self, video_path: Path, options: CliOptions, parser_options: CliParserOptions
|
|
26
|
-
) -> None:
|
|
27
|
-
super().__init__(video_path, options, parser_options)
|
|
28
|
-
camm_parser = CammParser(video_path, options, parser_options)
|
|
29
|
-
gopro_parser = GoProParser(video_path, options, parser_options)
|
|
30
|
-
blackvue_parser = BlackVueParser(video_path, options, parser_options)
|
|
31
|
-
self.parsers = [camm_parser, gopro_parser, blackvue_parser]
|
|
32
|
-
|
|
33
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
34
|
-
for parser in self.parsers:
|
|
35
|
-
points = parser.extract_points()
|
|
36
|
-
if points:
|
|
37
|
-
return points
|
|
38
|
-
return []
|
|
39
|
-
|
|
40
|
-
def extract_make(self) -> T.Optional[str]:
|
|
41
|
-
for parser in self.parsers:
|
|
42
|
-
make = parser.extract_make()
|
|
43
|
-
if make:
|
|
44
|
-
return make
|
|
45
|
-
return None
|
|
46
|
-
|
|
47
|
-
def extract_model(self) -> T.Optional[str]:
|
|
48
|
-
for parser in self.parsers:
|
|
49
|
-
model = parser.extract_model()
|
|
50
|
-
if model:
|
|
51
|
-
return model
|
|
52
|
-
return None
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import typing as T
|
|
2
|
-
|
|
3
|
-
from ... import geo
|
|
4
|
-
from ...geotag import gpmf_parser
|
|
5
|
-
from ...mp4 import simple_mp4_parser as sparser
|
|
6
|
-
from .base_parser import BaseParser
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class GoProParser(BaseParser):
|
|
10
|
-
default_source_pattern = "%f"
|
|
11
|
-
must_rebase_times_to_zero = False
|
|
12
|
-
parser_label = "gopro"
|
|
13
|
-
|
|
14
|
-
pointsFound: bool = False
|
|
15
|
-
|
|
16
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
17
|
-
source_path = self.geotag_source_path
|
|
18
|
-
if not source_path:
|
|
19
|
-
return []
|
|
20
|
-
with source_path.open("rb") as fp:
|
|
21
|
-
try:
|
|
22
|
-
points = gpmf_parser.extract_points(fp) or []
|
|
23
|
-
self.pointsFound = len(points) > 0
|
|
24
|
-
return points
|
|
25
|
-
except sparser.ParsingError:
|
|
26
|
-
return []
|
|
27
|
-
|
|
28
|
-
def extract_make(self) -> T.Optional[str]:
|
|
29
|
-
model = self.extract_model()
|
|
30
|
-
if model:
|
|
31
|
-
return "GoPro"
|
|
32
|
-
|
|
33
|
-
# make sure self.pointsFound is updated
|
|
34
|
-
_ = self.extract_points()
|
|
35
|
-
# If no points were found, assume this is not a GoPro
|
|
36
|
-
return "GoPro" if self.pointsFound else None
|
|
37
|
-
|
|
38
|
-
def extract_model(self) -> T.Optional[str]:
|
|
39
|
-
source_path = self.geotag_source_path
|
|
40
|
-
if not source_path:
|
|
41
|
-
return None
|
|
42
|
-
with source_path.open("rb") as fp:
|
|
43
|
-
return gpmf_parser.extract_camera_model(fp) or None
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import typing as T
|
|
2
|
-
|
|
3
|
-
from ... import geo
|
|
4
|
-
from ...geotag import geotag_images_from_nmea_file
|
|
5
|
-
from .base_parser import BaseParser
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class NmeaParser(BaseParser):
|
|
9
|
-
default_source_pattern = "%g.nmea"
|
|
10
|
-
must_rebase_times_to_zero = True
|
|
11
|
-
parser_label = "nmea"
|
|
12
|
-
|
|
13
|
-
def extract_points(self) -> T.Sequence[geo.Point]:
|
|
14
|
-
source_path = self.geotag_source_path
|
|
15
|
-
if not source_path:
|
|
16
|
-
return []
|
|
17
|
-
points = geotag_images_from_nmea_file.get_lat_lon_time_from_nmea(source_path)
|
|
18
|
-
return points
|
|
19
|
-
|
|
20
|
-
def extract_make(self) -> T.Optional[str]:
|
|
21
|
-
return None
|
|
22
|
-
|
|
23
|
-
def extract_model(self) -> T.Optional[str]:
|
|
24
|
-
return None
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import typing as T
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
from .cli_options import CliOptions
|
|
5
|
-
|
|
6
|
-
from .extractors.base_parser import BaseParser
|
|
7
|
-
|
|
8
|
-
from .extractors.blackvue_parser import BlackVueParser
|
|
9
|
-
from .extractors.camm_parser import CammParser
|
|
10
|
-
|
|
11
|
-
from .extractors.exiftool_runtime_parser import ExiftoolRuntimeParser
|
|
12
|
-
from .extractors.exiftool_xml_parser import ExiftoolXmlParser
|
|
13
|
-
from .extractors.generic_video_parser import GenericVideoParser
|
|
14
|
-
from .extractors.gopro_parser import GoProParser
|
|
15
|
-
from .extractors.gpx_parser import GpxParser
|
|
16
|
-
from .extractors.nmea_parser import NmeaParser
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
known_parsers = {
|
|
20
|
-
"gpx": GpxParser,
|
|
21
|
-
"nmea": NmeaParser,
|
|
22
|
-
"exiftool_xml": ExiftoolXmlParser,
|
|
23
|
-
"exiftool_runtime": ExiftoolRuntimeParser,
|
|
24
|
-
"camm": CammParser,
|
|
25
|
-
"blackvue": BlackVueParser,
|
|
26
|
-
"gopro": GoProParser,
|
|
27
|
-
"video": GenericVideoParser,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def make_parsers(file: Path, options: CliOptions) -> T.Sequence[BaseParser]:
|
|
32
|
-
src_options = options["geotag_sources_options"]
|
|
33
|
-
parsers = [
|
|
34
|
-
known_parsers[s["source"]](file, options, s)
|
|
35
|
-
for s in src_options
|
|
36
|
-
if s["source"] in known_parsers
|
|
37
|
-
]
|
|
38
|
-
|
|
39
|
-
return parsers
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
mapillary_tools/__init__.py,sha256=j5y1cIo14OOuS27ROUABVHN9119rEXV-bdoM-z117o8,21
|
|
2
|
-
mapillary_tools/api_v4.py,sha256=zhRtgx3EnzgqtjziRhvFq3ONvsPaB9hROsuKFcf_pFo,5197
|
|
3
|
-
mapillary_tools/authenticate.py,sha256=LCFcs6LqZmXaYkTUEKgGfmqytWdh5v_L3KXB48ojOZ4,3090
|
|
4
|
-
mapillary_tools/config.py,sha256=jCjaK4jJaTY4AV4qf_b_tcxn5LA_uPsEWlGIdm2zw6g,2103
|
|
5
|
-
mapillary_tools/constants.py,sha256=KKQMwzpN2z7wka6lhZv-agdxNldaEQqvQXu3Kg5XuUk,2453
|
|
6
|
-
mapillary_tools/exceptions.py,sha256=Mh1tgVEFTSMnYEzrl9x7b95fW9Z3SPVD_YMEl7r8I0I,2693
|
|
7
|
-
mapillary_tools/exif_read.py,sha256=F60A0-T8XSBHvFKgVIrUz_ZWKQrTFWrtj3c6siB0IMg,28707
|
|
8
|
-
mapillary_tools/exif_write.py,sha256=3PawLnBOY8Z86TYiA_F4LxRhe5Ui6CTNhxYm9yeJNX8,8786
|
|
9
|
-
mapillary_tools/exiftool_read.py,sha256=Mg027me1IzblKb9IyGaLgU6goFqk_QiOt0Ppq-CeECg,16288
|
|
10
|
-
mapillary_tools/exiftool_read_video.py,sha256=f3l8HiDjkrIhmslIXSsC8cNgkqCVWUFkN_0OQ5ZUd-U,14431
|
|
11
|
-
mapillary_tools/ffmpeg.py,sha256=p1a5VxlbpLGLkzulMv51bpyD5omwK7Qg8277TGYmcZA,15780
|
|
12
|
-
mapillary_tools/geo.py,sha256=QybCiQr0UDcH6DIDa2L6cZw4sDoTJNgR99oo6S7gCts,9746
|
|
13
|
-
mapillary_tools/history.py,sha256=l2z3YdYRyBGEOvcqcLExTV-0LUAX3iBq2OdBzLNMHLM,1766
|
|
14
|
-
mapillary_tools/ipc.py,sha256=DwWQb9hNshx0bg0Fo5NjY0mXjs-FkbR6tIQmjMgMtmg,1089
|
|
15
|
-
mapillary_tools/process_geotag_properties.py,sha256=w4hhv_c4sRydCK9QCO50sT2yo2zeVlY7dSdXQ93InFc,23159
|
|
16
|
-
mapillary_tools/process_sequence_properties.py,sha256=5oYEjz9crnLVQtCkxbwn57TkeuHFbBh_zQXQSA4ENWg,11561
|
|
17
|
-
mapillary_tools/sample_video.py,sha256=dpdX7bUNEmcrz-3gh3Y3awnTDX66pChbTKuF8qGfeCI,14400
|
|
18
|
-
mapillary_tools/telemetry.py,sha256=WpBGPF_GMPjM_EFqXIutFtpDFL9wj7yEzGNGnfQZUo8,1255
|
|
19
|
-
mapillary_tools/types.py,sha256=6kww2UdKM6YzabYbc862BYzEWtxL2hhxCRFfeDiUtF0,22074
|
|
20
|
-
mapillary_tools/upload.py,sha256=8dQ3ZWsjau1_xZN3ssjGGkBnLKbKIhjC91-zWstYlD8,24439
|
|
21
|
-
mapillary_tools/upload_api_v4.py,sha256=VXIAA_lar4y4RgvNuKpkE7CVl4uWa6kNT59hCVFClSk,8490
|
|
22
|
-
mapillary_tools/uploader.py,sha256=DBHso4QIP5nsZFDynLjkUvytzwpEOPnOlfeDyA6rTBk,14007
|
|
23
|
-
mapillary_tools/utils.py,sha256=VNtK1tAb3Hh8y3P5e5Y3iewREkIoLDa3C2myRYcF2lY,5970
|
|
24
|
-
mapillary_tools/camm/camm_builder.py,sha256=TXZfhu3xGjtrLEWnB14D7aSOrHOoSJef24YSLApiIfY,10631
|
|
25
|
-
mapillary_tools/camm/camm_parser.py,sha256=RaCWeLvS_AyHD6B6wDUu9DAsdfByVHMAPTqEqjtFibE,9734
|
|
26
|
-
mapillary_tools/commands/__init__.py,sha256=41CFrPLGlG3566uhxssEF3TGAtSpADFPPcDMHbViU0E,171
|
|
27
|
-
mapillary_tools/commands/__main__.py,sha256=VdWkx1ekPH-88Ybe78IcO9FWpZ5cUhsbGRw7LuzQObU,4832
|
|
28
|
-
mapillary_tools/commands/authenticate.py,sha256=4aVvAQal_mqtm2NEMBt5aKLahi0iRdO8b7WSBf6jokA,1136
|
|
29
|
-
mapillary_tools/commands/process.py,sha256=VxcvQpYHPw7QfT9dNwBLV1jWQ-1w4GtVNVPpmu4Sx9s,10578
|
|
30
|
-
mapillary_tools/commands/process_and_upload.py,sha256=osJv1TVHYAG5E-EsA0nB1F3RkKXMadLR2t1EGK0Ifqw,654
|
|
31
|
-
mapillary_tools/commands/sample_video.py,sha256=bTJmlDsajkC-QJ_ZO_scdD4R664zs-r_dh-x2PlOgyY,3281
|
|
32
|
-
mapillary_tools/commands/upload.py,sha256=JIWgxupV3ppLvPi1iE7UVaE1302JGcIOvnuNt1Y7YEw,1671
|
|
33
|
-
mapillary_tools/commands/video_process.py,sha256=-wQeeIwWXPmy81HQHam5A0huMLRHknkEFa_V1OwElU4,890
|
|
34
|
-
mapillary_tools/commands/video_process_and_upload.py,sha256=llV0dHBS31qPZp-Fs1GCM0yYezEA_VF_tfYcp-Z8NkY,701
|
|
35
|
-
mapillary_tools/commands/zip.py,sha256=DVQuMLpbstwiy5o4pU_fBvM6eORuFjLeySd80AhHKU0,991
|
|
36
|
-
mapillary_tools/geotag/__init__.py,sha256=ohud7lLsqO1b9ddCF0SjrNOcUcRdQzNVR43RkcVVLAc,33
|
|
37
|
-
mapillary_tools/geotag/blackvue_parser.py,sha256=_LTI_biiznFPvrk5dcpoDH4tP4_7khPIpW5Daumuf68,2968
|
|
38
|
-
mapillary_tools/geotag/geotag_from_generic.py,sha256=bCYfIbkv4qIlkKttAjSGl9t4i_QAtzIiCZoth1hMVI4,480
|
|
39
|
-
mapillary_tools/geotag/geotag_images_from_exif.py,sha256=hCgBwZABk2tbBQC3cHQBV5pvNwlAo8AkWSgCD0BU_QU,4823
|
|
40
|
-
mapillary_tools/geotag/geotag_images_from_exiftool.py,sha256=a-c4H8VIyPdJkfUIvJho0phR0QU0zN8-lSyiCz0wc4s,3981
|
|
41
|
-
mapillary_tools/geotag/geotag_images_from_exiftool_both_image_and_video.py,sha256=nRVAjgTJwx_eCaSBpPCgcIaZs3EYgGueYxSS9XhKv40,3350
|
|
42
|
-
mapillary_tools/geotag/geotag_images_from_gpx.py,sha256=S9Pw6FvP5kRSpHUnKUYKXmw0CHa9V92UmrS_MJfbjS4,9053
|
|
43
|
-
mapillary_tools/geotag/geotag_images_from_gpx_file.py,sha256=-vTbZ1HufZzJCd8VvukdTjsJRcymtfld2W5t65VSG5E,5300
|
|
44
|
-
mapillary_tools/geotag/geotag_images_from_nmea_file.py,sha256=dDdHnJInQ_WN3ZRf-w44NSBElDLPs7XYBiimvE2iCNo,1651
|
|
45
|
-
mapillary_tools/geotag/geotag_images_from_video.py,sha256=XsaWOFChGItl-j1UbKM4hNjUqN29pVNbMpGT_BvI-o8,3306
|
|
46
|
-
mapillary_tools/geotag/geotag_videos_from_exiftool_video.py,sha256=fkkWou1WFt3ft024399vis9No2cxrwot7Pg5HBw7o7s,5225
|
|
47
|
-
mapillary_tools/geotag/geotag_videos_from_video.py,sha256=mqBZKUEkqT96nOzl5LJxzzTKuKsnAkMK5lH8k3oY3YE,7330
|
|
48
|
-
mapillary_tools/geotag/gpmf_gps_filter.py,sha256=7cg8wEjC1DrujKY76FZguXsaPqTRkG9-t32OeuOJQIc,2755
|
|
49
|
-
mapillary_tools/geotag/gpmf_parser.py,sha256=6Q38oeSd2kHTs44Fzpg9R555EbQqdd5QcIuIZdG4z_o,23233
|
|
50
|
-
mapillary_tools/geotag/gps_filter.py,sha256=4CPL8glxdzPWIbfGPPgyqMLyiZFt-djce5vhiFPuZB8,3766
|
|
51
|
-
mapillary_tools/geotag/utils.py,sha256=Orl35Df4ypxj4v6Lu1Mhk9d2XZxa8yNffz1s1C0JZsQ,651
|
|
52
|
-
mapillary_tools/mp4/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
-
mapillary_tools/mp4/construct_mp4_parser.py,sha256=31oJbg6umKJjdZ0Ni5eCudC0lXd0Y-K_EiCCj6yW9js,17199
|
|
54
|
-
mapillary_tools/mp4/io_utils.py,sha256=wc3-F1TnxZjTwB7-oea5yRmRQ_0T3Zbz8oBkW9JL8d4,5454
|
|
55
|
-
mapillary_tools/mp4/mp4_sample_parser.py,sha256=YnTIIHGHL3ViLo_Ap0C2hk8MDWbWtvSXBLD42pRIWqY,11337
|
|
56
|
-
mapillary_tools/mp4/simple_mp4_builder.py,sha256=7zVepmW-2SwoAeA-fvucmBW94jlcCFExDcEg8P3TOGY,12727
|
|
57
|
-
mapillary_tools/mp4/simple_mp4_parser.py,sha256=eji6JZa497wK8CY8hQt21fjgtnd0nzuyBx7MPEKST74,6671
|
|
58
|
-
mapillary_tools/video_data_extraction/cli_options.py,sha256=N0uHi9Uzaw1C8N-PE3yu8J3uEQP3HvSjJ9AZbIqoREg,535
|
|
59
|
-
mapillary_tools/video_data_extraction/extract_video_data.py,sha256=_2BBdSYeYKR4BCHAZa1Jzo7OIK_va1lJDkTU2sXsPc0,6000
|
|
60
|
-
mapillary_tools/video_data_extraction/video_data_parser_factory.py,sha256=qaJHvLgwI5lukJncMd8ggxeSxXOiVzBSJO5GlGQYiXY,1134
|
|
61
|
-
mapillary_tools/video_data_extraction/extractors/base_parser.py,sha256=s7Xuwg4I5JZ27oL4ebMSdo093plAXfZ-6uDQ_h97WHY,2134
|
|
62
|
-
mapillary_tools/video_data_extraction/extractors/blackvue_parser.py,sha256=jAcGyF6PML2EdJ4zle8cR12QeTRZc5qxlz8_4gcTZPU,1089
|
|
63
|
-
mapillary_tools/video_data_extraction/extractors/camm_parser.py,sha256=YMiViocXSVlfn8_qm1jcwSJhnnEaK8v5ADHwo2YXe10,1117
|
|
64
|
-
mapillary_tools/video_data_extraction/extractors/exiftool_runtime_parser.py,sha256=PFNCRk9pGrPIfVwLMcnzmVNMITVjNHhbrOOMwxaSstg,2270
|
|
65
|
-
mapillary_tools/video_data_extraction/extractors/exiftool_xml_parser.py,sha256=Tt0h4TiCKocERWMlRXzlpoaA_WJ_4b20MgMLGYNl4AM,1734
|
|
66
|
-
mapillary_tools/video_data_extraction/extractors/generic_video_parser.py,sha256=34O6Km5kNDoJNJtIUOwtAzzMntuqkSZJfeli7caWSkA,1693
|
|
67
|
-
mapillary_tools/video_data_extraction/extractors/gopro_parser.py,sha256=IVnTyquSraTUaG9rxbJfVWc1-drdY5PaHn5urh3IBk4,1325
|
|
68
|
-
mapillary_tools/video_data_extraction/extractors/gpx_parser.py,sha256=FNrdnXl48k8I1I5fGwYsClhfFEHVsooRLRboUYECv3I,3811
|
|
69
|
-
mapillary_tools/video_data_extraction/extractors/nmea_parser.py,sha256=raSXavBvP-0LJCB_TwLL0mOv2uHSsB744igTsaKAaGc,658
|
|
70
|
-
mapillary_tools-0.13.3a1.dist-info/LICENSE,sha256=l2D8cKfFmmJq_wcVq_JElPJrlvWQOzNWx7gMLINucxc,1292
|
|
71
|
-
mapillary_tools-0.13.3a1.dist-info/METADATA,sha256=3wyt_Iv96Md1JNY358MhdTqO02bb0XKdEoDBMiP3_yw,19760
|
|
72
|
-
mapillary_tools-0.13.3a1.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
73
|
-
mapillary_tools-0.13.3a1.dist-info/entry_points.txt,sha256=A3f3LP-BO_P-U8Y29QfpT4jx6Mjk3sXjTi2Yew4bvj8,75
|
|
74
|
-
mapillary_tools-0.13.3a1.dist-info/top_level.txt,sha256=FbDkMgOrt1S70ho1WSBrOwzKOSkJFDwwqFOoY5-527s,16
|
|
75
|
-
mapillary_tools-0.13.3a1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|