This is a guide to running the Python script you may see referenced in this forum. Feel free to ask questions or improve the guide.
The scripts, or programs, are written in a language called Python.. For this reason you must install Python. This guide assumes you use Windows, but feel free to ask for guides to Linux or Mac.
From the Python download site download the newest version in the "2" series.
Depending on your computer you want "Windows x86 MSI installer" or "Windows x86-64 MSI installer". Most computers run 64 bit today so that is what you need.
Run the exe file and install everything with default values. Note the path to the folder in which you installed Python. This is usually c:\python27\
Install exifread and Pillow
The scripts use two external Python packages you must install. This is the first time you will use the command line.
Open a command line prompt. You should be able to find the program called "Command line". If not, open the "Run" box, type cmd and enter. Now you should have the command prompt with black background.
First navigate to the folder where you installed Python. If it is c:\python27\ the type:
cd stands for "change directory".
Python should come with a program called "pip" which you can use to install packages.
Let's try to install exifread by typing:
pip install exifread
It will write a lot of text and hopefully not any errors.
Then install Pillow by typing:
pip install Pillow
Again lets hope we don't get any error messages. If you do, please post them in this thread and remember to copy the text.
Download the scripts
Go to the Mapillary Tools site and press the button "Download zip".
Unpack the file into an empty directory.
Run a script
In order to run a script you need 2 files:
2. The script
Unlike a program, a script needs another program to run, which is why you need to reference both. In the case of these scripts you also needs the path to where the images are located.
Because you have run cd into the directory where Python exists, you don't need to worry so much about that. But you must know the path to the scripts. You can use e.g. Windows Explorer to find the path to the directory and then paste the file name into the prompt. Right click in the prompt to paste the contents of the clip board.
If you stop and don't stop the camera it will take a lot of images of the same. This script will put these into a folder named "duplicates". You don't have to run it if you have the habbit of turning off the camera when you stop.
Let's say that the scripts are located in the folder
c:\Documents and settings\My Name\Documents\mapillary\mapillary_tools_python
and the pictures are located in
c:\Documents and settings\My Name\Documents\my Mapillary images
The scripts is named remove-duplicates.py so what you needs to write in the prompt is:
python "c:\Documents and settings\My Name\Documents\mapillary\mapillary_tools_python\remove-duplicates.py" "c:\Documents and settings\My Name\Documents\my Mapillary images"
I.e. you run Python, tells it to run the remove-duplicates.py program and tells the program where to find your images.
When you run the program the duplicates images will be put in a folder named "duplicates". You can look in it and move images back if you do not agree.
Time split will look at when each picture was taken and use that time to put them into separate folders. By default, if there is more than 2 seconds between 2 images, a new sequence is created. You can specify higher values if you want.
The scripts is named time_split.py so what you needs to write in the prompt is:
python "c:\Documents and settings\My Name\Documents\mapillary\mapillary_tools_python\time_split.py" "c:\Documents and settings\My Name\Documents\my Mapillary images"
I.e. you run Python, tells it to run the time_splut.py program and tells the program where to find your images.
You can add a number as the next argument, which is the number of seconds there must be between two images in order to create a new sequence.
Depending on the number of images the script may take a long time to run. Don't be surprised if the script has not given any output after 30 minutes if you have 5000 images.
The scripts creates a folder for each sequence, the first one named 0, then 1 etc.
I will add a section about upload later. There is a lot to write