Skip to main content

MAPILIO Image/Video Upload and Pipeline

Project description

Mapilio Kit

Mapilio Kit is a library for processing and uploading images to Mapilio.

Kit Contents

Introduction

Our Image Uploader with GPS Metadata is a powerful tool designed to simplify the process of uploading and managing images, while also preserving and utilizing valuable location-based information embedded in photos. With the increasing popularity of geotagging in modern cameras and smartphones, GPS metadata in images can provide valuable context and enhance the user experience. Whether you're a photographer, a traveler, or simply someone who values the story behind each image, our uploader has you covered.

Getting Started

These instructions will help contributors get a copy of your project up and running on their local machine for development and testing purposes.

  1. Prerequisites:

    To upload images to Mapilio, an account is required and can be created here. When using the kits for the first time, user authentication is required. You will be prompted to enter your account credentials.

  2. Installation:

    To install Mapilio Kit Pip and Python (3.6 and above) is required. If you have them already, then simply run this command below:

    pip install mapilio_kit
  3. Note:In case you're using Windows, and if python's path wasn't already added to system environment variables you need to add it right after python installation, to be able to run the packages which are installed with Pip. You may do that manually or you may run the command prompt as Administrator and then copy the command below, modify it (according to your python's version and path) and lastly run it. This will be set your python's path automatically after rebooting your computer.

    setx PATH %"PATH%;C:\Users\User\AppData\Local\Packages\Python\Python3XX\Scripts" /M
  4. Necessary tools:

    To process images or videos, you will also need to install ffmpeg and exiftool.

    You can download ffmpeg from here. Make sure it is executable and put the downloaded binaries in your $PATH. You can also install ffmpeg with your favorite package manager. For example:

    On Windows:

    Open PowerShell as administrator: (Recommended)

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    choco install ffmpeg
    choco install exiftool

    or you could follow the ffmpeg and exiftool installation guides.

    On macOS, use Homebrew:

    brew install ffmpeg
    brew install exiftool
        

    On Debian/Ubuntu:

    sudo apt install ffmpeg
    sudo apt install exiftool
        

Magic Usage

To use magic usage simply run this command below:

mapilio_kit run

Advanced Usage

Getting Started

These instructions will help contributors get a copy of your project up and running on their local machine for development and testing purposes.

  1. Prerequisites:

    To upload images to Mapilio, an account is required and can be created here. When using the kits for the first time, user authentication is required. You will be prompted to enter your account credentials.

  2. Installation:
    • via Pip on Windows and Python (3.6 and above) and git are required:

    • Note: In case you're using PowerShell to run these commands below, you need to re-activate virtual env after installation is done, however, if you're using Command Prompt you don't need to re-activate it.

      # Installation commands
      git clone https://github.com/mapilio/mapilio-kit-v2.git
      cd mapilio-kit-v2
      win_installer.cmd
      
    • via Pip on Ubuntu + 18.04 and Python (3.6 and above) and git are required:

    • # Installation commands
      git clone https://github.com/mapilio/mapilio-kit-v2.git
      cd mapilio-kit-v2
      chmod +x install.sh
      source ./install.sh
      
    • via Pip on macOS and Python (3.6 and above) and git are required. In addition, commands for ubuntu can also be used for macOS, however, in case using Mac Terminal instead of using iTerm for installation you need to re-activate the virtual env. Otherwise, you're not going to be able to run the kit.


  3. Necessary tools:

    To process images or videos, you will also need to install ffmpeg and exiftool.

    You can download ffmpeg from here. Make sure it is executable and put the downloaded binaries in your $PATH. You can also install ffmpeg with your favorite package manager. For example:

    On Windows:

    Follow the ffmpeg and exiftool installation guides.

    or

    Open PowerShell:

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
    choco install ffmpeg
    choco install exiftool

    On macOS, use Homebrew:

    brew install ffmpeg
    brew install exiftool
    

    On Debian/Ubuntu:

    sudo apt install ffmpeg
    sudo apt install exiftool
    

User Authentication

To upload images to mapilio, an account is required and can be created here. When using the tools for the first time, user authentication is required. You will be prompted to enter your account credentials.

Authenticate new user:

mapilio_kit authenticate

If the user is already authenticated earlier, it will update the credentials in the config:

mapilio_kit authenticate --user_name "mapilio_user_name" --user_email "mapilio_user_email" --user_password "mapilio_user_password"

Images upload

Upload command also works for timelapse images.If you haven't processed your images, please use this command below

mapilio_kit upload "path/to/images" 

If you have processed your images already, use this one instead

mapilio_kit upload "path/to/images" --processed

Video Images upload

Video Support Devices: GoPro Hero 9-8-7 Black and 360, and other devices that support GPS metadata.

  1. Sample GoPro videos in directory path/to/videos/ into import path (must be created before starting)path/to/sample_images/ at a sampling rate 1 seconds, i.e. two frames every second, reading geotag data from the GoPro videos in path/to/videos/
  2. mapilio_kit video_upload "path/to/videos/" "path/to/sample_images/" \
        --geotag_source "gopro_videos" \
        --interpolate_directions \
        --video_sample_interval 1
    
  3. Checking path/to/sample_images/ images and mapilio_image_description.json then run under command
mapilio_kit video_upload "path/to/sample_images/" --desc_path "mapilio_image_description.json" --processed

GoPro Max .360 videos

Must be installed with this method ./max_extractor_install.sh

  1. First, create equirectangular convert script such as below

python script config

  • --video-file {video file path}
  • --output-folder {output frames path}
  • --bin-dir {equirectanguler bin path}
mapilio_kit gopro360max_process --video-file ~/Desktop/GS017111.360 --output-folder ~/Desktop/OutputData/ --bin-dir ../../bin
  1. Now we can upload frames
mapilio_kit upload ~/Desktop/OutputData/frames --user_name="username@mapilio.com" \
                    --geotag_source "gpx" \
                    --geotag_source_path "~Desktop/gps_track.gpx"

Decompose Images

The decompose command geotags images in the given directory. It extracts the required and optional metadata from image EXIF (or the other supported geotag sources), and writes all the metadata (or process errors) in an image description file, which will be read during upload.

mapilio_kit decompose "path/to/images" 

360 panorama image upload

Check the CSV format panoramic image description schema.

mapilio_kit image_and_csv_upload "path/to/images" --csv_path "path/to/test.csv" --user_name "example@mapilio.com"

Zip and upload

mapilio_kit zip  "path/to/images"  "path/to/zipfolder"
mapiio_kit upload "path/to/zipfolder" --proccessed

Docker Support

To run the scripts inside a Docker container:

make docker
docker run -Pit kit mapilio_kit [ run | advance usage ]

License

This project is licensed under the MIT LICENSE - see the LICENSE.md file for details.

Contact

For Mapilio Kit bug reports and feature requests please visit GitHub Issues, and join our Discord community for questions and discussions!


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapilio-kit-2.0.7.tar.gz (51.0 kB view hashes)

Uploaded Source

Built Distribution

mapilio_kit-2.0.7-py2.py3-none-any.whl (61.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page