@@ -93,10 +93,9 @@ mv -v storage/dcim/mapillaryimages mapillaryimages
93
93
To [ process videos] ( #video-process ) , you will also need to install ` ffmpeg ` .
94
94
95
95
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:
98
97
99
- On macOS, use [ ` Homebrew ` ] ( https://brew.sh/ ) :
98
+ On macOS, use [ Homebrew] ( https://brew.sh/ ) :
100
99
101
100
``` shell
102
101
brew install ffmpeg
@@ -154,7 +153,9 @@ Upload all processed images in the directory `path/to/images/` to user `mly_user
154
153
. It is optional to specify ` --user_name ` if you have only one user [ authenticated] ( #authenticate ) .
155
154
156
155
``` 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"
158
159
```
159
160
160
161
### Video Process
@@ -196,8 +197,8 @@ mapillary_tools video_process "path/to/videos/" "path/to/sample_images/" \
196
197
--interpolate_directions
197
198
```
198
199
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/ ` .
201
202
202
203
``` shell
203
204
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/" \
206
207
--video_sample_interval 0.5
207
208
```
208
209
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
211
212
in ` path/to/videos/ ` and specifying camera make and model.
212
213
213
214
``` shell
@@ -273,8 +274,9 @@ mapillary_tools authenticate --user_name "mly_user"
273
274
274
275
As the output, the ` procss ` command generates ` mapillary_image_description.json ` under the image directory by default.
275
276
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:
278
280
279
281
``` json
280
282
[
@@ -303,27 +305,43 @@ that contain `error` property will be ignored.
303
305
Write and read the image description file in another location. This is useful if the image directory is readonly.
304
306
305
307
``` 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"
308
312
```
309
313
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:
311
316
312
317
``` 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"
315
322
```
316
323
317
- Geotag from a special CSV format.
324
+ Geotag from a custom CSV format.
318
325
319
326
``` 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"
321
339
```
322
340
323
341
### Zip Images
324
342
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.
327
345
328
346
Mapillary Tools provides ` zip ` command that allows users to specify where to store the zip files, usually somewhere with
329
347
faster IO or more free space.
@@ -339,16 +357,17 @@ mapillary_tools zip "path/to/images/" "path/to/zipped_images/"
339
357
Choose the image description file to write when zipping images:
340
358
341
359
``` 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"
343
362
```
344
363
345
364
Then upload the zip files separately:
346
365
347
366
``` shell
348
367
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 "
352
371
done
353
372
```
354
373
0 commit comments