Commit 6525804a authored by Ross Girshick's avatar Ross Girshick

misc cleanup

parent 390f538d
#!/usr/bin/env python
import _init_paths
import fast_rcnn as frc
from fast_rcnn.test import apply_nms
from fast_rcnn.config import cfg
from datasets.factory import get_imdb
import cPickle
......@@ -36,7 +36,7 @@ def from_dets(imdb_name, output_dir):
dets = cPickle.load(f)
print 'Applying NMS to all detections'
nms_dets = frc.test.apply_nms(dets, cfg.TEST.NMS)
nms_dets = apply_nms(dets, cfg.TEST.NMS)
print 'Evaluating detections'
imdb.evaluate_detections(nms_dets, output_dir)
......
......@@ -8,7 +8,7 @@
# --------------------------------------------------------
import _init_paths
import fast_rcnn as frc
from fast_rcnn.test import test_net
from fast_rcnn.config import cfg, cfg_from_file
from datasets.factory import get_imdb
import caffe
......@@ -47,7 +47,6 @@ def parse_args():
args = parser.parse_args()
return args
if __name__ == '__main__':
args = parse_args()
......@@ -76,4 +75,4 @@ if __name__ == '__main__':
if 'cleanup' in imdb.config:
imdb.config['cleanup'] = False
frc.test.test_net(net, imdb)
test_net(net, imdb)
......@@ -65,11 +65,11 @@ if __name__ == '__main__':
if args.gpu_id is not None:
caffe.set_device(args.gpu_id)
imdb_train = get_imdb(args.imdb_name)
print 'Loaded dataset `{:s}` for training'.format(imdb_train.name)
roidb = get_training_roidb(imdb_train)
imdb = get_imdb(args.imdb_name)
print 'Loaded dataset `{:s}` for training'.format(imdb.name)
roidb = get_training_roidb(imdb)
output_dir = get_output_dir(imdb_train, None)
output_dir = get_output_dir(imdb, None)
print 'Output will be saved to `{:s}`'.format(output_dir)
train_net(args.solver, roidb, output_dir,
......
......@@ -327,17 +327,16 @@ if __name__ == '__main__':
out = os.path.splitext(os.path.basename(args.caffemodel))[0] + '_svm'
out_dir = os.path.dirname(args.caffemodel)
imdb_train = get_imdb(args.imdb_name)
print 'Loaded dataset `{:s}` for training'.format(imdb_train.name)
imdb = get_imdb(args.imdb_name)
print 'Loaded dataset `{:s}` for training'.format(imdb.name)
# enhance roidb to contain flipped examples
if cfg.TRAIN.USE_FLIPPED:
print 'Appending horizontally-flipped training examples...'
imdb_train.append_flipped_roidb()
imdb.append_flipped_roidb()
print 'done'
trainer = SVMTrainer(net, imdb_train)
trainer.train()
SVMTrainer(net, imdb).train()
filename = '{}/{}.caffemodel'.format(out_dir, out)
net.save(filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment