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
16 changes: 10 additions & 6 deletions mapillary_tools/commands/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
from ..process_sequence_properties import process_sequence_properties


def bold_text(text: str) -> str:
ANSI_BOLD = "\033[1m"
ANSI_RESET_ALL = "\033[0m"
return f"{ANSI_BOLD}{text}{ANSI_RESET_ALL}"


class Command:
name = "process"
help = "process images and videos"
Expand Down Expand Up @@ -52,9 +58,7 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
default=",".join(sorted(t.value for t in FileType)),
required=False,
)
group = parser.add_argument_group(
f"{constants.ANSI_BOLD}PROCESS EXIF OPTIONS{constants.ANSI_RESET_ALL}"
)
group = parser.add_argument_group(bold_text("PROCESS EXIF OPTIONS"))
group.add_argument(
"--overwrite_all_EXIF_tags",
help="Overwrite all of the relevant EXIF tags with the values obtained in process. It is equivalent to supplying all the --overwrite_EXIF_*_tag flags.",
Expand Down Expand Up @@ -92,7 +96,7 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
)

group_metadata = parser.add_argument_group(
f"{constants.ANSI_BOLD}PROCESS METADATA OPTIONS{constants.ANSI_RESET_ALL}"
bold_text("PROCESS METADATA OPTIONS")
)
group_metadata.add_argument(
"--device_make",
Expand All @@ -108,7 +112,7 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
)

group_geotagging = parser.add_argument_group(
f"{constants.ANSI_BOLD}PROCESS GEOTAGGING OPTIONS{constants.ANSI_RESET_ALL}"
bold_text("PROCESS GEOTAGGING OPTIONS")
)
group_geotagging.add_argument(
"--desc_path",
Expand Down Expand Up @@ -174,7 +178,7 @@ def add_basic_arguments(self, parser: argparse.ArgumentParser):
)

group_sequence = parser.add_argument_group(
f"{constants.ANSI_BOLD}PROCESS SEQUENCE OPTIONS{constants.ANSI_RESET_ALL}"
bold_text("PROCESS SEQUENCE OPTIONS")
)
group_sequence.add_argument(
"--cutoff_distance",
Expand Down
5 changes: 2 additions & 3 deletions mapillary_tools/commands/sample_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

from .. import constants
from ..sample_video import sample_video
from .process import bold_text


class Command:
name = "sample_video"
help = "sample video into images"

def add_basic_arguments(self, parser: argparse.ArgumentParser):
group = parser.add_argument_group(
f"{constants.ANSI_BOLD}VIDEO PROCESS OPTIONS{constants.ANSI_RESET_ALL}"
)
group = parser.add_argument_group(bold_text("VIDEO PROCESS OPTIONS"))
group.add_argument(
"--video_sample_distance",
help="The minimal distance interval, in meters, for sampling video frames. [default: %(default)s]",
Expand Down
5 changes: 2 additions & 3 deletions mapillary_tools/commands/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from .. import constants
from ..upload import upload
from .process import bold_text


class Command:
Expand Down Expand Up @@ -30,9 +31,7 @@ def add_common_upload_options(group):
)

def add_basic_arguments(self, parser):
group = parser.add_argument_group(
f"{constants.ANSI_BOLD}UPLOAD OPTIONS{constants.ANSI_RESET_ALL}"
)
group = parser.add_argument_group(bold_text("UPLOAD OPTIONS"))
group.add_argument(
"--desc_path",
help=f'Path to the description file generated by the process command. The hyphen "-" indicates STDIN. [default: {{IMPORT_PATH}}/{constants.IMAGE_DESCRIPTION_FILENAME}]',
Expand Down
2 changes: 0 additions & 2 deletions mapillary_tools/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

_ENV_PREFIX = "MAPILLARY_TOOLS_"

ANSI_BOLD = "\033[1m"
ANSI_RESET_ALL = "\033[0m"
# In meters
CUTOFF_DISTANCE = float(os.getenv(_ENV_PREFIX + "CUTOFF_DISTANCE", 600))
# In seconds
Expand Down
Loading
Loading