Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 49 additions & 2 deletions mapillary_tools/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,58 @@ class MapillaryStationaryVideoError(MapillaryDescriptionError):
pass


class MapillaryProcessWarning(UserWarning):
"""
Base class for what processing warns of about a file that it still
processes: logged, never raised
"""


class MapillaryGPXAlignmentWarning(MapillaryProcessWarning):
"""
A GPX track assumed to start with a video without a GPS clock lasts longer
or shorter than the video: the video start time needs aligning with the
track. A track that lasts longer (gpx_longer) may be that of a timelapse.
Durations are in seconds, the GPX times capture times.
"""

def __init__(
self,
message: str,
video_duration: float,
gpx_duration: float,
gpx_start_time: str,
gpx_end_time: str,
gpx_longer: bool,
):
super().__init__(message)
self.video_duration = video_duration
self.gpx_duration = gpx_duration
self.gpx_start_time = gpx_start_time
self.gpx_end_time = gpx_end_time
self.gpx_longer = gpx_longer

def __reduce__(self):
# Pickle with every argument, so that the warning survives the trip
# back from a worker process (video geotagging warns in one)
return (
self.__class__,
(
self.args[0],
self.video_duration,
self.gpx_duration,
self.gpx_start_time,
self.gpx_end_time,
self.gpx_longer,
),
)


class MapillaryGPXVideoStartUnknownError(MapillaryDescriptionError):
"""
Nothing says how a GPX track lines up with a video without a GPS clock:
the track is said to start with the video (--interpolation_use_gpx_start_time)
but is too long to end with it at the rate the video is said to run.
the track is too long either to assume that it starts with the video, or,
when it is said to, to end with it at the rate the video is said to run.
"""


Expand Down
317 changes: 92 additions & 225 deletions mapillary_tools/geotag/video_extractors/gpx.py

Large diffs are not rendered by default.

193 changes: 0 additions & 193 deletions mapillary_tools/geotag/video_start_time.py

This file was deleted.

Loading
Loading