Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dopplesoldner committed May 5, 2016
1 parent ef9a928 commit bee8e3b
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,67 +222,67 @@ The following steps give the steps required to train a faster rcnn on
a hypothetical "anime" dataset.

1. Create a softlink for your dataset folder
```
cd $FRCN_ROOT/data
ln -s /home/ubuntu/train_data/anime anime
```
```
cd $FRCN_ROOT/data
ln -s /home/ubuntu/train_data/anime anime
```

2. Define a class for reading the dataset
```
# e.g
cp $FRCN_ROOT/lib/datasets/pascal_voc.py $FRCN_ROOT/lib/datasets/anime.py
# update the file and change the number of classes to match your dataset
```
```
# e.g
cp $FRCN_ROOT/lib/datasets/pascal_voc.py $FRCN_ROOT/lib/datasets/anime.py
# update the file and change the number of classes to match your dataset
```

3. Define your dataset splits (You will need to import the class defined in step 2.)
```
vi $FRCN_ROOT/lib/datasets/factory.py
from datasets.anime import anime
# e.g. anime dataset
for year in ['2016']:
for split in ['train', 'val', 'trainval', 'test']:
name = 'anime_{}_{}'.format(year, split)
# initialize multiple "anime" objects for different data splits
__sets[name] = (lambda split=split, year=year: anime(split, year))
```
```
vi $FRCN_ROOT/lib/datasets/factory.py
from datasets.anime import anime
# e.g. anime dataset
for year in ['2016']:
for split in ['train', 'val', 'trainval', 'test']:
name = 'anime_{}_{}'.format(year, split)
# initialize multiple "anime" objects for different data splits
__sets[name] = (lambda split=split, year=year: anime(split, year))
```

4. Create a models directory which stores caffe configuration files
```
cp $FRCN_ROOT/models/pascal_voc $FRCN_ROOT/models/anime
```
```
cp $FRCN_ROOT/models/pascal_voc $FRCN_ROOT/models/anime
```

5. Update the model configs for the pretrained model you want to start your training with.
E.g. we use the ZF network
```
vi $FRCN_ROOT/models/anime/ZF/faster_rcnn_end2end/train.prototxt
# Change the 'num_classes' in layer 'input-data' to match your dataset
# Change the 'num_output' in layer 'bbox_pred' to match your dataset. Note that bbox_output = 4 * num_classes
# Change the 'num_output' in layer 'cls_score' to match your dataset.
```
```
vi $FRCN_ROOT/models/anime/ZF/faster_rcnn_end2end/train.prototxt
# Change the 'num_classes' in layer 'input-data' to match your dataset
# Change the 'num_output' in layer 'bbox_pred' to match your dataset. Note that bbox_output = 4 * num_classes
# Change the 'num_output' in layer 'cls_score' to match your dataset.
```

6. Change the execution script to add your newly created dataset
```
vi $FRCN_ROOT/experiments/scripts/faster_rcnn_end2end.sh
# Add your dataset under case $DATASET
anime)
TRAIN_IMDB="anime_2007_trainval"
TEST_IMDB="anime_2007_test"
PT_DIR="anime"
ITERS=70000
;;
```
```
vi $FRCN_ROOT/experiments/scripts/faster_rcnn_end2end.sh
# Add your dataset under case $DATASET
anime)
TRAIN_IMDB="anime_2007_trainval"
TEST_IMDB="anime_2007_test"
PT_DIR="anime"
ITERS=70000
;;
```

7. Train the model!
```
cd $FRCN_ROOT
./experiments/scripts/faster_rcnn_end2end.sh 0 ZF anime
```
```
cd $FRCN_ROOT
./experiments/scripts/faster_rcnn_end2end.sh 0 ZF anime
```

If everything goes smoothly, the model should be training.

0 comments on commit bee8e3b

Please sign in to comment.