Mapillary Tools 0.15.1 and 0.15.2 are released

This release is a follow up to address user feedback from Mapillary Tools 0.15.0 and Mapillary Uploader 5.2.0 releases. Thank you all for giving feedback.

This update makes the duplicate upload check fast. upload and check_upload_history no longer read every file in full to tell whether it was uploaded before. It also stops counting uploads that Mapillary did not finish as uploaded. Files uploaded with an earlier version are uploaded again once if given again: read Backward compatibility before upgrading. Another change in this update is is letting authenticate save organisation names.

Important changes

  • Duplicates are found without reading files in full. upload and check_upload_history computed a checksum of every image, video and zip file first, which could take minutes to an hour for a large drop from an SD card. Now a file whose size no uploaded file had is taken as new without being read. Otherwise, a fingerprint of its size and of 64 KiB from its start, middle and end is looked up. Both commands use the same rule, so uploadskips exactly the files that check_upload_history reports as uploaded (#957). The upload history is looked up
    in an index kept beside it, so commands start quickly even with a large history (#958).
  • Uploads that Mapillary did not finish are no longer counted as uploaded. When finish_upload answered without a cluster ID, as it did for an organization the account is not a member of, upload reported the files as uploaded, exited 0 and recorded them in the upload history, so later runs skipped them. Such an upload now fails with exit code 17 and is not recorded (#955, #956).

New

  • authenticate saves organization names:
    authenticate --user_name PROFILE --organization_key ID --organization_name NAME. An existing profile is not logged in again (#953).
  • Progress before the upload starts: upload and check_upload_history show progress while they load the description file and find the files, which could take seconds without output for 100,000 images (#952).
4 Likes
Loading the description file: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2707/2707 [00:01<00:00, 1809.87 entries/s]
Finding files: 2717 files [00:01, 1802.86 files/s]

The speedup on upload before anything goes β€œover the wire” is significant. :+1: This is how it should have been in the first place. There are even greater speedups to be gained at processing. Just for comparison; JOSM on the exact same setup reads Exif headers at ~600-700 images/s, whereas mapillary_tools just ~20-25 images/s. mapillary_tools is ~29Γ— slower for no reason!

Btw, it may be a bit confusing to some people that the β€œFinding files” number can be greater than the sum of images in all sequences. But, this is just a tiny nit. Perhaps β€œScanned files:” without the redundant trailing β€œfiles” might fit better here?

2 Likes

I am working on speeding up the processing as well. I don’t think we will get a 29x gain however it should improve things… :slight_smile:

2 Likes

mapillary_tools v0.15.2

This release makes process faster and fixes the upload of videos with negative composition offsets, such as
videos stitched with DJI Studio. Apart from that fix, process writes the same description file as v0.15.1, and
upload uploads the same data.

Faster processing

process with the macOS binary on an Apple laptop (best of 3 runs):

Input v0.15.1 v0.15.2
One 416 MB GoPro MAX 2 video 0.69 s 0.31 s
8 GoPro MAX 2 photos 0.79 s 0.33 s
5 videos (Ricoh Theta X, BlackVue, Viofo, two GoPro MAX) 0.90 s 0.31 s
One video geotagged from a 139 MB GPX file (651,455 track points) 11.3 s, 2.0 GB of memory 4.9 s, 0.9 GB of memory

The faster start and GPX reading help image sequences as well as videos. For images, the gain is a fixed
saving per run, so it shows most for small sets. The GoPro and MP4 changes apply to videos only.

Where the time went:

  • Worker processes. process started a pool of worker processes for each geotag source and another for
    validation. On macOS and Windows each pool cost 0.3–0.7 s, while most files take a few milliseconds to read.
    process now starts the work in its own process and hands the rest to workers only when more than about 2 s of
    work is left (#963). --num_processes works as before.
  • GoPro videos. The GPS track of GoPro videos is read 4 to 9 times faster, for example in 0.7 s instead of
    6.5 s for a 21.5 GB HERO12 video (#961).
  • MP4 sample tables. The sample tables of MP4 tracks are read faster. This helps CAMM videos with many IMU
    samples (0.15 s instead of 0.39 s for a 626 MB Ricoh Theta X video), and also video sampling, GPX alignment of
    videos and building the video stream in upload (#962).
  • GPX files. GPX files are read without building an object for every field of every track point, track points
    are read as they are parsed, and garbage collection is paused while reading (#965, #967). A GPX file that the
    fast reader cannot read exactly as gpxpy would is read with gpxpy, as before.

Fixes

  • Videos with negative composition offsets in their MP4 ctts box, such as 360 videos stitched with DJI Studio and
    some H.265 videos, could not be uploaded since v0.14.6: upload failed with
    FormatFieldError ... sample_offset. They are uploaded again (#966).

Official release notes: Release v0.15.2 Β· mapillary/mapillary_tools Β· GitHub

3 Likes