GithubHelp home page GithubHelp logo

liruoteng / opticalflowtoolkit Goto Github PK

View Code? Open in Web Editor NEW
297.0 8.0 81.0 8.28 MB

Python-based optical flow toolkit for existing popular dataset

License: MIT License

Python 100.00%
optical-flow ground-truth kitti sintel middlebury python

opticalflowtoolkit's Introduction

OPTICAL FLOW TOOLKIT v0.1

RUOTENG LI

20 July 2016

996.icu LICENSE

This toolkit is a python implementation for read, write, calculate, and visualize KITTI 2012 Optical Flow, which contains 200 training and 200 test image pairs each. Ground truth has been aquired by accumulating 3D point clouds from a 360 degree Velodyne HDL-64 Laserscanner according to Andreas Geiger [].

File description:

=================

  • lib/kittitool.py : toolkit for KITTI optical flow dataset
  • demo.py : demonstration on read and visualize KITTI optical flow data
  • lib/flowlib.py : library for manipulate optical flow ...

1. Pre-Requisite:

  1. Python2.7
  2. Numpy and Scipy
  3. Matplotlib
  4. pypng package

2. Installation:

2.1 Installing Python and Pip

You may want to get started on a Unix environment such as Ubuntu, or Linux OS, and use pip to manage python package installation. pip installation guide Briefly for Linux user:

python get-pip.py

2.2 Install Scipy Numpy

sudo pip install scipy
sudo pip install numpy

2.3 Install Matplotlib

pip install matplotlib

2.4 Install PyPng

sudo pip install pypng

3. Usage

python demo.py

4. Scripts for Training Loss Visualization

In your terminal, locate the root directory of this repository, type the following

cd scripts/
python plot_loss.py <YOUR TRAINING LOG FILE>

The plot will be saved with the same name of your logfile in .png format.

5. Scripts for Data Manipulation

5.1 random_crop.py

This program crops the original image data set into small patches specified by the input, by default the size is 384x512 (px). Please make sure that your input image is larger than the patches you want to get. The cropping distribution is uniform across the entire image.

python random_crop.py <name_of_dataset> <number_of_patches> --height <height_of_output_patch> --width <width_of_output_patch>

The patches will be generated at folder and the following files will be generated for CNN training:

  • flo_list.txt
  • img1_list.txt
  • img2_list.txt

5.2 create_filelist

This program create three file lists that containing all the paths of the images/flow files from a dataset. The output of this program will be one single file "filelist.txt" that contains the file path you want to search in the dataset.

python create_filelist.py <file_format> --input_dir <path_of_dataset> --output_dir <output_path>

5.3 crop_flow.py

This program crops the image files and flow files from a dataset at a specific location.

python crop_flow.py <input_dir> <output_dir> <x> <y> <height_of_patch> <width_of_patch> --image_format <format_of_image> --flow_format <format_of_flow>

5.4 segment_flow.py

This script segment the flow into 9 classes according to the flow orientation. Each 45 degree will be recognized into one class starting from 0 degree on x axis.

python segment_flow.py <format_of_flowfile> <input_directory> --output_dir <output_directory>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.