Skip to content

Instantly share code, notes, and snippets.

View liruoteng's full-sized avatar
🎆

Rhein liruoteng

🎆
View GitHub Profile
@liruoteng
liruoteng / create_flyingthings_lmdb.py
Created March 13, 2019 08:58
Create LMDB for FlyingThings3D
import os
import lmdb
import numpy as np
import pfm
from flowlib import *
from PIL import Image
def read_flow(filename):
"""
function: read flow file function
@liruoteng
liruoteng / plot_loss.py
Created January 26, 2017 08:10
caffe plot training loss
#!/usr/bin/python
import re
import sys
import matplotlib.pyplot as plt
TRAIN_LOSS_PATTERN = r"Iteration (\d+), loss = (\d+\.\d*)"
TEST_LOSS_PATTERN = r"Iteration (\d+), Testing net \(#0\)\n.*= (\d+\.\d+) loss\)\n.*= (\d+\.\d+) loss\)\n.*\n.*\n.*\n.*\n.*\n.*= (\d+\.\d+) loss\)\n.*= (\d+\.\d+) loss\)\n.*= (\d+\.\d+) loss\)\n.*= (\d+\.\d+) loss\)"
def main():
@liruoteng
liruoteng / flow_lmdb.py
Created January 26, 2017 05:42
convert image file and optical flow file into lmdb data
import caffe
import numpy as np
import flowlib as fl
from PIL import Image
def data2lmdb(imagefile1, imagefile2, labelfile):
# define image and ground truth file
imagefile1 = '' # specify 1st image file
imagefile2 = '' # specify 2nd image file
labelfile = '' # specify label file