From a6021c7c7b2f3edec989549d66f21ab35db2ff12 Mon Sep 17 00:00:00 2001 From: Tao Peng Date: Mon, 10 Feb 2025 13:45:19 +0700 Subject: [PATCH] fix: missing make/model when geotagging with gpx --- .../video_data_extraction/extractors/gopro_parser.py | 6 ++++++ .../video_data_extraction/extractors/gpx_parser.py | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mapillary_tools/video_data_extraction/extractors/gopro_parser.py b/mapillary_tools/video_data_extraction/extractors/gopro_parser.py index 77e488ad3..6fb115d5c 100644 --- a/mapillary_tools/video_data_extraction/extractors/gopro_parser.py +++ b/mapillary_tools/video_data_extraction/extractors/gopro_parser.py @@ -26,6 +26,12 @@ def extract_points(self) -> T.Sequence[geo.Point]: return [] def extract_make(self) -> T.Optional[str]: + model = self.extract_model() + if model: + return "GoPro" + + # make sure self.pointsFound is updated + _ = self.extract_points() # If no points were found, assume this is not a GoPro return "GoPro" if self.pointsFound else None diff --git a/mapillary_tools/video_data_extraction/extractors/gpx_parser.py b/mapillary_tools/video_data_extraction/extractors/gpx_parser.py index bfcdb2410..c37bee667 100644 --- a/mapillary_tools/video_data_extraction/extractors/gpx_parser.py +++ b/mapillary_tools/video_data_extraction/extractors/gpx_parser.py @@ -3,6 +3,7 @@ from ... import geo from ...geotag import geotag_images_from_gpx_file from .base_parser import BaseParser +from .generic_video_parser import GenericVideoParser class GpxParser(BaseParser): @@ -23,7 +24,9 @@ def extract_points(self) -> T.Sequence[geo.Point]: return points def extract_make(self) -> T.Optional[str]: - return None + parser = GenericVideoParser(self.videoPath, self.options, self.parserOptions) + return parser.extract_make() def extract_model(self) -> T.Optional[str]: - return None + parser = GenericVideoParser(self.videoPath, self.options, self.parserOptions) + return parser.extract_model()