Skip to content

Commit b37c679

Browse files
committed
feat: afdd make scripts
1 parent 7c957d2 commit b37c679

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"conda",
66
"dtype",
77
"imshow",
8+
"ipynb",
89
"pbtxt",
910
"protoc",
1011
"pyplot",

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ workspace-box:
2727
workspace-mask:
2828
python scripts/workspace/mask/workspace.py --save_dir=$(SAVE_DIR) --name=$(NAME)
2929
cp -r scripts/workspace/mask/files/* $(SAVE_DIR)/$(NAME)
30-
python scripts/workspace/mask/replace.py --dir=$(SAVE_DIR)/$(NAME)/deployments --pattern="{{.Name}}" --repl=$(NAME)
30+
python scripts/workspace/mask/replace.py --dir=$(SAVE_DIR)/$(NAME) --pattern="{{.Name}}" --repl=$(NAME)
3131
cp models/research/object_detection/model_main_tf2.py $(SAVE_DIR)/$(NAME)
3232
cp models/research/object_detection/exporter_main_v2.py $(SAVE_DIR)/$(NAME)
3333
touch $(SAVE_DIR)/$(NAME)/annotations/label_map.pbtxt

scripts/workspace/mask/files/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,17 @@ export:
3232
--input_type image_tensor \
3333
--pipeline_config_path models/mask_rcnn_inception_resnet_v2_1024x1024_coco17_gpu-8/pipeline.config \
3434
--trained_checkpoint_dir models/mask_rcnn_inception_resnet_v2_1024x1024_coco17_gpu-8/ \
35-
--output_directory exported-models/mask_rcnn_inception_resnet_v2_1024x1024_coco17_gpu-8
35+
--output_directory exported-models/mask_rcnn_inception_resnet_v2_1024x1024_coco17_gpu-8
36+
serving:
37+
docker pull tensorflow/serving
38+
docker run -d --name serving_base tensorflow/serving
39+
# https://stackoverflow.com/a/45552938/14785930
40+
docker exec -it serving_base mkdir -p /models/{{.Name}}/1
41+
docker cp exported-models/mask_rcnn_inception_resnet_v2_1024x1024_coco17_gpu-8/saved_model/. serving_base:/models/{{.Name}}/1
42+
docker commit --change "ENV MODEL_NAME {{.Name}}" serving_base {{.Name}}
43+
docker rm -f serving_base
44+
serving-test:
45+
python deployments/serving/client.py
46+
flask:
47+
cp annotations/label_map.pbtxt deployments/flask
48+
cd deployments/flask && make build

scripts/workspace/mask/replace.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ def replace(file_path, pattern, repl):
2323
def get_files(path, all_files):
2424
file_list = os.listdir(path)
2525
for file in file_list:
26+
if ".ipynb" in file:
27+
print('escape ' + file)
28+
continue
2629
cur_path = os.path.join(path, file)
2730
if os.path.isdir(cur_path):
2831
get_files(cur_path, all_files)

0 commit comments

Comments
 (0)