Skip to content

Commit

Permalink
Updating the Negative Chip Mining Script
Browse files Browse the repository at this point in the history
Updating the Negative Chip Mining Script
  • Loading branch information
mahyarnajibi committed Oct 22, 2018
1 parent 82ac588 commit 2e1d60a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/train_neg_props_and_sniper.sh
Expand Up @@ -3,7 +3,7 @@
help_str="Script for extracting proposals required for negative chip mining and training SNIPER with negative chip mining
[options]
--cfg: Path to the SNIPER config file
--prop_save_path: Path to save the extracted proposals for negative chip miningi (default=data/computed_proposals)
--prop_save_path: Path to save the extracted proposals for negative chip mining (default=data/computed_proposals)
--prop_train_path: Path for saving the proposal network weights used for negative chip mining (default=output/sniper_neg_props)"

# Parse the arguments
Expand Down Expand Up @@ -45,25 +45,25 @@ if [ -z ${prop_train_path} ]; then prop_train_path="output/sniper_neg_proposals"

# Train a proposal network just for 2 epochs (for negative chip mining)
echo 'Training a proposal network for 2 epochs'
python main_train.py --set TRAIN.USE_NEG_CHIPS False TRAIN.ONLY_PROPOSAL True \
python main_train.py --cfg ${cfg_path} --set TRAIN.USE_NEG_CHIPS False TRAIN.ONLY_PROPOSAL True \
TRAIN.end_epoch 2 output_path ${prop_train_path}

# Extract proposals for negative mining on training set
SET_NAME=$(python -c "
import init
from configs.faster.default_configs import config,update_config
update_config('configs/faster/sniper_res101_e2e.yml')
update_config('$cfg_path')
print(config.dataset.image_set)
")
IFS='+' read -ra SETS <<< $SET_NAME
for cset in "${SETS[@]}"; do
echo Extracting proposals on "$cset for negative chip mining..."
python main_test.py --set TEST.EXTRACT_PROPOSALS True TEST.PROPOSAL_SAVE_PATH ${prop_save_path} \
python main_test.py --cfg ${cfg_path} --set TEST.EXTRACT_PROPOSALS True TEST.PROPOSAL_SAVE_PATH ${prop_save_path} \
TEST.TEST_EPOCH 2 output_path ${prop_train_path} dataset.test_image_set ${cset}
done


# TRAIN SNIPER with negative chip mining
# Use the output path in the config for saving the final SNIPER models
echo 'Training SNIPER with negative chip mining'
python main_train.py --set proposal_path ${prop_save_path}
python main_train.py --cfg ${cfg_path} --set proposal_path ${prop_save_path}

0 comments on commit 2e1d60a

Please sign in to comment.