Skip to content

Commit 9cdc9bf

Browse files
authored
chore: remove process_import_meta_properties.py (#701)
* chore: remove deprecated code and usage * wip * usort * fix tests * always check file extensions * fix ruff format * check file extension for xml files * chore: remove process_import_meta_properties.py
1 parent 71c073a commit 9cdc9bf

File tree

2 files changed

+14
-32
lines changed

2 files changed

+14
-32
lines changed

mapillary_tools/commands/process.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
process_finalize,
1111
process_geotag_properties,
1212
)
13-
from ..process_import_meta_properties import process_import_meta_properties
1413
from ..process_sequence_properties import process_sequence_properties
1514

1615

@@ -107,26 +106,6 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
107106
default=None,
108107
required=False,
109108
)
110-
group_metadata.add_argument(
111-
"--orientation",
112-
help="Specify the image orientation in degrees. Note this might result in image rotation. Note this input has precedence over the input read from the import source file.",
113-
choices=[0, 90, 180, 270],
114-
type=int,
115-
default=None,
116-
required=False,
117-
)
118-
group_metadata.add_argument(
119-
"--GPS_accuracy",
120-
help="GPS accuracy in meters. Note this input has precedence over the input read from the import source file.",
121-
default=None,
122-
required=False,
123-
)
124-
group_metadata.add_argument(
125-
"--camera_uuid",
126-
help="Custom string used to differentiate different captures taken with the same camera make and model.",
127-
default=None,
128-
required=False,
129-
)
130109

131110
group_geotagging = parser.add_argument_group(
132111
f"{constants.ANSI_BOLD}PROCESS GEOTAGGING OPTIONS{constants.ANSI_RESET_ALL}"
@@ -260,17 +239,6 @@ def run(self, vars_args: dict):
260239
),
261240
)
262241

263-
metadatas = process_import_meta_properties(
264-
metadatas=metadatas,
265-
**(
266-
{
267-
k: v
268-
for k, v in vars_args.items()
269-
if k in inspect.getfullargspec(process_import_meta_properties).args
270-
}
271-
),
272-
)
273-
274242
metadatas = process_sequence_properties(
275243
metadatas=metadatas,
276244
**(

mapillary_tools/process_geotag_properties.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ def process_finalize(
554554
import_path: T.Union[T.Sequence[Path], Path],
555555
metadatas: T.List[types.MetadataOrError],
556556
skip_process_errors: bool = False,
557+
device_make: T.Optional[str] = None,
558+
device_model: T.Optional[str] = None,
557559
overwrite_all_EXIF_tags: bool = False,
558560
overwrite_EXIF_time_tag: bool = False,
559561
overwrite_EXIF_gps_tag: bool = False,
@@ -564,6 +566,18 @@ def process_finalize(
564566
desc_path: T.Optional[str] = None,
565567
num_processes: T.Optional[int] = None,
566568
) -> T.List[types.MetadataOrError]:
569+
for metadata in metadatas:
570+
if isinstance(metadata, types.VideoMetadata):
571+
if device_make is not None:
572+
metadata.make = device_make
573+
if device_model is not None:
574+
metadata.model = device_model
575+
elif isinstance(metadata, types.ImageMetadata):
576+
if device_make is not None:
577+
metadata.MAPDeviceMake = device_make
578+
if device_model is not None:
579+
metadata.MAPDeviceModel = device_model
580+
567581
# modified in place
568582
_apply_offsets(
569583
[

0 commit comments

Comments
 (0)