Skip to content

Commit 40c4433

Browse files
committed
fix README.md
1 parent 31b5ef3 commit 40c4433

File tree

1 file changed

+42
-23
lines changed

1 file changed

+42
-23
lines changed

README.md

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ mv -v storage/dcim/mapillaryimages mapillaryimages
9393
To [process videos](#video-process), you will also need to install `ffmpeg`.
9494

9595
You can download `ffmpeg` from [here](https://ffmpeg.org/download.html). Make sure it is executable and put the
96-
downloaded binaries in your `$PATH`. You can also install `ffmpeg` with your favourite package manager in your system.
97-
For example:
96+
downloaded binaries in your `$PATH`. You can also install `ffmpeg` with your favourite package manager. For example:
9897

99-
On macOS, use [`Homebrew`](https://brew.sh/):
98+
On macOS, use [Homebrew](https://brew.sh/):
10099

101100
```shell
102101
brew install ffmpeg
@@ -154,7 +153,9 @@ Upload all processed images in the directory `path/to/images/` to user `mly_user
154153
. It is optional to specify `--user_name` if you have only one user [authenticated](#authenticate).
155154

156155
```shell
157-
mapillary_tools upload "path/to/images/" --user_name "mly_user" --organization_id "mly_organization_id"
156+
mapillary_tools upload "path/to/images/" \
157+
--user_name "mly_user" \
158+
--organization_key "mly_organization_id"
158159
```
159160

160161
### Video Process
@@ -196,8 +197,8 @@ mapillary_tools video_process "path/to/videos/" "path/to/sample_images/" \
196197
--interpolate_directions
197198
```
198199

199-
Sample GoPro videos in directory `path/to/videos/` into import path `path/to/sample_images/` at a sampling rate 0.5
200-
seconds, i.e. two frames every second, reading geotag data from the GoPro videos in `path/to/videos/`.
200+
**GoPro videos**: Sample GoPro videos in directory `path/to/videos/` into import path `path/to/sample_images/` at a
201+
sampling rate 0.5 seconds, i.e. two frames every second, reading geotag data from the GoPro videos in `path/to/videos/`.
201202

202203
```shell
203204
mapillary_tools video_process "path/to/videos/" "path/to/sample_images/" \
@@ -206,8 +207,8 @@ mapillary_tools video_process "path/to/videos/" "path/to/sample_images/" \
206207
--video_sample_interval 0.5
207208
```
208209

209-
Sample BlackVue videos in directory `path/to/videos/` at a sampling rate 0.2 seconds, i.e. 5 frames every second and
210-
process resulting video frames for user `mapillary_user`, reading geotag data from the BlackVue videos
210+
**BlackVue videos**: Sample BlackVue videos in directory `path/to/videos/` at a sampling rate 0.2 seconds, i.e. 5 frames
211+
every second and process resulting video frames for user `mapillary_user`, reading geotag data from the BlackVue videos
211212
in `path/to/videos/` and specifying camera make and model.
212213

213214
```shell
@@ -273,8 +274,9 @@ mapillary_tools authenticate --user_name "mly_user"
273274

274275
As the output, the `procss` command generates `mapillary_image_description.json` under the image directory by default.
275276
The file contains an array of objects, each of which records the metadata of one image in the image directory. The
276-
metadata is validated by [the image description schema](https://github.com/mapillary/mapillary_tools/tree/master/schema/image_description_schema.json).
277-
Here is a minimal example:
277+
metadata is validated
278+
by [the image description schema](https://github.com/mapillary/mapillary_tools/tree/master/schema/image_description_schema.json)
279+
. Here is a minimal example:
278280

279281
```json
280282
[
@@ -303,27 +305,43 @@ that contain `error` property will be ignored.
303305
Write and read the image description file in another location. This is useful if the image directory is readonly.
304306

305307
```shell
306-
mapillary_tools process "path/to/images/" --desc_path "path/to/description.json"
307-
mapillary_tools upload "path/to/images/" --desc_path "path/to/description.json"
308+
mapillary_tools process "path/to/images/" --desc_path "description.json"
309+
mapillary_tools upload "path/to/images/" --desc_path "description.json"
310+
# equivalent to
311+
mapillary_tools process_and_upload "path/to/images/" --desc_path "description.json"
308312
```
309313

310-
Edit the description with the script `./description_editor.py` before uploading.
314+
Edit the description file with your own scripts, e.g. filter out images outside a bounding box, or snap image locations
315+
to the nearest roads:
311316

312317
```shell
313-
mapillary_tools process "path/to/images/" --desc_path - | ./description_editor.py > "path/to/description.json"
314-
mapillary_tools upload "path/to/images/" --desc_path "path/to/description.json"
318+
mapillary_tools process "path/to/images/" --desc_path - \
319+
| ./filter_by_bbox.py 5.9559,45.818,10.4921,47.8084 \
320+
| ./map_match.py > "description.json"
321+
mapillary_tools upload "path/to/images/" --desc_path "description.json"
315322
```
316323

317-
Geotag from a special CSV format.
324+
Geotag from a custom CSV format.
318325

319326
```shell
320-
./special_csv_to_description.sh special.csv | mapillary_tools upload "path/to/images/" --desc_path -
327+
./custom_csv_to_description.sh special.csv | mapillary_tools upload "path/to/images/" --desc_path -
328+
```
329+
330+
Geotag from a custom video format.
331+
332+
```shell
333+
# sample with ffmpeg
334+
ffmpeg -i "path/to/video.mp4" -vf fps=1/1 -qscale 1 -nostdin "path/to/images/video_%06d.jpg"
335+
# extract geotags from the videos (or other sources)
336+
./geotag_from_custom_video.sh "path/to/video.mp4" > "description.json"
337+
# upload
338+
mapillary_tools upload "path/to/images/" --desc_path "description.json"
321339
```
322340

323341
### Zip Images
324342

325-
When uploading an image directory `mapillary_tools upload path/to/images/`, internally the `upload` command will zip
326-
sequences in the temporary directory (`TMPDIR`) and then upload these zip files.
343+
When [uploading](#upload) an image directory, internally the `upload` command will zip sequences in the temporary
344+
directory (`TMPDIR`) and then upload these zip files.
327345

328346
Mapillary Tools provides `zip` command that allows users to specify where to store the zip files, usually somewhere with
329347
faster IO or more free space.
@@ -339,16 +357,17 @@ mapillary_tools zip "path/to/images/" "path/to/zipped_images/"
339357
Choose the image description file to write when zipping images:
340358

341359
```shell
342-
mapillary_tools zip --desc_path "path/to/image_description.json" "path/to/images/" "path/to/zipped_images/"
360+
mapillary_tools zip "path/to/images/" "path/to/zipped_images/" \
361+
--desc_path "path/to/image_description.json"
343362
```
344363

345364
Then upload the zip files separately:
346365

347366
```shell
348367
for zipfile in path/to/zipped_images/*.zip; do
349-
mapillary_tools upload "$zipfile"
350-
# optionally remove the zipfile after uploaded
351-
rm "$zipfile"
368+
mapillary_tools upload "$zipfile"
369+
# optionally remove the zipfile after uploaded
370+
rm "$zipfile"
352371
done
353372
```
354373

0 commit comments

Comments
 (0)