Skip to content

Instantly share code, notes, and snippets.

View panovr's full-sized avatar

Yili Zhao panovr

View GitHub Profile
@panovr
panovr / finetune.py
Created March 2, 2017 23:04
Fine-tuning pre-trained models with PyTorch
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
@panovr
panovr / readme.md
Created May 15, 2016 10:50 — forked from baraldilorenzo/readme.md
VGG-19 pre-trained model for Keras

##VGG19 model for Keras

This is the Keras model of the 19-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@panovr
panovr / readme.md
Created May 15, 2016 10:50 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@panovr
panovr / caffe_feature_extractor.py
Created April 23, 2016 02:30 — forked from marekrei/caffe_feature_extractor.py
Caffe feature extractor
import numpy as np
import os, sys, getopt
# Main path to your caffe installation
caffe_root = '/path/to/your/caffe/'
# Model prototxt file
model_prototxt = caffe_root + 'models/bvlc_googlenet/deploy.prototxt'
# Model caffemodel file
@panovr
panovr / softmax.py
Created January 27, 2016 12:36 — forked from stober/softmax.py
Softmax in Python
#! /usr/bin/env python
"""
Author: Jeremy M. Stober
Program: SOFTMAX.PY
Date: Wednesday, February 29 2012
Description: Simple softmax function.
"""
import numpy as np
npa = np.array
@panovr
panovr / main.cpp
Created March 29, 2014 04:14
FindMatches
void FindMatches(const Mat &img1, const Mat &img2, vector<MatchPair> &ret_matches)
{
Mat grey1, grey2;
cvtColor(img1, grey1, CV_BGR2GRAY);
cvtColor(img2, grey2, CV_BGR2GRAY);
// Detecting keypoints
Ptr<FeatureDetector> detector = FeatureDetector::create("SURF");
Ptr<DescriptorExtractor> descriptorExtractor = DescriptorExtractor::create("SURF");
@panovr
panovr / CMakeLists.txt
Created March 29, 2014 04:08
lmfit CMake file
add_library(lmfit STATIC
lmmin.c lmcurve.c
lmmin.h lmstruct.h lmcurve.h
)
@panovr
panovr / CMakeLists.txt
Created March 29, 2014 04:06
Project Cmake file
cmake_minimum_required(VERSION 2.8)
project(SimplePanoStitcher)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
find_package(OpenCV REQUIRED core imgproc highgui calib3d features2d nonfree)
include_directories(${OpenCV_INCLUDE_DIRS})
@panovr
panovr / info.txt
Created March 29, 2014 03:57
ReadImages configuration file
968 648
5
sample/001.jpg 729.25
sample/002.jpg 729.25
sample/003.jpg 729.25
sample/004.jpg 729.25
sample/005.jpg 729.25
@panovr
panovr / main.cpp
Created March 29, 2014 03:54
ReadImages
void ReadImages(vector<PanoImage> *pano_images);
int main(int argc, char **argv)
{
vector <PanoImage> pano_images;
ReadImages(&pano_images);
// Some error checking
for (size_t i = 0; i < pano_images.size(); ++i)