Skip to content

Commit

Permalink
tool script docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgirshick committed Apr 30, 2015
1 parent a25ae1d commit 53a470e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tools/compress_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
# Written by Ross Girshick
# --------------------------------------------------------

"""Compress a Fast R-CNN network using truncated SVD."""

import _init_paths
import caffe
import argparse
import numpy as np
import os, sys

def parse_args():
"""
Parse input arguments
"""
"""Parse input arguments."""
parser = argparse.ArgumentParser(description='Compress a Fast R-CNN network')
parser.add_argument('--def', dest='prototxt',
help='prototxt file defining the uncompressed network',
Expand All @@ -36,8 +36,7 @@ def parse_args():
return args

def compress_weights(W, l):
"""
Compress the weight matrix W of an inner product (fully connected) layer
"""Compress the weight matrix W of an inner product (fully connected) layer
using truncated SVD.
Parameters:
Expand Down
6 changes: 6 additions & 0 deletions tools/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# Written by Ross Girshick
# --------------------------------------------------------

"""
Demo script showing detections in sample images.
See README.md for installation instructions before running.
"""

import _init_paths
from fast_rcnn.config import cfg
from fast_rcnn.test import im_detect
Expand Down
9 changes: 9 additions & 0 deletions tools/reval.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/usr/bin/env python

# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------

"""Reval = re-eval. Re-evaluate saved detections."""

import _init_paths
from fast_rcnn.test import apply_nms
from fast_rcnn.config import cfg
Expand Down
2 changes: 2 additions & 0 deletions tools/test_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Written by Ross Girshick
# --------------------------------------------------------

"""Test a Fast R-CNN network on an image database."""

import _init_paths
from fast_rcnn.test import test_net
from fast_rcnn.config import cfg, cfg_from_file
Expand Down
2 changes: 2 additions & 0 deletions tools/train_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Written by Ross Girshick
# --------------------------------------------------------

"""Train a Fast R-CNN network on a region of interest database."""

import _init_paths
from fast_rcnn.train import get_training_roidb, train_net
from fast_rcnn.config import cfg, cfg_from_file, get_output_dir
Expand Down
5 changes: 5 additions & 0 deletions tools/train_svms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
# Written by Ross Girshick
# --------------------------------------------------------

"""
Train post-hoc SVMs using the algorithm and hyper-parameters from
traditional R-CNN.
"""

import _init_paths
from fast_rcnn.config import cfg, cfg_from_file
from datasets.factory import get_imdb
Expand Down

0 comments on commit 53a470e

Please sign in to comment.