Skip to content

Commit

Permalink
Fix: config method
Browse files Browse the repository at this point in the history
  • Loading branch information
zaiyou12 committed Oct 18, 2018
1 parent 396a645 commit 9a4e2d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions dish.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class DishConfig(Config):
# Max number of final detections per image
DETECTION_MAX_INSTANCES = 100

def __init__(self, **kwargs):
def add_args(self, **kwargs):
self.__dict__.update(kwargs)


Expand Down Expand Up @@ -389,7 +389,8 @@ def detect_and_color_splash(model, image_path=None, video_path=None):

# Configurations
if args.command == "train":
config = DishConfig(**dict(args.pairs))
dish_config = DishConfig()
config = dish_config.add_args(**dict(args.pairs))
else:
config = DishIngerenceConfig()
config.display()
Expand Down
16 changes: 8 additions & 8 deletions setting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ git clone https://github.com/zaiyou12/Gatten_sushi_dishi_detection.git
## Run jupyter notebook
cd Gatten_sushi_dishi_detection
source activate tensorflow_p36
pip3 install --upgrade pip
jupyter notebook
pip install --upgrade pip
## jupyter notebook

# 2. Setting for Trainning model
## (after copy data to server)
ssh p3-tokyo-ml
## local to remote
scp data.zip mask_rcnn_coco.h5 p2-tokyo-ml:/home/ubuntu/Gatten_sushi_dishi_detection/
## ssh p2-tokyo-ml
cd Gatten_sushi_dishi_detection && unzip *.zip
rm -rf __MACOSX/ data.zip
rm -rf data.zip
tmux new -s train
source activate tensorflow_p36
pip install imgaug
pip install opencv-python
pip install imgaug opencv-python

## Start Trainning
python3 dish.py train --dataset=${PWD}/data --weights=coco
python3 dish.py train --dataset=${PWD}/data --weights=coco --pairs BACKBONE=resnet50
python3 dish.py train --dataset=${PWD}/data --weights=last;mail -s 'Finished' zaiyou12@gmail.com; sudo shutdown now;

# 3. Run TensorBoard
Expand Down

0 comments on commit 9a4e2d6

Please sign in to comment.