Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchaoqun56 committed Apr 17, 2019
0 parents commit 78ab3c2
Show file tree
Hide file tree
Showing 11 changed files with 2,733 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bmp
24 changes: 24 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# VGG_CF
Visual Object Tracking based on Correlation Filter using VGG feature. About 2s per frame, can be faster via optimize the code.
Precision rate:86.3%, Success rate: 60.3%

# Dependences
CUDA8.0
cudnn6.0
python==3.6
GPU ~=4.5G memory

# Tracking
1. git clone https://github.com/wangchaoqun56/VGG_CF.git
2. pip install -r requirments.txt
3. cd tracking
eidt configer.py
data_path: path to dataset
vgg_model_path: path to vgg19 model pretrained by ImageNet
4. python tracker.py -s 0 -e 100
--start: index of first sequence
--end: index of last sequence
--gpu: gpu id default='0'

# Other
download vgg19.npy from [vgg19.npy](https://mega.nz/#!xZ8glS6J!MAnE91ND_WyfZ_8mvkuSa2YcA7q-1ehfSm-Q1fxOvvs)
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tensorflow-gpu==1.2.1
scipy==1.2.1
pillow==6.0.0
scikit_image==0.15.0
26 changes: 26 additions & 0 deletions tracking/Logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logger.py

import logging

class Logger():
def __init__(self, logname, loglevel, logger):

self.logger = logging.getLogger(logger)
self.logger.setLevel(logging.DEBUG)

fh = logging.FileHandler(logname)
fh.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)

formatter = logging.Formatter('%(asctime)s-%(name)s-%(levelname)s-%(message)s')
#formatter = format_dict[int(loglevel)]
fh.setFormatter(formatter)
ch.setFormatter(formatter)

self.logger.addHandler(fh)
self.logger.addHandler(ch)

def getlog(self):
return self.logger
79 changes: 79 additions & 0 deletions tracking/configer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import os
import time

import numpy as np
import tensorflow as tf

import vgg19_tf
from funs_tracking import *
from Logger import *
from vgg_utis import vgg_process_images, vgg_resize_maps

#########################
##### gpu parameter #####
#########################
gpu_id = '/gpu:0'
config = tf.ConfigProto(allow_soft_placement=True)
config.gpu_options.allow_growth = True

#########################
#### data params ########
#########################

# data_path = r'/data/cyy/Data/CVPR2013Bechmark_Color/'
# cache_path = r'/data/cyy/Results/vgg_cf_all_scale'
data_path = r'/data3/TB-100/OTB2015'
cache_path = r'./Results'
if not os.path.isdir(cache_path):
os.mkdir(cache_path)
pstr = 'gcnn'

####
padding = {'large': 1, 'height': 0.4, 'generic': 2} # 25~50: 2.5 others 2.2
cell_size0 = 4
batch_size = 1 # fixed
max_win2 = 1600
min_win2 = 1600
fea_sz = np.asarray([57, 57])
#########################
####### VGG Model #######
#########################

vgg_model_path = '/data2/wangchaoqun/model/vgg19.npy'
vgg_batch_size = 1
vgg_out_layers = np.asarray((10, 11, 12, 14, 15, 16))


vgg_is_lrn = False

# image processing params for vgg
img_param = {}
img_param['interp_tool'] = 'misc' # misc or skimage
img_param['interp'] = 'bilinear'
img_param['normal_hw'] = (224, 224)
img_param['normal_type'] = 'keep_all_content'

##################################
###### graph parameters ##########
##################################

gh1 = {'height_width': None, 'number_edges': 4, 'metric': 'euclidean', 'normalized_laplacian': True}

# pca params
pca_is_mean = True
pca_is_norm = False
pca_energy = 100
####
nn_p = 6 #
nn_K = 20
nn_gamma = 1.0

####################### cf params ###############################
search_scale = fun_get_search_scale()

kernel_sigma = 0.5
kernel_type = 'linear'
kernel_gamma = 1 # 1.e-6
update_factor = 0.0075 # Jogging learning 0.005, others 0.015
cf_nframe_update = 1
weight_update_factor = 0.01
Loading

0 comments on commit 78ab3c2

Please sign in to comment.